16 #include <adi_processor.h> 17 #include <adi_callback.h> 18 #include <adi_adc_config.h> 19 #include <rtos_map/adi_rtos_map.h> 34 #define ADI_ADC_MEMORY_SIZE (48u + ADI_SEM_SIZE) 92 #define ADI_ADC_CHANNEL_0 (1u << 0u) 93 #define ADI_ADC_CHANNEL_1 (1u << 1u) 94 #define ADI_ADC_CHANNEL_2 (1u << 2u) 95 #define ADI_ADC_CHANNEL_3 (1u << 3u) 96 #define ADI_ADC_CHANNEL_4 (1u << 4u) 97 #define ADI_ADC_CHANNEL_5 (1u << 5u) 98 #define ADI_ADC_CHANNEL_6 (1u << 6u) 99 #define ADI_ADC_CHANNEL_7 (1u << 7u) 140 uint32_t nMemorySize,
153 ADI_CALLBACK pfCallback,
188 bool* pbCalibrationDone
195 uint32_t nAcqTimeInAClkCycles
201 uint32_t nDelayInAClkCycles
213 uint16_t nAveragingSamples
245 uint32_t nNumMonitorCycles
251 bool bEnableComparator
275 bool* pbIsBufferAvailable
282 uint32_t nNumConversionPasses,
290 uint32_t nRefVoltage,
291 uint32_t* pnBatVoltage
303 uint32_t nRefVoltage,
304 int32_t* pnTemperature
ADI_ADC_RESULT adi_adc_Close(ADI_ADC_HANDLE hDevice)
Close the given device instance.
ADI_ADC_RESULT adi_adc_SetLowLimit(ADI_ADC_HANDLE hDevice, ADI_ADC_CHANNEL eChannel, bool bEnable, uint16_t nLowLimit)
Configure low limit for an ADC channel when it is used as a digital comparator.
ADI_ADC_RESULT adi_adc_IsCalibrationDone(ADI_ADC_HANDLE hDevice, bool *pbCalibrationDone)
Returns the status of the calibration which was initiated.
ADI_ADC_RESULT adi_adc_EnableIRQ(ADI_ADC_HANDLE hDevice, bool bEnable)
Enable/Disable ADC Interrupts.
ADI_ADC_RESULT adi_adc_EnableTemperatureSensor(ADI_ADC_HANDLE hDevice, bool bEnable)
Enable or disable the temperature sensor.
ADI_ADC_RESULT adi_adc_EnableAveraging(ADI_ADC_HANDLE hDevice, uint16_t nAveragingSamples)
Enable Averaging for all ADC channels.
ADI_ADC_RESULT adi_adc_SetHysteresis(ADI_ADC_HANDLE hDevice, ADI_ADC_CHANNEL eChannel, bool bEnable, uint16_t nHysteresis)
Configure hysteresis for an ADC channel when it's used as a digital comparator.
ADI_ADC_RESULT adi_adc_ReadChannels(ADI_ADC_HANDLE hDevice, uint32_t nChannels, uint32_t nNumConversionPasses, void *pBuffer, uint32_t nBuffLength)
Sample the given channels for the given number of conversion passes and put it into the given buffer....
ADI_ADC_RESULT adi_adc_SinkEnable(ADI_ADC_HANDLE hDevice, bool bEnable)
Enable/Disable Current Sink.
ADI_ADC_RESULT adi_adc_Open(uint32_t nDeviceNum, void *pMemory, uint32_t nMemorySize, ADI_ADC_HANDLE *phDevice)
Opens an ADC device instance.
ADI_ADC_RESULT adi_adc_SetDelayTime(ADI_ADC_HANDLE hDevice, uint32_t nDelayInAClkCycles)
Set the delay time of ADC in ADC cycles for multi iteration mode.
ADI_ADC_RESULT adi_adc_EnableADCSubSystem(ADI_ADC_HANDLE hDevice, bool bEnable)
Enable/Disables the ADC Subsystem.
ADI_ADC_RESULT adi_adc_SetNumMonitorCycles(ADI_ADC_HANDLE hDevice, ADI_ADC_CHANNEL eChannel, uint32_t nNumMonitorCycles)
Configure number of monitor cycles for an ADC channel when it's used as a digital comparator.
ADI_ADC_RESULT adi_adc_PowerUp(ADI_ADC_HANDLE hDevice, bool bPowerUp)
Power up ADC.
ADI_ADC_RESULT adi_adc_GetBuffer(ADI_ADC_HANDLE hDevice, ADI_ADC_BUFFER **ppBuffer)
Get a processed buffer from the ADC Driver. This function is a blocking call and will only return onc...
ADI_ADC_RESULT adi_adc_GetBatteryVoltage(ADI_ADC_HANDLE hDevice, uint32_t nRefVoltage, uint32_t *pnBatVoltage)
Returns the battery voltage.
ADI_ADC_RESULT adi_adc_SetHighLimit(ADI_ADC_HANDLE hDevice, ADI_ADC_CHANNEL eChannel, bool bEnable, uint16_t nHighLimit)
Configure high limit for an ADC channel when it's used as a digital comparator.
ADI_ADC_RESULT adi_adc_IsBufferAvailable(ADI_ADC_HANDLE hDevice, bool *pbIsBufferAvailable)
This function return whether a filled buffer is available to be returned to the user....
uint32_t nNumConversionPasses
struct __ADI_ADC_BUFFER ADI_ADC_BUFFER
ADI_ADC_RESULT adi_adc_SetAcquisitionTime(ADI_ADC_HANDLE hDevice, uint32_t nAcqTimeInAClkCycles)
Set the acquisition time of ADC in ADC clock cycles.
ADI_ADC_RESULT adi_adc_SetResolution(ADI_ADC_HANDLE hDevice, ADI_ADC_RESOLUTION eResolution)
Set the resolution of ADC. he default resolution of ADC is 12-bit and the ADC increases the resolutio...
ADI_ADC_RESULT adi_adc_SubmitBuffer(ADI_ADC_HANDLE hDevice, ADI_ADC_BUFFER *pBuffer)
Submit the ADC buffer for processing to the ADC Module.
ADI_ADC_RESULT adi_adc_Enable(ADI_ADC_HANDLE hDevice, bool bEnable)
Enable/Disable ADC for sampling.
ADI_ADC_RESULT adi_adc_IsReady(ADI_ADC_HANDLE hDevice, bool *pbReady)
Returns whether the ADC Subsystem is ready.
ADI_ADC_RESULT adi_adc_GetTemperature(ADI_ADC_HANDLE hDevice, uint32_t nRefVoltage, int32_t *pnTemperature)
Return the temperature in fixed point format in degree Celcius.
struct __ADI_ADC_DEVICE * ADI_ADC_HANDLE
ADI_ADC_RESULT adi_adc_RegisterCallback(ADI_ADC_HANDLE hDevice, ADI_CALLBACK pfCallback, void *pCBParam)
Registering a callback function.
ADI_ADC_RESULT adi_adc_EnableDigitalComparator(ADI_ADC_HANDLE hDevice, bool bEnableComparator)
Enable/Disable digital comparator for the given channel(s)
ADI_ADC_RESULT adi_adc_SetVrefSource(ADI_ADC_HANDLE hDevice, ADI_ADC_VREF_SRC eVrefSrc)
Set the Voltage Reference source.
ADI_ADC_RESULT adi_adc_StartCalibration(ADI_ADC_HANDLE hDevice)
Start the ADC calibration.