|
HRI board firmware
v2.1
Microcontroller firmware of the board used during the HRI labs.
|
#include "../main.h"Go to the source code of this file.
Macros | |
| #define | ADC_HALL_PIN GPIO_Pin_1 |
| #define | ADC_HALL_PORT GPIOB |
| #define | ADC_HALL_CHANNEL ADC_Channel_9 |
| #define | ADC_ANIN1_PIN GPIO_Pin_6 |
| #define | ADC_ANIN1_PORT GPIOA |
| #define | ADC_ANIN1_CHANNEL ADC_Channel_6 |
| #define | ADC_ANIN2_PIN GPIO_Pin_7 |
| #define | ADC_ANIN2_PORT GPIOA |
| #define | ADC_ANIN2_CHANNEL ADC_Channel_7 |
| #define | ADC_ANIN3_PIN GPIO_Pin_4 |
| #define | ADC_ANIN3_PORT GPIOC |
| #define | ADC_ANIN3_CHANNEL ADC_Channel_14 |
| #define | ADC_ANIN4_PIN GPIO_Pin_5 |
| #define | ADC_ANIN4_PORT GPIOC |
| #define | ADC_ANIN4_CHANNEL ADC_Channel_15 |
| #define | ADC_CURRENT_SENSE_PIN GPIO_Pin_3 |
| #define | ADC_CURRENT_SENSE_PORT GPIOA |
| #define | ADC_CURRENT_SENSE_CHANNEL ADC_Channel_3 |
| #define | ADC_MAX 4095.0f |
| #define | ADC_MAX_CONVERSION_TIME 100 |
| #define | ADC_BUFFER_SIZE 33 |
| #define | ADC_CURRENT_SCALE (ADC_REF_VOLTAGE / (CURRENT_SHUNT_RESISTANCE * CURRENT_SHUNT_AMPLIFIER_GAIN * ADC_MAX)) |
| #define | ADC_CALIB_N_SAMPLES 1000 |
Enumerations | |
| enum | AdcChannel { ADC_CHANNEL_9 = 9, ADC_CHANNEL_6 = 6, ADC_CHANNEL_7 = 7, ADC_CHANNEL_14 = 14, ADC_CHANNEL_15 = 15 } |
| Enum that corresponds to the two ADC input channels of the board. More... | |
Functions | |
| void | adc_Init (void) |
| Initialize the ADC converter (2 analog inputs + current sense). More... | |
| void | adc_CalibrateCurrentSens (void) |
| Compute the current sense offset. More... | |
| float32_t | adc_GetCurrent (void) |
| Compute the current sense offset. More... | |
| float32_t | adc_GetChannelVoltage (AdcChannel channel) |
| Gets the voltage measured by the selected ADC channel. More... | |
| #define ADC_ANIN1_CHANNEL ADC_Channel_6 |
| #define ADC_ANIN1_PIN GPIO_Pin_6 |
| #define ADC_ANIN1_PORT GPIOA |
| #define ADC_ANIN2_CHANNEL ADC_Channel_7 |
| #define ADC_ANIN2_PIN GPIO_Pin_7 |
| #define ADC_ANIN2_PORT GPIOA |
| #define ADC_ANIN3_CHANNEL ADC_Channel_14 |
| #define ADC_ANIN3_PIN GPIO_Pin_4 |
| #define ADC_ANIN3_PORT GPIOC |
| #define ADC_ANIN4_CHANNEL ADC_Channel_15 |
| #define ADC_ANIN4_PIN GPIO_Pin_5 |
| #define ADC_ANIN4_PORT GPIOC |
| #define ADC_BUFFER_SIZE 33 |
| #define ADC_CALIB_N_SAMPLES 1000 |
| #define ADC_CURRENT_SCALE (ADC_REF_VOLTAGE / (CURRENT_SHUNT_RESISTANCE * CURRENT_SHUNT_AMPLIFIER_GAIN * ADC_MAX)) |
| #define ADC_CURRENT_SENSE_CHANNEL ADC_Channel_3 |
| #define ADC_CURRENT_SENSE_PIN GPIO_Pin_3 |
| #define ADC_CURRENT_SENSE_PORT GPIOA |
| #define ADC_HALL_CHANNEL ADC_Channel_9 |
| #define ADC_HALL_PIN GPIO_Pin_1 |
| #define ADC_HALL_PORT GPIOB |
| #define ADC_MAX 4095.0f |
| #define ADC_MAX_CONVERSION_TIME 100 |
1.8.13