Add supply voltage monitor to safety adc and safety controller

This commit is contained in:
2021-01-01 19:48:53 +01:00
parent 0e114d1344
commit 7c6205d20a
5 changed files with 55 additions and 8 deletions

View File

@@ -49,6 +49,12 @@
*/
#define INT_REF_CHANNEL_NUM (17)
#define SAFETY_ADC_SUPPLY_VOLTAGE_MONITOR_CHANNEL_NUM (15)
#define SAFETY_ADC_SUPPLY_VOLTAGE_MONITOR_PIN (5)
#define SAFETY_ADC_SUPPLY_VOLTAGE_MONITOR_PORT GPIOC
#define SAFETY_ADC_SUPPLY_VOLTAGE_MONITOR_PORT_RCC_MASK RCC_AHB1ENR_GPIOCEN
/**
* @brief Nominal value of the internal reference voltage.
*
@@ -77,7 +83,7 @@
* @brief Number of channels to handle for the SAFETY ADC.
* @note The maximum amount of channels is limited to 16
*/
#define SAFETY_ADC_NUM_OF_CHANNELS 8
#define SAFETY_ADC_NUM_OF_CHANNELS 12
/**
* @brief Channel numbers to sample with the SAFETY ADC
@@ -91,7 +97,9 @@
* @warning Safety controller expects the current measurment list. If you change it, check @ref safety_controller_handle_safety_adc
*/
#define SAFETY_ADC_CHANNELS TEMP_CHANNEL_NUM, TEMP_CHANNEL_NUM, TEMP_CHANNEL_NUM, TEMP_CHANNEL_NUM, \
INT_REF_CHANNEL_NUM, INT_REF_CHANNEL_NUM, INT_REF_CHANNEL_NUM, INT_REF_CHANNEL_NUM
INT_REF_CHANNEL_NUM, INT_REF_CHANNEL_NUM, INT_REF_CHANNEL_NUM, INT_REF_CHANNEL_NUM, \
SAFETY_ADC_SUPPLY_VOLTAGE_MONITOR_CHANNEL_NUM, SAFETY_ADC_SUPPLY_VOLTAGE_MONITOR_CHANNEL_NUM, \
SAFETY_ADC_SUPPLY_VOLTAGE_MONITOR_CHANNEL_NUM, SAFETY_ADC_SUPPLY_VOLTAGE_MONITOR_CHANNEL_NUM
/* Check the channel count of the safety ADC */