|
6 | 6 | // Cuatro (STM32H7) + Harness // |
7 | 7 | // ////////////////////////// // |
8 | 8 |
|
9 | | -static void cuatro_set_led(uint8_t color, bool enabled) { |
10 | | - switch (color) { |
11 | | - case LED_RED: |
12 | | - set_gpio_output(GPIOC, 6, !enabled); |
13 | | - break; |
14 | | - case LED_GREEN: |
15 | | - set_gpio_output(GPIOC, 7, !enabled); |
16 | | - break; |
17 | | - case LED_BLUE: |
18 | | - set_gpio_output(GPIOC, 9, !enabled); |
19 | | - break; |
20 | | - default: |
21 | | - break; |
22 | | - } |
23 | | -} |
24 | | - |
25 | 9 | static void cuatro_enable_can_transceiver(uint8_t transceiver, bool enabled) { |
26 | 10 | switch (transceiver) { |
27 | 11 | case 1U: |
@@ -66,12 +50,7 @@ static void cuatro_set_amp_enabled(bool enabled){ |
66 | 50 | static void cuatro_init(void) { |
67 | 51 | common_init_gpio(); |
68 | 52 |
|
69 | | - // init LEDs as open drain |
70 | | - set_gpio_output_type(GPIOC, 6, OUTPUT_TYPE_OPEN_DRAIN); |
71 | | - set_gpio_output_type(GPIOC, 7, OUTPUT_TYPE_OPEN_DRAIN); |
72 | | - set_gpio_output_type(GPIOC, 9, OUTPUT_TYPE_OPEN_DRAIN); |
73 | | - |
74 | | - // more open drain |
| 53 | + // open drain |
75 | 54 | set_gpio_output_type(GPIOD, 3, OUTPUT_TYPE_OPEN_DRAIN); // FAN_EN |
76 | 55 | set_gpio_output_type(GPIOC, 12, OUTPUT_TYPE_OPEN_DRAIN); // VBAT_EN |
77 | 56 |
|
@@ -138,7 +117,8 @@ board board_cuatro = { |
138 | 117 | .init = cuatro_init, |
139 | 118 | .init_bootloader = unused_init_bootloader, |
140 | 119 | .enable_can_transceiver = cuatro_enable_can_transceiver, |
141 | | - .set_led = cuatro_set_led, |
| 120 | + .led_GPIO = {GPIOC, GPIOC, GPIOC}, |
| 121 | + .led_pin = {6, 7, 9}, |
142 | 122 | .set_can_mode = tres_set_can_mode, |
143 | 123 | .check_ignition = red_check_ignition, |
144 | 124 | .read_voltage_mV = cuatro_read_voltage_mV, |
|
0 commit comments