PER Firmware
Loading...
Searching...
No Matches
main.h
Go to the documentation of this file.
1
8#ifndef MAIN_H_
9#define MAIN_H_
10
11#include "common/phal/gpio.h"
12
13// Status LEDs
14#define HEARTBEAT_LED_PORT (GPIOB)
15#define HEARTBEAT_LED_PIN (5)
16#define ERROR_LED_PORT (GPIOB)
17#define ERROR_LED_PIN (9)
18#define CONNECTION_LED_PORT (GPIOB)
19#define CONNECTION_LED_PIN (4)
20
21// SPI1 for BMS
22#define SPI1_SCK_PORT (GPIOA)
23#define SPI1_MISO_PORT (GPIOA)
24#define SPI1_MOSI_PORT (GPIOA)
25#define SPI1_SCK_PIN (5)
26#define SPI1_MISO_PIN (6)
27#define SPI1_MOSI_PIN (7)
28#define SPI1_CS_PORT (GPIOB)
29#define SPI1_CS_PIN (0)
30
31// ISENSE and VSENSE
32#define ISENSE_GPIO_PORT (GPIOA)
33#define ISENSE_GPIO_PIN (0)
34#define ISENSE_ADC_CHANNEL (1)
35#define VBATT_GPIO_PORT (GPIOA)
36#define VBATT_GPIO_PIN (1)
37#define VBATT_ADC_CHANNEL (2)
38
39// Input status pins
40#define CHARGER_CONNECTED_PORT (GPIOB)
41#define CHARGER_CONNECTED_PIN (2)
42#define NOT_PRECHARGE_COMPLETE_PORT (GPIOB)
43#define NOT_PRECHARGE_COMPLETE_PIN (11)
44#define IMD_STATUS_PORT (GPIOA)
45#define IMD_STATUS_PIN (9)
46
47// BMS SDC Control
48#define BMS_SDC_CTRL_PORT (GPIOA)
49#define BMS_SDC_CTRL_PIN (10)
50
51#endif