|
37 | 37 | extern "C" { |
38 | 38 | #endif |
39 | 39 |
|
40 | | -// LED |
41 | | -#define LED_PORT GPIOA |
42 | | -#define LED_PIN GPIO_PIN_5 |
43 | | -#define LED_STATE_ON 1 |
44 | | - |
45 | | -// Button |
46 | | -#define BUTTON_PORT GPIOA |
47 | | -#define BUTTON_PIN GPIO_PIN_0 |
48 | | -#define BUTTON_STATE_ACTIVE 0 |
49 | | - |
50 | | -// UART Enable for STLink VCOM |
51 | | -#define UART_DEV USART3 |
52 | | -#define UART_CLK_EN __USART3_CLK_ENABLE |
53 | | -#define UART_GPIO_PORT GPIOA |
54 | | -#define UART_GPIO_AF GPIO_AF13_USART3 |
55 | | - |
56 | | -#define UART_TX_PIN GPIO_PIN_3 |
57 | | -#define UART_RX_PIN GPIO_PIN_4 |
| 40 | +#define PINID_LED 0 |
| 41 | +#define PINID_BUTTON 1 |
| 42 | +#define PINID_UART_TX 2 |
| 43 | +#define PINID_UART_RX 3 |
| 44 | + |
| 45 | +static board_pindef_t board_pindef[] = { |
| 46 | + { // LED |
| 47 | + .port = GPIOA, |
| 48 | + .pin_init = { .Pin = GPIO_PIN_5, .Mode = GPIO_MODE_OUTPUT_PP, .Pull = GPIO_PULLUP, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = 0 }, |
| 49 | + .active_state = 1 |
| 50 | + }, |
| 51 | + { // Button |
| 52 | + .port = GPIOA, |
| 53 | + .pin_init = { .Pin = GPIO_PIN_0, .Mode = GPIO_MODE_INPUT, .Pull = GPIO_PULLUP, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = 0 }, |
| 54 | + .active_state = 0 |
| 55 | + }, |
| 56 | + { // UART TX |
| 57 | + .port = GPIOA, |
| 58 | + .pin_init = { .Pin = GPIO_PIN_3, .Mode = GPIO_MODE_AF_PP, .Pull = GPIO_PULLUP, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = GPIO_AF13_USART3 }, |
| 59 | + .active_state = 0 |
| 60 | + }, |
| 61 | + { // UART RX |
| 62 | + .port = GPIOA, |
| 63 | + .pin_init = { .Pin = GPIO_PIN_4, .Mode = GPIO_MODE_AF_PP, .Pull = GPIO_PULLUP, .Speed = GPIO_SPEED_FREQ_HIGH, .Alternate = GPIO_AF13_USART3 }, |
| 64 | + .active_state = 0 |
| 65 | + }, |
| 66 | +}; |
58 | 67 |
|
59 | 68 | //--------------------------------------------------------------------+ |
60 | 69 | // RCC Clock |
@@ -120,6 +129,10 @@ static inline void SystemClock_Config(void) { |
120 | 129 | __HAL_RCC_USB_CLK_ENABLE(); |
121 | 130 | } |
122 | 131 |
|
| 132 | +static inline void board_init2(void) { |
| 133 | + // Empty for this board |
| 134 | +} |
| 135 | + |
123 | 136 | #ifdef __cplusplus |
124 | 137 | } |
125 | 138 | #endif |
|
0 commit comments