28 #include <stm32f7xx_hal.h>
44 #if defined(YGGDRASIL_PERIPHERAL_DEFS)
50 extern I2C_HandleTypeDef hi2c1;
51 extern I2C_HandleTypeDef hi2c2;
52 extern I2C_HandleTypeDef hi2c3;
53 extern I2C_HandleTypeDef hi2c4;
55 extern SPI_HandleTypeDef hspi2;
56 extern SPI_HandleTypeDef hspi4;
57 extern SPI_HandleTypeDef hspi5;
59 extern TIM_HandleTypeDef htim2;
60 extern TIM_HandleTypeDef htim3;
61 extern TIM_HandleTypeDef htim4;
62 extern TIM_HandleTypeDef htim5;
63 extern TIM_HandleTypeDef htim8;
64 extern TIM_HandleTypeDef htim11;
65 extern TIM_HandleTypeDef htim12;
67 extern ADC_HandleTypeDef hadc1;
68 extern ADC_HandleTypeDef hadc2;
69 extern ADC_HandleTypeDef hadc3;
71 extern DAC_HandleTypeDef hdac;
73 extern LTDC_HandleTypeDef hltdc;
74 extern DSI_HandleTypeDef
hdsi;
75 extern DMA2D_HandleTypeDef hdma2d;
77 extern CAN_HandleTypeDef hcan1;
78 extern CAN_HandleTypeDef hcan2;
80 extern UART_HandleTypeDef huart4;
81 extern UART_HandleTypeDef huart8;
82 extern UART_HandleTypeDef huart2;
90 const static gpio_t LD1 = { GPIOJ, 0 };
91 const static gpio_t LDA = LD1;
92 const static gpio_t LedBlue = LD1;
93 const static gpio_t LD2 = { GPIOJ, 1 };
94 const static gpio_t LDB = LD2;
95 const static gpio_t LedRed = LD2;
96 const static gpio_t LD3 = { GPIOJ, 2 };
97 const static gpio_t LDC = LD3;
98 const static gpio_t LedYellow = LD3;
99 const static gpio_t LD4 = { GPIOJ, 3 };
100 const static gpio_t LDD = LD4;
101 const static gpio_t LedGreen = LD4;
103 const static gpio_t Heartbeat = { GPIOA, 10 };
108 const static gpio_t ButtonJoystickA = LeftJoyStickButton;
110 const static gpio_t ButtonJoystickB = RightJoyStickButton;
117 const static gpio_t DriverA = { GPIOC, 13 };
118 const static gpio_t LD5 = DriverA;
119 const static gpio_t LDE = DriverA;
120 const static gpio_t DriverB = { GPIOI, 8 };
121 const static gpio_t LD6 = DriverB;
122 const static gpio_t LDF = DriverB;
123 const static gpio_t DriverC = { GPIOB, 0 };
124 const static gpio_t LD7 = DriverC;
125 const static gpio_t LDG = DriverC;
126 const static gpio_t DriverD = { GPIOB, 1 };
127 const static gpio_t LD8 = DriverD;
128 const static gpio_t LDH = DriverD;
135 const static adc_t ADCA = { &hadc1, 3, 0, 1 << 12 };
136 const static adc_t ADCB = { &hadc1, 10, 0, 1 << 12 };
137 const static adc_t ADCC = { &hadc3, 14, 0, 1 << 12 };
138 const static adc_t ADCD = { &hadc3, 15, 0, 1 << 12 };
139 const static adc_t ADCPotentiometer = { &hadc2, 13, 0, 1 << 12 };
140 const static adc_t ADCTemperature = { &hadc1, 18, 0, 1 << 12 };
147 const static dac_t DACA = { &hdac, 1, 0, 1 << 12 };
148 const static dac_t DACB = { &hdac, 2, 0, 1 << 12 };
155 const static gpio_t SevenSegment_A = { GPIOG, 0 };
156 const static gpio_t SevenSegment_B = { GPIOG, 1 };
157 const static gpio_t SevenSegment_C = { GPIOG, 2 };
158 const static gpio_t SevenSegment_D = { GPIOG, 3 };
159 const static gpio_t SevenSegment_E = { GPIOG, 4 };
160 const static gpio_t SevenSegment_F = { GPIOG, 5 };
161 const static gpio_t SevenSegment_G = { GPIOG, 6 };
162 const static gpio_t SevenSegment_DP = { GPIOG, 7 };
164 const static gpio_t SevenSegment_Select0 = { GPIOJ, 12 };
165 const static gpio_t SevenSegment_Select1 = { GPIOJ, 13 };
166 const static gpio_t SevenSegment_Select2 = { GPIOJ, 14 };
167 const static gpio_t SevenSegment_Select3 = { GPIOJ, 15 };
174 const static i2c_t I2CA = { &hi2c2 };
175 const static i2c_t I2CB = { &hi2c4 };
176 const static i2c_t I2CC = { &hi2c3 };
177 const static i2c_t I2CD = { &hi2c1 };
184 const static spi_t SPIA = { &hspi2 };
185 const static spi_t SPIB = { &hspi4 };
186 const static spi_t SPIC = { &hspi5 };
189 const static gpio_t SK9822_EN = { GPIOD, 9 };
198 const static uart_t UARTA = { &huart2 };
199 const static uart_t UARTB = { &huart8 };
200 const static uart_t UARTC = { &huart4 };
201 const static uart_t UASRTST = UARTC;
208 const static can_t CANA = { &hcan1 };
209 const static can_t CANB = { &hcan2 };
216 const static tim_t TimerA = { &htim12,
sizeof(
u16) };
217 const static tim_t TimerB = { &htim4,
sizeof(
u16) };
218 const static tim_t TimerC = { &htim5,
sizeof(
u32) };
219 const static tim_t TimerD = { &htim3,
sizeof(
u16) };
220 const static tim_t TimerE = { &htim11,
sizeof(
u16) };
221 const static tim_t TimerF = { &htim8,
sizeof(
u16) };
222 const static tim_t TimerG = { &htim2,
sizeof(
u32) };
224 const static tim_t SinkDriverTimerA = TimerD;
225 const static tim_t SinkDriverTimerB = TimerD;
226 const static tim_t SinkDriverTimerC = TimerD;
227 const static tim_t SinkDriverTimerD = TimerD;
243 const static tim_channel_t TimerDCHA = { SinkDriverTimerA, 2 };
244 const static tim_channel_t TimerDCHB = { SinkDriverTimerB, 1 };
245 const static tim_channel_t TimerDCHC = { SinkDriverTimerC, 3 };
246 const static tim_channel_t TimerDCHD = { SinkDriverTimerD, 4 };
248 const static tim_t Encoder = TimerF;
250 const static tim_t ProfileCounter = TimerG;
257 const static gpio_t TC78Mode = { GPIOI, 12 };
266 const static rng_t Random = { };