|
PER Firmware
|
"Abox" node source code More...
#include "main.h"#include "can_library/faults_common.h"#include "can_library/generated/A_BOX.h"#include "charging_fsm.h"#include "common/rtos/rtos.h"#include "common/heartbeat/heartbeat.h"#include "common/phal_G4/adc/adc.h"#include "common/phal_G4/fdcan/fdcan.h"#include "common/phal_G4/gpio/gpio.h"#include "common/phal_G4/rcc/rcc.h"#include "common/phal_G4/pin_defs/g474ret6.h"#include "adbms.h"#include "common/utils/countof.h"#include "common/watchdog/watchdog.h"#include "telemetry.h"Functions | |
| void | HardFault_Handler (void) |
| void | bms_task (void) |
| DEFINE_CAN_TASKS () | |
| RTOS_DEFINE_TASK (bms_task, 200, TASK_PRIORITY_NORMAL, STACK_2048) | |
| RTOS_DEFINE_TASK (charging_fsm_periodic, ELCON_COMMAND_PERIOD_MS, TASK_PRIORITY_NORMAL, STACK_512) | |
| RTOS_DEFINE_TASK (fault_library_periodic, A_BOX_FAULT_SYNC_PERIOD_MS, TASK_PRIORITY_NORMAL, STACK_1024) | |
| RTOS_DEFINE_TASK (report_telemetry_100hz, TELEMETRY_100HZ_PERIOD_MS, TASK_PRIORITY_LOW, STACK_512) | |
| RTOS_DEFINE_TASK (report_telemetry_8hz, TELEMETRY_8HZ_PERIOD_MS, TASK_PRIORITY_LOW, STACK_512) | |
| RTOS_DEFINE_TASK (report_telemetry_02hz, TELEMETRY_02HZ_PERIOD_MS, TASK_PRIORITY_LOW, STACK_512) | |
| DEFINE_WATCHDOG_TASK () | |
| DEFINE_HEARTBEAT_TASK (nullptr) | |
| int | main (void) |
Variables | |
| static PHAL_DMA_Handle_t | spi1_rx_dma |
| static PHAL_DMA_Handle_t | spi1_tx_dma |
| SPI_InitConfig_t | bms_spi_config |
| volatile adc1_dma_buffer_t | adc1_dma_buffer |
| static const PHAL_ADC_ChannelConfig_t | adc_channels [] |
| static const PHAL_ADC_Config_t | adc_config |
| PHAL_ADC_Handle_t | adc_handle |
| PHAL_GPIO_InitConfig_t | gpio_config [] |
| adbms_bms_t | g_bms = {0} |
| uint8_t | g_bms_tx_buf [ADBMS_SPI_TX_BUFFER_SIZE] = {0} |
| static constexpr float | MIN_V_FOR_BALANCE = 3.2f |
| static constexpr float | MIN_DELTA_FOR_BALANCE = 0.05f |
"Abox" node source code
| void bms_task | ( | void | ) |
| DEFINE_CAN_TASKS | ( | ) |
| DEFINE_HEARTBEAT_TASK | ( | nullptr | ) |
| DEFINE_WATCHDOG_TASK | ( | ) |
|
extern |
| int main | ( | void | ) |
| RTOS_DEFINE_TASK | ( | bms_task | , |
| 200 | , | ||
| TASK_PRIORITY_NORMAL | , | ||
| STACK_2048 | ) |
| RTOS_DEFINE_TASK | ( | charging_fsm_periodic | , |
| ELCON_COMMAND_PERIOD_MS | , | ||
| TASK_PRIORITY_NORMAL | , | ||
| STACK_512 | ) |
| RTOS_DEFINE_TASK | ( | fault_library_periodic | , |
| A_BOX_FAULT_SYNC_PERIOD_MS | , | ||
| TASK_PRIORITY_NORMAL | , | ||
| STACK_1024 | ) |
| RTOS_DEFINE_TASK | ( | report_telemetry_02hz | , |
| TELEMETRY_02HZ_PERIOD_MS | , | ||
| TASK_PRIORITY_LOW | , | ||
| STACK_512 | ) |
| RTOS_DEFINE_TASK | ( | report_telemetry_100hz | , |
| TELEMETRY_100HZ_PERIOD_MS | , | ||
| TASK_PRIORITY_LOW | , | ||
| STACK_512 | ) |
| RTOS_DEFINE_TASK | ( | report_telemetry_8hz | , |
| TELEMETRY_8HZ_PERIOD_MS | , | ||
| TASK_PRIORITY_LOW | , | ||
| STACK_512 | ) |
| volatile adc1_dma_buffer_t adc1_dma_buffer |
|
static |
|
static |
| PHAL_ADC_Handle_t adc_handle |
| SPI_InitConfig_t bms_spi_config |
| adbms_bms_t g_bms = {0} |
| uint8_t g_bms_tx_buf[ADBMS_SPI_TX_BUFFER_SIZE] = {0} |
| PHAL_GPIO_InitConfig_t gpio_config[] |
|
staticconstexpr |
|
staticconstexpr |
|
static |
|
static |