This part of the platform interface groups functions related to the ADC interface(s) of the MCU.


int platform_adc_exists( unsigned id );

Checks if the platform has the hardware ADC specified as argument. Implemented in src/common.c, it uses the NUM_ADC macro that must be defined in the platform's platform_conf.h file (see here for details). For example:

#define NUM_ADC   1      // The platform has 1 ADC interface

Arguments: id - ADC interface ID

Returns: 1 if the ADC interface exists, 0 otherwise

u32 platform_adc_op( unsigned id, int op, u32 data );

Executes an operation on an ADC channel



int platform_adc_check_timer_id( unsigned id, unsigned timer_id );

Checks whether a timer may be used with a particular ADC channel


  • id - ADC channel ID
  • timer_id - Timer ID

Returns: 1 if the timer may be used to trigger the ADC channel, 0 if not