...
State | Description | Transition |
---|---|---|
Hazard Light On | Hazard lights are currently active |
|
Hazard Light Off | Hazard lights are currently inactive |
|
ADC Driver
Description
The STM32 has a 12-bit onboard analog-to-digital converter (ADC). The role of an ADC is to take an analog signal as an input and give as output a digital number proportional to the magnitude of the input signal. The ADC on the STM32 has 19 multiplexed channels, allowing it to read signals from 16 external sources and 3 internal sources. The pin mappings for the 16 external sources are included below:
...
The ADC does conversions in groups of selected channels. Each conversion can be performed in either single mode, in which the ADC converts all the channels in the group in one single sequence, and continuous mode, where the device automatically restarts the scan after finishing the sequence, resulting in a nonstop conversion of the input channels. The 12-bit value obtained from each conversion will be stored in the ADC read-only data register (ADC_DR). To obtain the desired value from ADC_DR reading, the following formula is used:
Mathinline | ||
---|---|---|
|
Additionally, the sequence of channels to convert is defined in the ADC's 32-bit Channel Selection register (ADC_CHSELR), which contains a series of selection bits corresponding to each analog input channel. By using this register, it is possible to select the set of channels to be converted by the ADC, making it useful for when you want to convert either a single channel or a specific set of them.
Driver Inputs
SMT32F0 Interrupts
Interrupts on the SMT32 are managed by the extended interrupts and events controller (EXTI), which allows for the management of up to 32 different interrupt lines (23 external and 9 internal). Each line can have both its active edge and interrupt priority programmed independently.
...