48 #include <adi_processor.h> 49 #include <adi_callback.h> 50 #include <adi_adc_config.h> 51 #include <rtos_map/adi_rtos_map.h> 66 #define ADI_ADC_MEMORY_SIZE (48u + ADI_SEM_SIZE) 124 #define ADI_ADC_CHANNEL_0 (1u << 0u) 125 #define ADI_ADC_CHANNEL_1 (1u << 1u) 126 #define ADI_ADC_CHANNEL_2 (1u << 2u) 127 #define ADI_ADC_CHANNEL_3 (1u << 3u) 128 #define ADI_ADC_CHANNEL_4 (1u << 4u) 129 #define ADI_ADC_CHANNEL_5 (1u << 5u) 130 #define ADI_ADC_CHANNEL_6 (1u << 6u) 131 #define ADI_ADC_CHANNEL_7 (1u << 7u) 172 uint32_t nMemorySize,
185 ADI_CALLBACK pfCallback,
220 bool* pbCalibrationDone
227 uint32_t nAcqTimeInAClkCycles
233 uint32_t nDelayInAClkCycles
245 uint16_t nAveragingSamples
277 uint32_t nNumMonitorCycles
283 bool bEnableComparator
307 bool* pbIsBufferAvailable
322 uint32_t nRefVoltage,
323 uint32_t* pnBatVoltage
335 uint32_t nRefVoltage,
336 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_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. If this function return true, then a call to adi_adc_GetBuffer will not block.
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.