1.3.2.15 1.4.2.15 1.5.2.15 1.8.2.25 1.14.1.14 1.15.1.14 1.16.1.16 1.17.1.16 1.18.1.16 1.19.1.16 1.20.1.16 1.21.1.16 1.25.1.21 1.26.1.21 1.27.2.21 1.28.2.25 1.29.2.15 1.30.2.14 1.31.2.14 1.32.2.20 1.33.2.14 1.35.1.14 1.36.1.14 1.37.2.14 1.38.2.15 1.39.1.15 1.40.2.15 1.41.1.21 ADC_CALLBACK Typedef
C
typedef void (*ADC_CALLBACK)(ADC_STATUS status, uintptr_t context); typedef void (*ADC_CALLBACK)(uint32_t status, uintptr_t context); typedef void (*ADC_CALLBACK)(uint32_t interruptStatus, uint32_t eocInterruptStatus, uintptr_t context); typedef void (*ADC_CALLBACK)(uintptr_t context);
Summary
Defines the data type and function signature for the adc peripheral callback function.
Description
This data type defines the function signature for the adc peripheral callback function. The adc peripheral will call back the client's function with this signature at the end of conversion.
Precondition
ADC_Initialize() must have been called for the given adc peripheral instance and ADC_CallbackRegister() must have been called to set the function to be called.
Parameters
Param | Description |
---|---|
status | interrupt status. |
context | Allows the caller to provide a context value (usually a pointer to the callers context for multi-instance clients) |
interruptStatus | Status of interrupt |
eocInterruptStatus | Status of EOC interrupt |
Returns
None.
Example
void ADC_ResultReadyCallback( ADC_STATUS status, uintptr_t context ) { uint16_t adcResult = 0; adcResult = ADC_ConversionResultGet(); } ADC_CallbackRegister(ADC_ResultReadyCallback, uintptr_t(NULL));
void ADC_Callback(uint32_t interruptStatus, uint32_t eocInterruptStatus, uintptr_t context)
{
}
ADC_CallbackRegister(ADC_Callback, NULL);
void ADC_Callback (uintptr_t context) { } ADC_CallbackRegister(ADC_Callback, NULL);
Remarks
The callback feature is only available when the library was generated with interrupt option (in MHC) enabled.