ADC#

This module provides a low-level interface to two ADC channels, which are intended to be used for the accelerator and brake pedals. Internally, we use DMA to continuously copy the ADC values into an array that is served out.

group BSP_ADC

Defines

MAX_CHANNELS 10#
ADC_PRECISION_BITS 12#
ADC_RANGE_MILLIVOLTS 3300#

Enums

enum ADC_t#

Values:

enumerator Accelerator_ADC#
enumerator Brake_ADC#
enumerator NUMBER_OF_CHANNELS#

Functions

void BSP_ADC_Init(void)#

Initialize the ADC module.

Initialize the ADC module.

Returns:

None

Parameters:

None

Returns:

None

int16_t BSP_ADC_Get_Value(ADC_t hardwareDevice)#

Provides the ADC value of the channel at the specified index.

Provides the ADC value of the channel at the specified index.

Parameters:
  • hardwareDevice – pedal enum that represents the specific device

  • None

Returns:

Raw ADC value without conversion

Returns:

millivoltage value ADC measurement

int16_t BSP_ADC_Get_Millivoltage(ADC_t hardwareDevice)#

Provides the ADC value in millivolts of the channel at the specified index.

Provides the ADC value in millivolts of the channel at the specified index.

Parameters:
  • hardwareDevice – pedal enum that represents the specific device

  • None

Returns:

ADC value in millivolts

Returns:

millivoltage value ADC measurement