28 #include <stm32f7xx_hal.h>
48 #if defined(YGGDRASIL_PERIPHERAL_DEFS)
54 extern I2C_HandleTypeDef hi2c1;
55 extern I2C_HandleTypeDef hi2c2;
56 extern I2C_HandleTypeDef hi2c3;
57 extern I2C_HandleTypeDef hi2c4;
59 extern SPI_HandleTypeDef hspi2;
60 extern SPI_HandleTypeDef hspi4;
61 extern SPI_HandleTypeDef hspi5;
63 extern TIM_HandleTypeDef htim2;
64 extern TIM_HandleTypeDef htim3;
65 extern TIM_HandleTypeDef htim4;
66 extern TIM_HandleTypeDef htim5;
67 extern TIM_HandleTypeDef htim8;
68 extern TIM_HandleTypeDef htim11;
69 extern TIM_HandleTypeDef htim12;
71 extern ADC_HandleTypeDef hadc1;
72 extern ADC_HandleTypeDef hadc2;
73 extern ADC_HandleTypeDef hadc3;
75 extern DAC_HandleTypeDef hdac;
77 extern LTDC_HandleTypeDef hltdc;
78 extern DSI_HandleTypeDef
hdsi;
79 extern DMA2D_HandleTypeDef hdma2d;
81 extern CAN_HandleTypeDef hcan1;
82 extern CAN_HandleTypeDef hcan2;
108 static constexpr
auto& LD1 = GPIOPortJ::Pin<0>;
109 static constexpr
auto& LDA = LD1;
110 static constexpr
auto& LedBlue = LD1;
111 static constexpr
auto& LD2 = GPIOPortJ::Pin<1>;
112 static constexpr
auto& LDB = LD2;
113 static constexpr
auto& LedRed = LD2;
114 static constexpr
auto& LD3 = GPIOPortJ::Pin<2>;
115 static constexpr
auto& LDC = LD3;
116 static constexpr
auto& LedYellow = LD3;
117 static constexpr
auto& LD4 = GPIOPortJ::Pin<3>;
118 static constexpr
auto& LDD = LD4;
119 static constexpr
auto& LedGreen = LD4;
121 static constexpr
auto& Heartbeat = GPIOPortA::Pin<10>;
123 static constexpr
auto& EncoderButton = GPIOPortK::Pin<3, drv::Active::Low>;
125 static constexpr
auto& LeftJoyStickButton = GPIOPortG::Pin<10, drv::Active::Low>;
126 static constexpr
auto& ButtonJoystickA = LeftJoyStickButton;
127 static constexpr
auto& RightJoyStickButton = GPIOPortG::Pin<11, drv::Active::Low>;
128 static constexpr
auto& ButtonJoystickB = RightJoyStickButton;
130 static constexpr
auto& ButtonA = GPIOPortK::Pin<4, drv::Active::Low>;
131 static constexpr
auto& ButtonB = GPIOPortK::Pin<5, drv::Active::Low>;
132 static constexpr
auto& ButtonC = GPIOPortK::Pin<6, drv::Active::Low>;
133 static constexpr
auto& ButtonD = GPIOPortK::Pin<7, drv::Active::Low>;
135 static constexpr
auto& DriverA = GPIOPortC::Pin<13>;
136 static constexpr
auto& LD5 = DriverA;
137 static constexpr
auto& LDE = DriverA;
138 static constexpr
auto& DriverB = GPIOPortI::Pin<8>;
139 static constexpr
auto& LD6 = DriverB;
140 static constexpr
auto& LDF = DriverB;
141 static constexpr
auto& DriverC = GPIOPortB::Pin<0>;
142 static constexpr
auto& LD7 = DriverC;
143 static constexpr
auto& LDG = DriverC;
144 static constexpr
auto& DriverD = GPIOPortB::Pin<1>;
145 static constexpr
auto& LD8 = DriverD;
146 static constexpr
auto& LDH = DriverD;
162 static constexpr
auto& ADCA = ADConverter1::Channel<3>;
163 static constexpr
auto& ADCB = ADConverter1::Channel<10>;
164 static constexpr
auto& ADCC = ADConverter3::Channel<14>;
165 static constexpr
auto& ADCD = ADConverter3::Channel<15>;
166 static constexpr
auto& ADCPotentiometer = ADConverter2::Channel<13>;
167 static constexpr
auto& ADCTemperature = ADConverter1::Channel<18>;
181 static constexpr
auto& DACA = DAConverter::Channel<1>;
182 static constexpr
auto& DACB = DAConverter::Channel<2>;
189 namespace seven_segment {
191 static constexpr
auto& A = GPIOPortG::Pin<0>;
192 static constexpr
auto& B = GPIOPortG::Pin<1>;
193 static constexpr
auto& C = GPIOPortG::Pin<2>;
194 static constexpr
auto& D = GPIOPortG::Pin<3>;
195 static constexpr
auto& E = GPIOPortG::Pin<4>;
196 static constexpr
auto& F = GPIOPortG::Pin<5>;
197 static constexpr
auto& G = GPIOPortG::Pin<6>;
198 static constexpr
auto& DP = GPIOPortG::Pin<7>;
200 static constexpr
auto& All = GPIOPortG::Out<0,7>;
202 static constexpr
auto& Select0 = GPIOPortJ::Pin<12>;
203 static constexpr
auto& Select1 = GPIOPortJ::Pin<13>;
204 static constexpr
auto& Select2 = GPIOPortJ::Pin<14>;
205 static constexpr
auto& Select3 = GPIOPortJ::Pin<15>;
207 static constexpr
auto& SelectAll = GPIOPortJ::Out<12,15>;
230 static constexpr
auto& SPIACE = GPIOPortI::Pin<0, drv::Active::Low>;
231 static constexpr
auto& SK9822_EN = GPIOPortD::Pin<9>;
232 static constexpr
auto& SPIBCE = GPIOPortE::Pin<11, drv::Active::Low>;
233 static constexpr
auto& SPICCE = GPIOPortH::Pin<5, drv::Active::Low>;
243 using UARTST = UARTC;
266 using SinkDriverTimerA = TimerD;
267 using SinkDriverTimerB = TimerD;
268 using SinkDriverTimerC = TimerD;
269 using SinkDriverTimerD = TimerD;
276 static constexpr
auto& TimerACHA = TimerA::Channel<1>;
278 static constexpr
auto& TimerBCHA = TimerB::Channel<1>;
279 static constexpr
auto& TimerBCHB = TimerB::Channel<2>;
280 static constexpr
auto& TimerBCHC = TimerB::Channel<3>;
281 static constexpr
auto& TimerBCHD = TimerB::Channel<4>;
283 static constexpr
auto& TimerCCHA = TimerC::Channel<1>;
285 static constexpr
auto& SinkDriverTimerCHA = SinkDriverTimerA::Channel<1>;
286 static constexpr
auto& SinkDriverTimerCHB = SinkDriverTimerB::Channel<2>;
287 static constexpr
auto& SinkDriverTimerCHC = SinkDriverTimerC::Channel<3>;
288 static constexpr
auto& SinkDriverTimerCHD = SinkDriverTimerD::Channel<4>;
290 static constexpr
auto& Encoder = TimerF::Encoder;
292 static constexpr
auto& ProfileCounter = TimerG::ProfileCounter;
299 static constexpr
auto& TC78Mode = GPIOPortI::Pin<12>;
300 static constexpr
auto& TC78Err = GPIOPortI::Pin<13, drv::Active::Low>;
301 static constexpr
auto& TC78Stby = GPIOPortI::Pin<14, drv::Active::Low>;