Revision 09ad5212
Target/Modules/DiWheelDrive_1-1/Boot/iodef.h | ||
---|---|---|
1 |
#ifndef IODEF_H |
|
2 |
#define IODEF_H |
|
3 |
|
|
4 |
#include "stm32f10x.h" |
|
5 |
#include "stm32f10x_conf.h" |
|
6 |
|
|
7 |
#define WKUP_GPIO GPIOA |
|
8 |
#define WKUP_PIN GPIO_Pin_0 |
|
9 |
#define LED_GPIO GPIOA |
|
10 |
#define LED_PIN GPIO_Pin_1 |
|
11 |
#define DRIVE_PWM1A_GPIO GPIOA |
|
12 |
#define DRIVE_PWM1A_PIN GPIO_Pin_2 |
|
13 |
#define DRIVE_PWM1B_GPIO GPIOA |
|
14 |
#define DRIVE_PWM1B_PIN GPIO_Pin_3 |
|
15 |
#define MOTION_SCLK_GPIO GPIOA |
|
16 |
#define MOTION_SCLK_PIN GPIO_Pin_5 |
|
17 |
#define MOTION_MISO_GPIO GPIOA |
|
18 |
#define MOTION_MISO_PIN GPIO_Pin_6 |
|
19 |
#define MOTION_MOSI_GPIO GPIOA |
|
20 |
#define MOTION_MOSI_PIN GPIO_Pin_7 |
|
21 |
#define PROG_RX_GPIO GPIOA |
|
22 |
#define PROG_RX_PIN GPIO_Pin_9 |
|
23 |
#define PROG_TX_GPIO GPIOA |
|
24 |
#define PROG_TX_PIN GPIO_Pin_10 |
|
25 |
#define CAN_RX_GPIO GPIOA |
|
26 |
#define CAN_RX_PIN GPIO_Pin_11 |
|
27 |
#define CAN_TX_GPIO GPIOA |
|
28 |
#define CAN_TX_PIN GPIO_Pin_12 |
|
29 |
#define SWDIO_GPIO GPIOA |
|
30 |
#define SWDIO_PIN GPIO_Pin_13 |
|
31 |
#define SWCLK_GPIO GPIOA |
|
32 |
#define SWCLK_PIN GPIO_Pin_14 |
|
33 |
#define DRIVE_PWM2B_GPIO GPIOA |
|
34 |
#define DRIVE_PWM2B_PIN GPIO_Pin_15 |
|
35 |
|
|
36 |
#define DRIVE_SENSE2_GPIO GPIOB |
|
37 |
#define DRIVE_SENSE2_PIN GPIO_Pin_1 |
|
38 |
#define POWER_EN_GPIO GPIOB |
|
39 |
#define POWER_EN_PIN GPIO_Pin_2 |
|
40 |
#define DRIVE_PWM2A_GPIO GPIOB |
|
41 |
#define DRIVE_PWM2A_PIN GPIO_Pin_3 |
|
42 |
#define COMPASS_DRDY_GPIO GPIOB |
|
43 |
#define COMPASS_DRDY_PIN GPIO_Pin_5 |
|
44 |
#define DRIVE_ENC1A_GPIO GPIOB |
|
45 |
#define DRIVE_ENC1A_PIN GPIO_Pin_6 |
|
46 |
#define DRIVE_ENC1B_GPIO GPIOB |
|
47 |
#define DRIVE_ENC1B_PIN GPIO_Pin_7 |
|
48 |
#define COMPASS_SCL_GPIO GPIOB |
|
49 |
#define COMPASS_SCL_PIN GPIO_Pin_8 |
|
50 |
#define COMPASS_SDA_GPIO GPIOB |
|
51 |
#define COMPASS_SDA_PIN GPIO_Pin_9 |
|
52 |
#define IR_SCL_GPIO GPIOB |
|
53 |
#define IR_SCL_PIN GPIO_Pin_10 |
|
54 |
#define IR_SDA_GPIO GPIOB |
|
55 |
#define IR_SDA_PIN GPIO_Pin_11 |
|
56 |
#define IR_INT_GPIO GPIOB |
|
57 |
#define IR_INT_PIN GPIO_Pin_12 |
|
58 |
#define GYRP_DRDY_GPIO GPIOB |
|
59 |
#define GYRO_DRDY_PIN GPIO_Pin_13 |
|
60 |
#define SYS_UART_UP_GPIO GPIOB |
|
61 |
#define SYS_UART_UP_PIN GPIO_Pin_14 |
|
62 |
#define ACCEL_INT_N_GPIO GPIOB |
|
63 |
#define ACCEL_INT_N_PIN GPIO_Pin_15 |
|
64 |
|
|
65 |
#define DRIVE_SENSE1_GPIO GPIOC |
|
66 |
#define DRIVE_SENSE1_PIN GPIO_Pin_0 |
|
67 |
#define SYS_SYNC_N_GPIO GPIOC |
|
68 |
#define SYS_SYNC_N_PIN GPIO_Pin_1 |
|
69 |
#define PATH_DCSTAT_GPIO GPIOC |
|
70 |
#define PATH_DCSTAT_PIN GPIO_Pin_3 |
|
71 |
#define PATH_DCEN_GPIO GPIOC |
|
72 |
#define PATH_DCEN_PIN GPIO_Pin_5 |
|
73 |
#define DRIVE_ENC2B_GPIO GPIOC |
|
74 |
#define DRIVE_ENC2B_PIN GPIO_Pin_6 |
|
75 |
#define DRIVE_ENC2A_GPIO GPIOC |
|
76 |
#define DRIVE_ENC2A_PIN GPIO_Pin_7 |
|
77 |
#define SYS_PD_N_GPIO GPIOC |
|
78 |
#define SYS_PD_N_PIN GPIO_Pin_8 |
|
79 |
#define SYS_REG_EN_GPIO GPIOC |
|
80 |
#define SYS_REG_EN_PIN GPIO_Pin_9 |
|
81 |
#define SYS_UART_RX_GPIO GPIOC |
|
82 |
#define SYS_UART_RX_PIN GPIO_Pin_10 |
|
83 |
#define SYS_UART_TX_GPIO GPIOC |
|
84 |
#define SYS_UART_TX_PIN GPIO_Pin_11 |
|
85 |
#define ACCEL_SS_N_GPIO GPIOC |
|
86 |
#define ACCEL_SS_N_PIN GPIO_Pin_13 |
|
87 |
#define GYRO_SS_N_GPIO GPIOC |
|
88 |
#define GYRO_SS_N_PIN GPIO_Pin_14 |
|
89 |
|
|
90 |
#define OSC_IN_GPIO GPIOD |
|
91 |
#define OSC_IN_PIN GPIO_Pin_0 |
|
92 |
#define OSC_OUT_GPIO GPIOD |
|
93 |
#define OSC_OUT_PIN GPIO_Pin_1 |
|
94 |
#define SYS_WARMRST_N_GPIO GPIOD |
|
95 |
#define SYS_WARMRST_N_PIN GPIO_Pin_2 |
|
96 |
|
|
97 |
#endif /* IODEF_H */ |
Target/Modules/DiWheelDrive_1-1/Boot/main.c | ||
---|---|---|
35 | 35 |
* Include files |
36 | 36 |
****************************************************************************************/ |
37 | 37 |
#include "boot.h" /* bootloader generic header */ |
38 |
#include "stm32f10x.h" /* microcontroller registers */ |
|
39 |
#include "stm32f10x_conf.h" /* STM32 peripheral drivers */ |
|
40 | 38 |
#include "timer.h" |
41 | 39 |
#include "ARMCM3_STM32/types.h" |
42 | 40 |
#include "AMiRo/amiroblt.h" |
43 | 41 |
#include "AMiRo/helper.h" |
42 |
#include "iodef.h" |
|
44 | 43 |
|
45 | 44 |
/**************************************************************************************** |
46 | 45 |
* Defines |
47 | 46 |
****************************************************************************************/ |
48 |
#define WKUP_GPIO GPIOA |
|
49 |
#define WKUP_PIN GPIO_Pin_0 |
|
50 |
#define LED_GPIO GPIOA |
|
51 |
#define LED_PIN GPIO_Pin_1 |
|
52 |
#define DRIVE_PWM1A_GPIO GPIOA |
|
53 |
#define DRIVE_PWM1A_PIN GPIO_Pin_2 |
|
54 |
#define DRIVE_PWM1B_GPIO GPIOA |
|
55 |
#define DRIVE_PWM1B_PIN GPIO_Pin_3 |
|
56 |
#define MOTION_SCLK_GPIO GPIOA |
|
57 |
#define MOTION_SCLK_PIN GPIO_Pin_5 |
|
58 |
#define MOTION_MISO_GPIO GPIOA |
|
59 |
#define MOTION_MISO_PIN GPIO_Pin_6 |
|
60 |
#define MOTION_MOSI_GPIO GPIOA |
|
61 |
#define MOTION_MOSI_PIN GPIO_Pin_7 |
|
62 |
#define PROG_RX_GPIO GPIOA |
|
63 |
#define PROG_RX_PIN GPIO_Pin_9 |
|
64 |
#define PROG_TX_GPIO GPIOA |
|
65 |
#define PROG_TX_PIN GPIO_Pin_10 |
|
66 |
#define CAN_RX_GPIO GPIOA |
|
67 |
#define CAN_RX_PIN GPIO_Pin_11 |
|
68 |
#define CAN_TX_GPIO GPIOA |
|
69 |
#define CAN_TX_PIN GPIO_Pin_12 |
|
70 |
#define SWDIO_GPIO GPIOA |
|
71 |
#define SWDIO_PIN GPIO_Pin_13 |
|
72 |
#define SWCLK_GPIO GPIOA |
|
73 |
#define SWCLK_PIN GPIO_Pin_14 |
|
74 |
#define DRIVE_PWM2B_GPIO GPIOA |
|
75 |
#define DRIVE_PWM2B_PIN GPIO_Pin_15 |
|
76 |
|
|
77 |
#define DRIVE_SENSE2_GPIO GPIOB |
|
78 |
#define DRIVE_SENSE2_PIN GPIO_Pin_1 |
|
79 |
#define POWER_EN_GPIO GPIOB |
|
80 |
#define POWER_EN_PIN GPIO_Pin_2 |
|
81 |
#define DRIVE_PWM2A_GPIO GPIOB |
|
82 |
#define DRIVE_PWM2A_PIN GPIO_Pin_3 |
|
83 |
#define COMPASS_DRDY_GPIO GPIOB |
|
84 |
#define COMPASS_DRDY_PIN GPIO_Pin_5 |
|
85 |
#define DRIVE_ENC1A_GPIO GPIOB |
|
86 |
#define DRIVE_ENC1A_PIN GPIO_Pin_6 |
|
87 |
#define DRIVE_ENC1B_GPIO GPIOB |
|
88 |
#define DRIVE_ENC1B_PIN GPIO_Pin_7 |
|
89 |
#define COMPASS_SCL_GPIO GPIOB |
|
90 |
#define COMPASS_SCL_PIN GPIO_Pin_8 |
|
91 |
#define COMPASS_SDA_GPIO GPIOB |
|
92 |
#define COMPASS_SDA_PIN GPIO_Pin_9 |
|
93 |
#define IR_SCL_GPIO GPIOB |
|
94 |
#define IR_SCL_PIN GPIO_Pin_10 |
|
95 |
#define IR_SDA_GPIO GPIOB |
|
96 |
#define IR_SDA_PIN GPIO_Pin_11 |
|
97 |
#define IR_INT_GPIO GPIOB |
|
98 |
#define IR_INT_PIN GPIO_Pin_12 |
|
99 |
#define GYRP_DRDY_GPIO GPIOB |
|
100 |
#define GYRO_DRDY_PIN GPIO_Pin_13 |
|
101 |
#define SYS_UART_UP_GPIO GPIOB |
|
102 |
#define SYS_UART_UP_PIN GPIO_Pin_14 |
|
103 |
#define ACCEL_INT_N_GPIO GPIOB |
|
104 |
#define ACCEL_INT_N_PIN GPIO_Pin_15 |
|
105 |
|
|
106 |
#define DRIVE_SENSE1_GPIO GPIOC |
|
107 |
#define DRIVE_SENSE1_PIN GPIO_Pin_0 |
|
108 |
#define SYS_SYNC_N_GPIO GPIOC |
|
109 |
#define SYS_SYNC_N_PIN GPIO_Pin_1 |
|
110 |
#define PATH_DCSTAT_GPIO GPIOC |
|
111 |
#define PATH_DCSTAT_PIN GPIO_Pin_3 |
|
112 |
#define PATH_DCEN_GPIO GPIOC |
|
113 |
#define PATH_DCEN_PIN GPIO_Pin_5 |
|
114 |
#define DRIVE_ENC2B_GPIO GPIOC |
|
115 |
#define DRIVE_ENC2B_PIN GPIO_Pin_6 |
|
116 |
#define DRIVE_ENC2A_GPIO GPIOC |
|
117 |
#define DRIVE_ENC2A_PIN GPIO_Pin_7 |
|
118 |
#define SYS_PD_N_GPIO GPIOC |
|
119 |
#define SYS_PD_N_PIN GPIO_Pin_8 |
|
120 |
#define SYS_REG_EN_GPIO GPIOC |
|
121 |
#define SYS_REG_EN_PIN GPIO_Pin_9 |
|
122 |
#define SYS_UART_RX_GPIO GPIOC |
|
123 |
#define SYS_UART_RX_PIN GPIO_Pin_10 |
|
124 |
#define SYS_UART_TX_GPIO GPIOC |
|
125 |
#define SYS_UART_TX_PIN GPIO_Pin_11 |
|
126 |
#define ACCEL_SS_N_GPIO GPIOC |
|
127 |
#define ACCEL_SS_N_PIN GPIO_Pin_13 |
|
128 |
#define GYRO_SS_N_GPIO GPIOC |
|
129 |
#define GYRO_SS_N_PIN GPIO_Pin_14 |
|
130 |
|
|
131 |
#define OSC_IN_GPIO GPIOD |
|
132 |
#define OSC_IN_PIN GPIO_Pin_0 |
|
133 |
#define OSC_OUT_GPIO GPIOD |
|
134 |
#define OSC_OUT_PIN GPIO_Pin_1 |
|
135 |
#define SYS_WARMRST_N_GPIO GPIOD |
|
136 |
#define SYS_WARMRST_N_PIN GPIO_Pin_2 |
|
137 |
|
|
138 | 47 |
#define RESET_TIMEOUT_MS 100 |
139 | 48 |
|
140 | 49 |
/**************************************************************************************** |
Target/Modules/LightRing_1-0/Boot/iodef.h | ||
---|---|---|
1 |
#ifndef IODEF_H |
|
2 |
#define IODEF_H |
|
3 |
|
|
4 |
#include "stm32f10x.h" |
|
5 |
#include "stm32f10x_conf.h" |
|
6 |
|
|
7 |
#define PSEUDO_LED_GPIO GPIOA |
|
8 |
#define PSEUDO_LED_PIN GPIO_Pin_1 |
|
9 |
#define LASER_RX_GPIO GPIOA |
|
10 |
#define LASER_RX_PIN GPIO_Pin_2 |
|
11 |
#define LASER_TX_GPIO GPIOA |
|
12 |
#define LASER_TX_PIN GPIO_Pin_3 |
|
13 |
#define LIGHT_BLANK_GPIO GPIOA |
|
14 |
#define LIGHT_BLANK_PIN GPIO_Pin_4 |
|
15 |
#define LIGHT_SCLK_GPIO GPIOA |
|
16 |
#define LIGHT_SCLK_PIN GPIO_Pin_5 |
|
17 |
#define LIGHT_MOSI_GPIO GPIOA |
|
18 |
#define LIGHT_MOSI_PIN GPIO_Pin_7 |
|
19 |
#define PROG_RX_GPIO GPIOA |
|
20 |
#define PROG_RX_PIN GPIO_Pin_9 |
|
21 |
#define PROG_TX_GPIO GPIOA |
|
22 |
#define PROG_TX_PIN GPIO_Pin_10 |
|
23 |
#define CAN_RX_GPIO GPIOA |
|
24 |
#define CAN_RX_PIN GPIO_Pin_11 |
|
25 |
#define CAN_TX_GPIO GPIOA |
|
26 |
#define CAN_TX_PIN GPIO_Pin_12 |
|
27 |
#define SWDIO_GPIO GPIOA |
|
28 |
#define SWDIO_PIN GPIO_Pin_13 |
|
29 |
#define SWCLK_GPIO GPIOA |
|
30 |
#define SWCLK_PIN GPIO_Pin_14 |
|
31 |
|
|
32 |
#define LASER_EN_GPIO GPIOB |
|
33 |
#define LASER_EN_PIN GPIO_Pin_2 |
|
34 |
#define LASER_OC_N_GPIO GPIOB |
|
35 |
#define LASER_OC_N_PIN GPIO_Pin_5 |
|
36 |
#define SYS_UART_DN_GPIO GPIOB |
|
37 |
#define SYS_UART_DN_PIN GPIO_Pin_6 |
|
38 |
#define WL_GDO2_GPIO GPIOB |
|
39 |
#define WL_GDO2_PIN GPIO_Pin_8 |
|
40 |
#define WL_GDO0_GPIO GPIOB |
|
41 |
#define WL_GDO0_PIN GPIO_Pin_9 |
|
42 |
#define MEM_SCL_GPIO GPIOB |
|
43 |
#define MEM_SCL_PIN GPIO_Pin_10 |
|
44 |
#define MEM_SDA_GPIO GPIOB |
|
45 |
#define MEM_SDA_PIN GPIO_Pin_11 |
|
46 |
#define WL_SS_N_GPIO GPIOB |
|
47 |
#define WL_SS_N_PIN GPIO_Pin_12 |
|
48 |
#define WL_SCLK_GPIO GPIOB |
|
49 |
#define WL_SCLK_PIN GPIO_Pin_13 |
|
50 |
#define WL_MISO_GPIO GPIOB |
|
51 |
#define WL_MISO_PIN GPIO_Pin_14 |
|
52 |
#define WL_MOSI_GPIO GPIOB |
|
53 |
#define WL_MOSI_PIN GPIO_Pin_15 |
|
54 |
|
|
55 |
#define LIGHT_XLAT_GPIO GPIOC |
|
56 |
#define LIGHT_XLAT_PIN GPIO_Pin_4 |
|
57 |
#define SYS_UART_RX_GPIO GPIOC |
|
58 |
#define SYS_UART_RX_PIN GPIO_Pin_10 |
|
59 |
#define SYS_UART_TX_GPIO GPIOC |
|
60 |
#define SYS_UART_TX_PIN GPIO_Pin_11 |
|
61 |
#define SYS_PD_N_GPIO GPIOC |
|
62 |
#define SYS_PD_N_PIN GPIO_Pin_14 |
|
63 |
|
|
64 |
#define OSC_IN_GPIO GPIOD |
|
65 |
#define OSC_IN_PIN GPIO_Pin_0 |
|
66 |
#define OSC_OUT_GPIO GPIOD |
|
67 |
#define OSC_OUT_PIN GPIO_Pin_1 |
|
68 |
#define SYS_SYNC_N_GPIO GPIOD |
|
69 |
#define SYS_SYNC_N_PIN GPIO_Pin_2 |
|
70 |
|
|
71 |
#endif /* IODEF_H */ |
|
72 |
|
|
73 |
|
|
74 |
|
Target/Modules/LightRing_1-0/Boot/main.c | ||
---|---|---|
35 | 35 |
* Include files |
36 | 36 |
****************************************************************************************/ |
37 | 37 |
#include "boot.h" /* bootloader generic header */ |
38 |
#include "stm32f10x.h" /* microcontroller registers */ |
|
39 |
#include "stm32f10x_conf.h" /* STM32 peripheral drivers */ |
|
40 | 38 |
#include "timer.h" |
41 | 39 |
#include "ARMCM3_STM32/types.h" |
42 | 40 |
#include "AMiRo/amiroblt.h" |
43 | 41 |
#include "AMiRo/helper.h" |
42 |
#include "iodef.h" |
|
44 | 43 |
|
45 | 44 |
/**************************************************************************************** |
46 | 45 |
* Defines |
47 | 46 |
****************************************************************************************/ |
48 |
#define PSEUDO_LED_GPIO GPIOA |
|
49 |
#define PSEUDO_LED_PIN GPIO_Pin_1 |
|
50 |
#define LASER_RX_GPIO GPIOA |
|
51 |
#define LASER_RX_PIN GPIO_Pin_2 |
|
52 |
#define LASER_TX_GPIO GPIOA |
|
53 |
#define LASER_TX_PIN GPIO_Pin_3 |
|
54 |
#define LIGHT_BLANK_GPIO GPIOA |
|
55 |
#define LIGHT_BLANK_PIN GPIO_Pin_4 |
|
56 |
#define LIGHT_SCLK_GPIO GPIOA |
|
57 |
#define LIGHT_SCLK_PIN GPIO_Pin_5 |
|
58 |
#define LIGHT_MOSI_GPIO GPIOA |
|
59 |
#define LIGHT_MOSI_PIN GPIO_Pin_7 |
|
60 |
#define PROG_RX_GPIO GPIOA |
|
61 |
#define PROG_RX_PIN GPIO_Pin_9 |
|
62 |
#define PROG_TX_GPIO GPIOA |
|
63 |
#define PROG_TX_PIN GPIO_Pin_10 |
|
64 |
#define CAN_RX_GPIO GPIOA |
|
65 |
#define CAN_RX_PIN GPIO_Pin_11 |
|
66 |
#define CAN_TX_GPIO GPIOA |
|
67 |
#define CAN_TX_PIN GPIO_Pin_12 |
|
68 |
#define SWDIO_GPIO GPIOA |
|
69 |
#define SWDIO_PIN GPIO_Pin_13 |
|
70 |
#define SWCLK_GPIO GPIOA |
|
71 |
#define SWCLK_PIN GPIO_Pin_14 |
|
72 |
|
|
73 |
#define LASER_EN_GPIO GPIOB |
|
74 |
#define LASER_EN_PIN GPIO_Pin_2 |
|
75 |
#define LASER_OC_N_GPIO GPIOB |
|
76 |
#define LASER_OC_N_PIN GPIO_Pin_5 |
|
77 |
#define SYS_UART_DN_GPIO GPIOB |
|
78 |
#define SYS_UART_DN_PIN GPIO_Pin_6 |
|
79 |
#define WL_GDO2_GPIO GPIOB |
|
80 |
#define WL_GDO2_PIN GPIO_Pin_8 |
|
81 |
#define WL_GDO0_GPIO GPIOB |
|
82 |
#define WL_GDO0_PIN GPIO_Pin_9 |
|
83 |
#define MEM_SCL_GPIO GPIOB |
|
84 |
#define MEM_SCL_PIN GPIO_Pin_10 |
|
85 |
#define MEM_SDA_GPIO GPIOB |
|
86 |
#define MEM_SDA_PIN GPIO_Pin_11 |
|
87 |
#define WL_SS_N_GPIO GPIOB |
|
88 |
#define WL_SS_N_PIN GPIO_Pin_12 |
|
89 |
#define WL_SCLK_GPIO GPIOB |
|
90 |
#define WL_SCLK_PIN GPIO_Pin_13 |
|
91 |
#define WL_MISO_GPIO GPIOB |
|
92 |
#define WL_MISO_PIN GPIO_Pin_14 |
|
93 |
#define WL_MOSI_GPIO GPIOB |
|
94 |
#define WL_MOSI_PIN GPIO_Pin_15 |
|
95 |
|
|
96 |
#define LIGHT_XLAT_GPIO GPIOC |
|
97 |
#define LIGHT_XLAT_PIN GPIO_Pin_4 |
|
98 |
#define SYS_UART_RX_GPIO GPIOC |
|
99 |
#define SYS_UART_RX_PIN GPIO_Pin_10 |
|
100 |
#define SYS_UART_TX_GPIO GPIOC |
|
101 |
#define SYS_UART_TX_PIN GPIO_Pin_11 |
|
102 |
#define SYS_PD_N_GPIO GPIOC |
|
103 |
#define SYS_PD_N_PIN GPIO_Pin_14 |
|
104 |
|
|
105 |
#define OSC_IN_GPIO GPIOD |
|
106 |
#define OSC_IN_PIN GPIO_Pin_0 |
|
107 |
#define OSC_OUT_GPIO GPIOD |
|
108 |
#define OSC_OUT_PIN GPIO_Pin_1 |
|
109 |
#define SYS_SYNC_N_GPIO GPIOD |
|
110 |
#define SYS_SYNC_N_PIN GPIO_Pin_2 |
|
111 | 47 |
|
112 | 48 |
/**************************************************************************************** |
113 | 49 |
* Function prototypes |
Target/Modules/PowerManagement_1-1/Boot/iodef.h | ||
---|---|---|
1 |
#ifndef IODEF_H |
|
2 |
#define IODEF_H |
|
3 |
|
|
4 |
#include "stm32f4xx.h" |
|
5 |
#include "stm32f4xx_conf.h" |
|
6 |
|
|
7 |
#define WKUP_GPIO GPIOA |
|
8 |
#define WKUP_PIN GPIO_Pin_0 |
|
9 |
#define SYS_UART_TX_GPIO GPIOA |
|
10 |
#define SYS_UART_TX_PIN GPIO_Pin_2 |
|
11 |
#define SYS_UART_RX_GPIO GPIOA |
|
12 |
#define SYS_UART_RX_PIN GPIO_Pin_3 |
|
13 |
#define SYS_SPI_SS0_N_GPIO GPIOA |
|
14 |
#define SYS_SPI_SS0_N_PIN GPIO_Pin_4 |
|
15 |
#define SYS_SPI_SCLK_GPIO GPIOA |
|
16 |
#define SYS_SPI_SCLK_PIN GPIO_Pin_5 |
|
17 |
#define SYS_SPI_MISO_GPIO GPIOA |
|
18 |
#define SYS_SPI_MISO_PIN GPIO_Pin_6 |
|
19 |
#define SYS_SPI_MOSI_GPIO GPIOA |
|
20 |
#define SYS_SPI_MOSI_PIN GPIO_Pin_7 |
|
21 |
#define SYS_REG_EN_GPIO GPIOA |
|
22 |
#define SYS_REG_EN_PIN GPIO_Pin_8 |
|
23 |
#define PROG_RX_GPIO GPIOA |
|
24 |
#define PROG_RX_PIN GPIO_Pin_9 |
|
25 |
#define PROG_TX_GPIO GPIOA |
|
26 |
#define PROG_TX_PIN GPIO_Pin_10 |
|
27 |
#define CAN_RX_GPIO GPIOA |
|
28 |
#define CAN_RX_PIN GPIO_Pin_11 |
|
29 |
#define CAN_TX_GPIO GPIOA |
|
30 |
#define CAN_TX_PIN GPIO_Pin_12 |
|
31 |
#define SWDIO_GPIO GPIOA |
|
32 |
#define SWDIO_PIN GPIO_Pin_13 |
|
33 |
#define SWCLK_GPIO GPIOA |
|
34 |
#define SWCLK_PIN GPIO_Pin_14 |
|
35 |
#define SYS_SPI_SS1_N_GPIO GPIOA |
|
36 |
#define SYS_SPI_SS1_N_PIN GPIO_Pin_15 |
|
37 |
|
|
38 |
#define IR_INT1_N_GPIO GPIOB |
|
39 |
#define IR_INT1_N_PIN GPIO_Pin_0 |
|
40 |
#define VSYS_SENSE_GPIO GPIOB |
|
41 |
#define VSYS_SENSE_PIN GPIO_Pin_1 |
|
42 |
#define POWER_EN_GPIO GPIOB |
|
43 |
#define POWER_EN_PIN GPIO_Pin_2 |
|
44 |
#define SYS_UART_DN_GPIO GPIOB |
|
45 |
#define SYS_UART_DN_PIN GPIO_Pin_3 |
|
46 |
#define CHARGE_STAT2A_GPIO GPIOB |
|
47 |
#define CHARGE_STAT2A_PIN GPIO_Pin_4 |
|
48 |
#define BUZZER_GPIO GPIOB |
|
49 |
#define BUZZER_PIN GPIO_Pin_5 |
|
50 |
#define GAUGE_BATLOW2_GPIO GPIOB |
|
51 |
#define GAUGE_BATLOW2_PIN GPIO_Pin_6 |
|
52 |
#define GAUGE_BATGD2_N_GPIO GPIOB |
|
53 |
#define GAUGE_BATGD2_N_PIN GPIO_Pin_7 |
|
54 |
#define GAUGE_SCL2_GPIO GPIOB |
|
55 |
#define GAUGE_SCL2_PIN GPIO_Pin_8 |
|
56 |
#define GAUGE_SDA2_GPIO GPIOB |
|
57 |
#define GAUGE_SDA2_PIN GPIO_Pin_9 |
|
58 |
#define GAUGE_SCL1_GPIO GPIOB |
|
59 |
#define GAUGE_SCL1_PIN GPIO_Pin_10 |
|
60 |
#define GAUGE_SDA1_GPIO GPIOB |
|
61 |
#define GAUGE_SDA1_PIN GPIO_Pin_11 |
|
62 |
#define LED_GPIO GPIOB |
|
63 |
#define LED_PIN GPIO_Pin_12 |
|
64 |
#define BT_RTS_GPIO GPIOB |
|
65 |
#define BT_RTS_PIN GPIO_Pin_13 |
|
66 |
#define BT_CTS_GPIO GPIOB |
|
67 |
#define BT_CTS_PIN GPIO_Pin_14 |
|
68 |
#define SYS_UART_UP_GPIO GPIOB |
|
69 |
#define SYS_UART_UP_PIN GPIO_Pin_15 |
|
70 |
|
|
71 |
#define CHARGE_STAT1A_GPIO GPIOC |
|
72 |
#define CHARGE_STAT1A_PIN GPIO_Pin_0 |
|
73 |
#define GAUGE_BATLOW1_GPIO GPIOC |
|
74 |
#define GAUGE_BATLOW1_PIN GPIO_Pin_1 |
|
75 |
#define GAUGE_BATGD1_N_GPIO GPIOC |
|
76 |
#define GAUGE_BATGD1_N_PIN GPIO_Pin_2 |
|
77 |
#define CHARGE_EN1_N_GPIO GPIOC |
|
78 |
#define CHARGE_EN1_N_PIN GPIO_Pin_3 |
|
79 |
#define IR_INT2_N_GPIO GPIOC |
|
80 |
#define IR_INT2_N_PIN GPIO_Pin_4 |
|
81 |
#define TOUCH_INT_N_GPIO GPIOC |
|
82 |
#define TOUCH_INT_N_PIN GPIO_Pin_5 |
|
83 |
#define SYS_DONE_GPIO GPIOC |
|
84 |
#define SYS_DONE_PIN GPIO_Pin_6 |
|
85 |
#define SYS_PROG_N_GPIO GPIOC |
|
86 |
#define SYS_PROG_N_PIN GPIO_Pin_7 |
|
87 |
#define PATH_DC_GPIO GPIOC |
|
88 |
#define PATH_DC_PIN GPIO_Pin_8 |
|
89 |
#define SYS_SPI_DIR_GPIO GPIOC |
|
90 |
#define SYS_SPI_DIR_PIN GPIO_Pin_9 |
|
91 |
#define BT_RX_GPIO GPIOC |
|
92 |
#define BT_RX_PIN GPIO_Pin_10 |
|
93 |
#define BT_TX_GPIO GPIOC |
|
94 |
#define BT_TX_PIN GPIO_Pin_11 |
|
95 |
#define SYS_SYNC_N_GPIO GPIOC |
|
96 |
#define SYS_SYNC_N_PIN GPIO_Pin_12 |
|
97 |
#define SYS_PD_N_GPIO GPIOC |
|
98 |
#define SYS_PD_N_PIN GPIO_Pin_13 |
|
99 |
#define SYS_WARMRST_N_GPIO GPIOC |
|
100 |
#define SYS_WARMRST_N_PIN GPIO_Pin_14 |
|
101 |
#define BT_RST_GPIO GPIOC |
|
102 |
#define BT_RST_PIN GPIO_Pin_15 |
|
103 |
|
|
104 |
#define OSC_IN_GPIO GPIOD |
|
105 |
#define OSC_IN_PIN GPIO_Pin_0 |
|
106 |
#define OSC_OUT_GPIO GPIOD |
|
107 |
#define OSC_OUT_PIN GPIO_Pin_1 |
|
108 |
#define CHARGE_EN2_N_GPIO GPIOD |
|
109 |
#define CHARGE_EN2_N_PIN GPIO_Pin_2 |
|
110 |
|
|
111 |
#endif /* IODEF_H */ |
|
112 |
|
Target/Modules/PowerManagement_1-1/Boot/main.c | ||
---|---|---|
35 | 35 |
* Include files |
36 | 36 |
****************************************************************************************/ |
37 | 37 |
#include "boot.h" /* bootloader generic header */ |
38 |
#include "stm32f4xx.h" /* STM32 registers */ |
|
39 |
#include "stm32f4xx_conf.h" /* STM32 peripheral drivers */ |
|
40 | 38 |
#include "com.h" |
41 | 39 |
#include "ARMCM4_STM32/types.h" |
42 | 40 |
#include "AMiRo/amiroblt.h" |
43 | 41 |
#include "AMiRo/helper.h" |
42 |
#include "iodef.h" |
|
44 | 43 |
|
45 | 44 |
/**************************************************************************************** |
46 | 45 |
* Defines |
47 | 46 |
****************************************************************************************/ |
48 |
#define WKUP_GPIO GPIOA |
|
49 |
#define WKUP_PIN GPIO_Pin_0 |
|
50 |
#define SYS_UART_TX_GPIO GPIOA |
|
51 |
#define SYS_UART_TX_PIN GPIO_Pin_2 |
|
52 |
#define SYS_UART_RX_GPIO GPIOA |
|
53 |
#define SYS_UART_RX_PIN GPIO_Pin_3 |
|
54 |
#define SYS_SPI_SS0_N_GPIO GPIOA |
|
55 |
#define SYS_SPI_SS0_N_PIN GPIO_Pin_4 |
|
56 |
#define SYS_SPI_SCLK_GPIO GPIOA |
|
57 |
#define SYS_SPI_SCLK_PIN GPIO_Pin_5 |
|
58 |
#define SYS_SPI_MISO_GPIO GPIOA |
|
59 |
#define SYS_SPI_MISO_PIN GPIO_Pin_6 |
|
60 |
#define SYS_SPI_MOSI_GPIO GPIOA |
|
61 |
#define SYS_SPI_MOSI_PIN GPIO_Pin_7 |
|
62 |
#define SYS_REG_EN_GPIO GPIOA |
|
63 |
#define SYS_REG_EN_PIN GPIO_Pin_8 |
|
64 |
#define PROG_RX_GPIO GPIOA |
|
65 |
#define PROG_RX_PIN GPIO_Pin_9 |
|
66 |
#define PROG_TX_GPIO GPIOA |
|
67 |
#define PROG_TX_PIN GPIO_Pin_10 |
|
68 |
#define CAN_RX_GPIO GPIOA |
|
69 |
#define CAN_RX_PIN GPIO_Pin_11 |
|
70 |
#define CAN_TX_GPIO GPIOA |
|
71 |
#define CAN_TX_PIN GPIO_Pin_12 |
|
72 |
#define SWDIO_GPIO GPIOA |
|
73 |
#define SWDIO_PIN GPIO_Pin_13 |
|
74 |
#define SWCLK_GPIO GPIOA |
|
75 |
#define SWCLK_PIN GPIO_Pin_14 |
|
76 |
#define SYS_SPI_SS1_N_GPIO GPIOA |
|
77 |
#define SYS_SPI_SS1_N_PIN GPIO_Pin_15 |
|
78 |
|
|
79 |
#define IR_INT1_N_GPIO GPIOB |
|
80 |
#define IR_INT1_N_PIN GPIO_Pin_0 |
|
81 |
#define VSYS_SENSE_GPIO GPIOB |
|
82 |
#define VSYS_SENSE_PIN GPIO_Pin_1 |
|
83 |
#define POWER_EN_GPIO GPIOB |
|
84 |
#define POWER_EN_PIN GPIO_Pin_2 |
|
85 |
#define SYS_UART_DN_GPIO GPIOB |
|
86 |
#define SYS_UART_DN_PIN GPIO_Pin_3 |
|
87 |
#define CHARGE_STAT2A_GPIO GPIOB |
|
88 |
#define CHARGE_STAT2A_PIN GPIO_Pin_4 |
|
89 |
#define BUZZER_GPIO GPIOB |
|
90 |
#define BUZZER_PIN GPIO_Pin_5 |
|
91 |
#define GAUGE_BATLOW2_GPIO GPIOB |
|
92 |
#define GAUGE_BATLOW2_PIN GPIO_Pin_6 |
|
93 |
#define GAUGE_BATGD2_N_GPIO GPIOB |
|
94 |
#define GAUGE_BATGD2_N_PIN GPIO_Pin_7 |
|
95 |
#define GAUGE_SCL2_GPIO GPIOB |
|
96 |
#define GAUGE_SCL2_PIN GPIO_Pin_8 |
|
97 |
#define GAUGE_SDA2_GPIO GPIOB |
|
98 |
#define GAUGE_SDA2_PIN GPIO_Pin_9 |
|
99 |
#define GAUGE_SCL1_GPIO GPIOB |
|
100 |
#define GAUGE_SCL1_PIN GPIO_Pin_10 |
|
101 |
#define GAUGE_SDA1_GPIO GPIOB |
|
102 |
#define GAUGE_SDA1_PIN GPIO_Pin_11 |
|
103 |
#define LED_GPIO GPIOB |
|
104 |
#define LED_PIN GPIO_Pin_12 |
|
105 |
#define BT_RTS_GPIO GPIOB |
|
106 |
#define BT_RTS_PIN GPIO_Pin_13 |
|
107 |
#define BT_CTS_GPIO GPIOB |
|
108 |
#define BT_CTS_PIN GPIO_Pin_14 |
|
109 |
#define SYS_UART_UP_GPIO GPIOB |
|
110 |
#define SYS_UART_UP_PIN GPIO_Pin_15 |
|
111 |
|
|
112 |
#define CHARGE_STAT1A_GPIO GPIOC |
|
113 |
#define CHARGE_STAT1A_PIN GPIO_Pin_0 |
|
114 |
#define GAUGE_BATLOW1_GPIO GPIOC |
|
115 |
#define GAUGE_BATLOW1_PIN GPIO_Pin_1 |
|
116 |
#define GAUGE_BATGD1_N_GPIO GPIOC |
|
117 |
#define GAUGE_BATGD1_N_PIN GPIO_Pin_2 |
|
118 |
#define CHARGE_EN1_N_GPIO GPIOC |
|
119 |
#define CHARGE_EN1_N_PIN GPIO_Pin_3 |
|
120 |
#define IR_INT2_N_GPIO GPIOC |
|
121 |
#define IR_INT2_N_PIN GPIO_Pin_4 |
|
122 |
#define TOUCH_INT_N_GPIO GPIOC |
|
123 |
#define TOUCH_INT_N_PIN GPIO_Pin_5 |
|
124 |
#define SYS_DONE_GPIO GPIOC |
|
125 |
#define SYS_DONE_PIN GPIO_Pin_6 |
|
126 |
#define SYS_PROG_N_GPIO GPIOC |
|
127 |
#define SYS_PROG_N_PIN GPIO_Pin_7 |
|
128 |
#define PATH_DC_GPIO GPIOC |
|
129 |
#define PATH_DC_PIN GPIO_Pin_8 |
|
130 |
#define SYS_SPI_DIR_GPIO GPIOC |
|
131 |
#define SYS_SPI_DIR_PIN GPIO_Pin_9 |
|
132 |
#define BT_RX_GPIO GPIOC |
|
133 |
#define BT_RX_PIN GPIO_Pin_10 |
|
134 |
#define BT_TX_GPIO GPIOC |
|
135 |
#define BT_TX_PIN GPIO_Pin_11 |
|
136 |
#define SYS_SYNC_N_GPIO GPIOC |
|
137 |
#define SYS_SYNC_N_PIN GPIO_Pin_12 |
|
138 |
#define SYS_PD_N_GPIO GPIOC |
|
139 |
#define SYS_PD_N_PIN GPIO_Pin_13 |
|
140 |
#define SYS_WARMRST_N_GPIO GPIOC |
|
141 |
#define SYS_WARMRST_N_PIN GPIO_Pin_14 |
|
142 |
#define BT_RST_GPIO GPIOC |
|
143 |
#define BT_RST_PIN GPIO_Pin_15 |
|
144 |
|
|
145 |
#define OSC_IN_GPIO GPIOD |
|
146 |
#define OSC_IN_PIN GPIO_Pin_0 |
|
147 |
#define OSC_OUT_GPIO GPIOD |
|
148 |
#define OSC_OUT_PIN GPIO_Pin_1 |
|
149 |
#define CHARGE_EN2_N_GPIO GPIOD |
|
150 |
#define CHARGE_EN2_N_PIN GPIO_Pin_2 |
|
151 |
|
|
152 | 47 |
#define HIBERNATE_TIME_MS 5000 |
153 | 48 |
|
154 | 49 |
/**************************************************************************************** |
Also available in: Unified diff