Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Functions | Variables
main.c File Reference

: Main program body More...

#include "main.h"
#include "cmsis_os.h"
#include "../Inc/Files/can1_dbc.h"
#include "../Inc/Scheduler/Scheduler.h"
#include "../Inc/Sensors/AnalogSensor.h"
#include "../Inc/Systems/Comms/Can/Can.h"
#include "../Inc/Systems/Controller/Apps.h"
#include "../Inc/Systems/Controller/BrakeSystemControl.h"
#include "../Inc/Systems/Controller/RTD.h"
#include "../Inc/Systems/Controller/TorqueControl.h"
#include "../Inc/Systems/External/Inverter.h"
#include "../Inc/Systems/Monitor/AppsMonitor.h"
#include "../Inc/Systems/Monitor/BrakePolice.h"
#include "../Inc/Systems/Monitor/RTDMonitor.h"
#include "../Inc/Systems/Monitor/TorquePolice.h"
#include "../Inc/Utils/Constants.h"
#include "stm32f7xx_hal_adc.h"
Include dependency graph for main.c:

Go to the source code of this file.

Functions

void SystemClock_Config (void)
 System Clock Configuration. More...
 
static void MX_GPIO_Init (void)
 GPIO Initialization Function. More...
 
static void MX_DMA_Init (void)
 
static void MX_TIM1_Init (void)
 TIM1 Initialization Function. More...
 
static void MX_ADC1_Init (void)
 ADC1 Initialization Function. More...
 
static void MX_ADC2_Init (void)
 ADC2 Initialization Function. More...
 
static void MX_ADC3_Init (void)
 ADC3 Initialization Function. More...
 
static void MX_CAN1_Init (void)
 CAN1 Initialization Function. More...
 
static void MX_CAN2_Init (void)
 CAN2 Initialization Function. More...
 
static void MX_USART3_UART_Init (void)
 USART3 Initialization Function. More...
 
static void MX_TIM2_Init (void)
 TIM2 Initialization Function. More...
 
static void MX_DAC_Init (void)
 DAC Initialization Function. More...
 
static void MX_CAN3_Init (void)
 CAN3 Initialization Function. More...
 
static void MX_I2C2_Init (void)
 I2C2 Initialization Function. More...
 
static void MX_I2C4_Init (void)
 I2C4 Initialization Function. More...
 
static void MX_SPI4_Init (void)
 SPI4 Initialization Function. More...
 
static void MX_SPI6_Init (void)
 SPI6 Initialization Function. More...
 
void StartDefaultTask (void *argument)
 Function implementing the defaultTask thread. More...
 
int main (void)
 The application entry point. More...
 
int _write (int file, char *data, int len)
 
void vApplicationMallocFailedHook (void)
 
void vApplicationIdleHook (void)
 
void vApplicationStackOverflowHook (TaskHandle_t xTask, char *pcTaskName)
 
void vApplicationTickHook (void)
 
void Error_Handler (void)
 This function is executed in case of error occurrence. More...
 

Variables

ADC_HandleTypeDef hadc1
 
ADC_HandleTypeDef hadc2
 
ADC_HandleTypeDef hadc3
 
DMA_HandleTypeDef hdma_adc1
 
DMA_HandleTypeDef hdma_adc2
 
DMA_HandleTypeDef hdma_adc3
 
CAN_HandleTypeDef hcan1
 
CAN_HandleTypeDef hcan2
 
CAN_HandleTypeDef hcan3
 
DAC_HandleTypeDef hdac
 
DMA_HandleTypeDef hdma_dac1
 
DMA_HandleTypeDef hdma_dac2
 
I2C_HandleTypeDef hi2c2
 
I2C_HandleTypeDef hi2c4
 
SPI_HandleTypeDef hspi4
 
SPI_HandleTypeDef hspi6
 
TIM_HandleTypeDef htim1
 
TIM_HandleTypeDef htim2
 
UART_HandleTypeDef huart3
 
osThreadId_t defaultTaskHandle
 
const osThreadAttr_t defaultTask_attributes
 
uint32_t adc1_buffer [ADC1_CHANNEL_SIZE]
 
uint32_t adc2_buffer [ADC2_CHANNEL_SIZE]
 
uint32_t adc3_buffer [ADC3_CHANNEL_SIZE]
 
uint32_t dac1_buffer [DAC1_BUFFER_SIZE]
 
uint32_t dac2_buffer [DAC2_BUFFER_SIZE]
 
uint8_t digital_out_buffer [NUM_DIGITAL_OUTPUTS]
 
uint8_t digital_in_buffer [NUM_DIGITAL_INPUTS]
 

Detailed Description

: Main program body

Attention

Copyright (c) 2024 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file main.c.

Function Documentation

◆ _write()

int _write ( int  file,
char *  data,
int  len 
)

Definition at line 1442 of file main.c.

1443{
1444 // Transmit data using USART3
1445 HAL_UART_Transmit(&huart3, (uint8_t *)data, len, HAL_MAX_DELAY);
1446 return len;
1447
1448#endif // <--- DONT DELETE THIS, IT IS LINKED TO LAST LINE IN MAIN FUNCTION TO ALLOW SIL BUILDS
1449
1450}
UART_HandleTypeDef huart3
Definition: main.c:85

◆ Error_Handler()

void Error_Handler ( void  )

This function is executed in case of error occurrence.

Return values
None

Definition at line 1496 of file main.c.

1497{
1498 /* USER CODE BEGIN Error_Handler_Debug */
1499 /* User can add his own implementation to report the HAL error return state */
1500
1501 #ifndef TEST_MODE
1502 __disable_irq();
1503 #endif
1504
1505 while (1)
1506 {
1507 printf("Error_Handler\r\n");
1508 }
1509 /* USER CODE END Error_Handler_Debug */
1510}
Here is the caller graph for this function:

◆ main()

int main ( void  )

The application entry point.

Return values
int

Definition at line 137 of file main.c.

138{
139
140 /* USER CODE BEGIN 1 */
141
142 #ifndef TEST_MODE
143
144 /* USER CODE END 1 */
145
146 /* MCU Configuration--------------------------------------------------------*/
147
148 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
149 HAL_Init();
150
151 /* USER CODE BEGIN Init */
152
153 /* USER CODE END Init */
154
155 /* Configure the system clock */
157
158 /* USER CODE BEGIN SysInit */
159
160 /* USER CODE END SysInit */
161
162 /* Initialize all configured peripherals */
163 MX_GPIO_Init();
164 MX_DMA_Init();
165 MX_TIM1_Init();
166 MX_ADC1_Init();
167 MX_ADC2_Init();
168 MX_ADC3_Init();
169 MX_CAN1_Init();
170 MX_CAN2_Init();
172 MX_TIM2_Init();
173 MX_DAC_Init();
174 MX_CAN3_Init();
175 MX_I2C2_Init();
176 MX_I2C4_Init();
177 MX_SPI4_Init();
178 MX_SPI6_Init();
179 /* USER CODE BEGIN 2 */
180
181 // Clear the screen
182 printf("\033[2J\033[1;1H");
183 printf("Welcome to VCU!!!\r\n");
184 if (init_CANBus(CAN_1) != 0) {
185 printf("CAN1 init failed\r\n");
186 }
187
188 // Begin ADC DMA
189 if(HAL_ADC_Start_DMA(&hadc1, (uint32_t*)adc1_buffer, 7) != HAL_OK) {
191 }
192
193 if(HAL_ADC_Start_DMA(&hadc2, (uint32_t*)adc2_buffer, 7) != HAL_OK) {
195 }
196
197 if(HAL_ADC_Start_DMA(&hadc3, (uint32_t*)adc3_buffer, 8) != HAL_OK) {
199 }
200
201 // Begin DAC DMA
202 if(HAL_DAC_Start_DMA(&hdac, DAC_CHANNEL_1, (uint32_t*)dac1_buffer, DAC1_BUFFER_SIZE, DAC_ALIGN_12B_R) != HAL_OK) {
204 }
205
206 uint32_t multi_mode = (ADC123_COMMON->CCR & ADC_CCR_MULTI);
207 printf("ADC Multi-mode: 0x%08lX\r\n", multi_mode);
208
209 #endif
210
211 // Add a message to the CAN message list
212 CAN_Signal_Template signals[8] = {
213 { .name = "VDD", .start_bit = 0, .length = 8, .endian = 0, .isSigned = 0, .scale = 0.1, .offset = 0, .min = 0, .max = 255, .unit = "voltage", .reciever = "reciever" },
214 { .name = "Char 2", .start_bit = 8, .length = 8, .endian = 0, .isSigned = 0, .scale = 1, .offset = 0, .min = 0, .max = 255, .unit = "unit", .reciever = "reciever" },
215 { .name = "Char 3", .start_bit = 16, .length = 8, .endian = 0, .isSigned = 0, .scale = 1, .offset = 0, .min = 0, .max = 255, .unit = "unit", .reciever = "reciever" },
216 { .name = "Char 4", .start_bit = 24, .length = 8, .endian = 0, .isSigned = 0, .scale = 1, .offset = 0, .min = 0, .max = 255, .unit = "unit", .reciever = "reciever" },
217 { .name = "Char 5", .start_bit = 32, .length = 8, .endian = 0, .isSigned = 0, .scale = 1, .offset = 0, .min = 0, .max = 255, .unit = "unit", .reciever = "reciever" },
218 { .name = "Char 6", .start_bit = 40, .length = 8, .endian = 0, .isSigned = 0, .scale = 1, .offset = 0, .min = 0, .max = 255, .unit = "unit", .reciever = "reciever" },
219 { .name = "Char 7", .start_bit = 48, .length = 8, .endian = 0, .isSigned = 0, .scale = 1, .offset = 0, .min = 0, .max = 255, .unit = "unit", .reciever = "reciever" },
220 { .name = "Char 8", .start_bit = 56, .length = 8, .endian = 0, .isSigned = 0, .scale = 1, .offset = 0, .min = 0, .max = 255, .unit = "unit", .reciever = "reciever" }
221 };
222
223 add_message_lop(CAN_1, 0x123, 8, 0, 0, "Message 1", "AD3", 8, signals);
224
225
226 add_message_lop(CAN_1, 0x124, 8, 0, 0, "Message 2", "VCU", 8, signals);
227
228 // Print the CAN message list
230
231 uint8_t txdata[8] = {0, 1, 2, 3, 4, 5, 6, 7};
232 send_CAN_message(CAN_1, CAN_2A, 124, txdata, 8);
233
234 // Make Apps Controller and Monitor
235 Apps apps;
236 initApps(&apps, 10, 8, 4);
237
238 AppsMonitor am;
239 initAppsMonitor(&am, &apps, 10);
240
241 // Bind Appsmonitor to Apps
242 apps.base.addMonitor(&apps, &am);
243
244 // Start the Apps Monitor
245 startAppsMonitor(&am);
246
247 // Make Break Controller and Monitor
249 initBrakeSystemControl(&bsc, 10, 200, 400, 1000, 10, 5, 6, 0);
250
251 BrakePolice bp;
252 initBrakePolice(&bp, &bsc, 100, 200);
253
254 // Bind BrakePolice to BrakeSystemControl
255 bsc.base.addMonitor(&bsc, &bp);
256
257 // Start the Brake Controller and Monitor
259 startBrakePolice(&bp);
260
261 // Make RTD Controller and Monitor
262 RTD rtd;
263 initRTD(&rtd, &apps, &bsc, 10, 0, 1);
264
265 RTDMonitor rm;
266 initRTDMonitor(&rm, &rtd, 10);
267
268 // Bind RTDMonitor to RTD
269 rtd.base.addMonitor(&rtd, &rm);
270
271 // Start the RTD Controller and Monitor
272 startRTD(&rtd);
273 startRTDMonitor(&rm);
274
275 // Make Torque Controller and Monitor
276 TorqueControl tc;
277 initTorqueControl(&tc, &apps, 10, 240);
278
279 TorquePolice tp;
280 initTorquePolice(&tp, &tc, &bsc, &rtd, 100, 240);
281
282 // Bind TorquePolice to TorqueControl
283 tc.base.addMonitor(&tc, &tp);
284
285 // Start the Torque Controller and Monitor
288
289 // Make Inverter
290 Inverter inverter;
291 initInverter(&inverter, &tc, 10, 200, 100, 400);
292
293 // Make Scheduler from updateable array
294 Scheduler scheduler;
295
296 Updateable* updateables[6];
297 updateables[0] = &apps.base.system.updateable;
298 updateables[1] = &bsc.base.system.updateable;
299 updateables[2] = &rtd.base.system.updateable;
300 updateables[3] = &tc.base.system.updateable;
301 updateables[4] = &inverter.base.system.updateable;
302 updateables[5] = NULL;
303
304 SchedulerInit(&scheduler, updateables);
305
306 printf("Starting Vehicle Control Unit with FreeRTOS scheduler...\n");
307
308 // Start the Scheduler
309 SchedulerRun(&scheduler);
310 /* USER CODE END 2 */
311
312 /* Init scheduler */
313 osKernelInitialize();
314
315 /* USER CODE BEGIN RTOS_MUTEX */
316 /* add mutexes, ... */
317 /* USER CODE END RTOS_MUTEX */
318
319 /* USER CODE BEGIN RTOS_SEMAPHORES */
320 /* add semaphores, ... */
321 /* USER CODE END RTOS_SEMAPHORES */
322
323 /* USER CODE BEGIN RTOS_TIMERS */
324 /* start timers, add new ones, ... */
325 /* USER CODE END RTOS_TIMERS */
326
327 /* USER CODE BEGIN RTOS_QUEUES */
328 /* add queues, ... */
329 /* USER CODE END RTOS_QUEUES */
330
331 /* Create the thread(s) */
332 /* creation of defaultTask */
334
335 /* USER CODE BEGIN RTOS_THREADS */
336 /* add threads, ... */
337 /* USER CODE END RTOS_THREADS */
338
339 /* USER CODE BEGIN RTOS_EVENTS */
340 /* add events, ... */
341 /* USER CODE END RTOS_EVENTS */
342
343 /* Start scheduler */
344 osKernelStart();
345
346 /* We should never get here as control is now taken by the scheduler */
347
348 /* Infinite loop */
349 /* USER CODE BEGIN WHILE */
350 while (1)
351 {
352 printf("ERROR: Scheduler returned unexpectedly!\n");
353 HAL_Delay(1000);
354 /* USER CODE END WHILE */
355
356 /* USER CODE BEGIN 3 */
357 }
358 #ifndef TEST_MODE
359 /* USER CODE END 3 */
360}
void initAppsMonitor(AppsMonitor *am, Apps *apps, int hz)
Definition: AppsMonitor.c:6
int startAppsMonitor(AppsMonitor *am)
Definition: AppsMonitor.c:13
void initApps(Apps *apps, int hz, int channel1, int channel2)
Initializes the APPs with the given frequency and channel.
Definition: Apps.c:7
int startBrakePolice(BrakePolice *bp)
Definition: BrakePolice.c:13
void initBrakePolice(BrakePolice *bp, BrakeSystemControl *bsc, int hz, int maxTemp)
Definition: BrakePolice.c:5
void initBrakeSystemControl(BrakeSystemControl *bsc, int hz, int maxTemp, int brakeLightActivationPoint, int heavyBrakingActivationPoint, int fbp_channel, int rbp_channel, int temp_channel, int light_port)
Initializes the Braking System with initial settings.
int startBrakeSystemControl(BrakeSystemControl *bsc)
Starts the Brake System Controller.
int init_CANBus(CANBus bus)
Initializes the CANBus struct.
Definition: Can.c:17
@ CAN_1
Definition: Can.h:99
int add_message_lop(CANBus bus, int id, int dlc, int ide, int rtr, const char *name, const char *sender, int signal_count, CAN_Signal_Template *signals)
Adds a message to the CAN message list by passing in the individual message parameters hence "LOP" (L...
Definition: Can.c:55
int send_CAN_message(CANBus bus, CANProtocol protocol, uint32_t id, uint8_t *data, uint8_t len)
Sends a CAN message.
Definition: Can.c:79
@ CAN_2A
Definition: Can.h:105
void print_CAN_Messages_Lists()
Prints the CAN message list.
Definition: Can.c:190
#define DAC1_BUFFER_SIZE
Definition: Constants.h:9
void initInverter(Inverter *inverter, TorqueControl *tc, int hz, int maxCurrent, int maxTemp, int maxVoltage)
Initializes the Inverter with initial settings.
Definition: Inverter.c:6
void initRTDMonitor(RTDMonitor *rtdm, RTD *rtd, int hz)
Initializes the RTD Monitor with initial settings.
Definition: RTDMonitor.c:4
int startRTDMonitor(RTDMonitor *rtdm)
Starts the RTD Monitor.
Definition: RTDMonitor.c:9
int startRTD(RTD *rtd)
Starts the RTD Actuator.
Definition: RTD.c:23
void initRTD(RTD *rtd, Apps *apps, BrakeSystemControl *bsc, int hz, int buttonPort, int piezoPort)
Initializes the RTD Actuator with initial settings.
Definition: RTD.c:6
void SchedulerInit(Scheduler *scheduler, Updateable *updatableArray[])
Definition: Scheduler.c:80
void SchedulerRun(Scheduler *scheduler)
Definition: Scheduler.c:142
static void MX_CAN3_Init(void)
CAN3 Initialization Function.
Definition: main.c:863
void Error_Handler(void)
This function is executed in case of error occurrence.
Definition: main.c:1496
uint32_t adc3_buffer[ADC3_CHANNEL_SIZE]
Definition: main.c:125
static void MX_USART3_UART_Init(void)
USART3 Initialization Function.
Definition: main.c:1217
static void MX_TIM1_Init(void)
TIM1 Initialization Function.
Definition: main.c:1123
ADC_HandleTypeDef hadc1
Definition: main.c:61
const osThreadAttr_t defaultTask_attributes
Definition: main.c:89
static void MX_CAN1_Init(void)
CAN1 Initialization Function.
Definition: main.c:743
DAC_HandleTypeDef hdac
Definition: main.c:72
static void MX_ADC2_Init(void)
ADC2 Initialization Function.
Definition: main.c:522
static void MX_SPI6_Init(void)
SPI6 Initialization Function.
Definition: main.c:1083
static void MX_DMA_Init(void)
Definition: main.c:1250
uint32_t adc2_buffer[ADC2_CHANNEL_SIZE]
Definition: main.c:124
osThreadId_t defaultTaskHandle
Definition: main.c:88
void SystemClock_Config(void)
System Clock Configuration.
Definition: main.c:366
static void MX_CAN2_Init(void)
CAN2 Initialization Function.
Definition: main.c:803
ADC_HandleTypeDef hadc3
Definition: main.c:63
void StartDefaultTask(void *argument)
Function implementing the defaultTask thread.
Definition: main.c:1481
static void MX_ADC1_Init(void)
ADC1 Initialization Function.
Definition: main.c:417
ADC_HandleTypeDef hadc2
Definition: main.c:62
static void MX_ADC3_Init(void)
ADC3 Initialization Function.
Definition: main.c:628
static void MX_SPI4_Init(void)
SPI4 Initialization Function.
Definition: main.c:1043
static void MX_GPIO_Init(void)
GPIO Initialization Function.
Definition: main.c:1281
static void MX_DAC_Init(void)
DAC Initialization Function.
Definition: main.c:900
static void MX_I2C4_Init(void)
I2C4 Initialization Function.
Definition: main.c:995
static void MX_I2C2_Init(void)
I2C2 Initialization Function.
Definition: main.c:947
uint32_t adc1_buffer[ADC1_CHANNEL_SIZE]
Definition: main.c:123
static void MX_TIM2_Init(void)
TIM2 Initialization Function.
Definition: main.c:1170
uint32_t dac1_buffer[DAC1_BUFFER_SIZE]
Definition: main.c:126
int startTorqueControl(TorqueControl *tc)
Starts the Torque Control Actuator.
Definition: TorqueControl.c:13
void initTorqueControl(TorqueControl *tc, Apps *apps, int hz, float maxTorque)
Initializes the Torque Control Actuator with initial settings.
Definition: TorqueControl.c:6
void initTorquePolice(TorquePolice *tp, TorqueControl *tc, BrakeSystemControl *bsc, RTD *rtd, int hz, float maxTorque)
Definition: TorquePolice.c:5
int startTorquePolice(TorquePolice *tp)
Definition: TorquePolice.c:15
Definition: Apps.h:22
ControllerSystem base
Definition: Apps.h:23
ControllerSystem base
char name[MAX_SIGNAL_NAME_LENGTH]
Definition: Can.h:20
int(* addMonitor)(struct ControllerSystem *controller, MonitorSystem *monitor)
ExternalSystem base
Definition: Inverter.h:9
Definition: RTD.h:11
ControllerSystem base
Definition: RTD.h:12
Updateable updateable
Definition: System.h:18
ControllerSystem base
Definition: TorqueControl.h:19
Here is the call graph for this function:

◆ MX_ADC1_Init()

static void MX_ADC1_Init ( void  )
static

ADC1 Initialization Function.

Parameters
None
Return values
None

Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion)

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Definition at line 417 of file main.c.

418{
419
420 /* USER CODE BEGIN ADC1_Init 0 */
421
422 /* USER CODE END ADC1_Init 0 */
423
424 ADC_ChannelConfTypeDef sConfig = {0};
425
426 /* USER CODE BEGIN ADC1_Init 1 */
427
428 /* USER CODE END ADC1_Init 1 */
429
432 hadc1.Instance = ADC1;
433 hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4;
434 hadc1.Init.Resolution = ADC_RESOLUTION_12B;
435 hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE;
436 hadc1.Init.ContinuousConvMode = DISABLE;
437 hadc1.Init.DiscontinuousConvMode = DISABLE;
438 hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_RISING;
439 hadc1.Init.ExternalTrigConv = ADC_EXTERNALTRIGCONV_T2_TRGO;
440 hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
441 hadc1.Init.NbrOfConversion = 7;
442 hadc1.Init.DMAContinuousRequests = ENABLE;
443 hadc1.Init.EOCSelection = ADC_EOC_SEQ_CONV;
444 if (HAL_ADC_Init(&hadc1) != HAL_OK)
445 {
447 }
448
451 sConfig.Channel = ADC_CHANNEL_0;
452 sConfig.Rank = ADC_REGULAR_RANK_1;
453 sConfig.SamplingTime = ADC_SAMPLETIME_28CYCLES;
454 if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
455 {
457 }
458
461 sConfig.Channel = ADC_CHANNEL_2;
462 sConfig.Rank = ADC_REGULAR_RANK_2;
463 if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
464 {
466 }
467
470 sConfig.Channel = ADC_CHANNEL_6;
471 sConfig.Rank = ADC_REGULAR_RANK_3;
472 if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
473 {
475 }
476
479 sConfig.Channel = ADC_CHANNEL_8;
480 sConfig.Rank = ADC_REGULAR_RANK_4;
481 if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
482 {
484 }
485
488 sConfig.Channel = ADC_CHANNEL_10;
489 sConfig.Rank = ADC_REGULAR_RANK_5;
490 if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
491 {
493 }
494
497 sConfig.Channel = ADC_CHANNEL_12;
498 sConfig.Rank = ADC_REGULAR_RANK_6;
499 if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
500 {
502 }
503
506 sConfig.Rank = ADC_REGULAR_RANK_7;
507 if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
508 {
510 }
511 /* USER CODE BEGIN ADC1_Init 2 */
512
513 /* USER CODE END ADC1_Init 2 */
514
515}
#define ENABLE(item_)
Definition: Updateable.h:10
#define DISABLE(item_)
Definition: Updateable.h:11
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_ADC2_Init()

static void MX_ADC2_Init ( void  )
static

ADC2 Initialization Function.

Parameters
None
Return values
None

Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion)

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Definition at line 522 of file main.c.

523{
524
525 /* USER CODE BEGIN ADC2_Init 0 */
526
527 /* USER CODE END ADC2_Init 0 */
528
529 ADC_ChannelConfTypeDef sConfig = {0};
530
531 /* USER CODE BEGIN ADC2_Init 1 */
532
533 /* USER CODE END ADC2_Init 1 */
534
537 hadc2.Instance = ADC2;
538 hadc2.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4;
539 hadc2.Init.Resolution = ADC_RESOLUTION_12B;
540 hadc2.Init.ScanConvMode = ADC_SCAN_ENABLE;
541 hadc2.Init.ContinuousConvMode = DISABLE;
542 hadc2.Init.DiscontinuousConvMode = DISABLE;
543 hadc2.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_RISING;
544 hadc2.Init.ExternalTrigConv = ADC_EXTERNALTRIGCONV_T2_TRGO;
545 hadc2.Init.DataAlign = ADC_DATAALIGN_RIGHT;
546 hadc2.Init.NbrOfConversion = 7;
547 hadc2.Init.DMAContinuousRequests = ENABLE;
548 hadc2.Init.EOCSelection = ADC_EOC_SEQ_CONV;
549 if (HAL_ADC_Init(&hadc2) != HAL_OK)
550 {
552 }
553
556 sConfig.Channel = ADC_CHANNEL_1;
557 sConfig.Rank = ADC_REGULAR_RANK_1;
558 sConfig.SamplingTime = ADC_SAMPLETIME_28CYCLES;
559 if (HAL_ADC_ConfigChannel(&hadc2, &sConfig) != HAL_OK)
560 {
562 }
563
566 sConfig.Channel = ADC_CHANNEL_3;
567 sConfig.Rank = ADC_REGULAR_RANK_2;
568 if (HAL_ADC_ConfigChannel(&hadc2, &sConfig) != HAL_OK)
569 {
571 }
572
575 sConfig.Channel = ADC_CHANNEL_7;
576 sConfig.Rank = ADC_REGULAR_RANK_3;
577 if (HAL_ADC_ConfigChannel(&hadc2, &sConfig) != HAL_OK)
578 {
580 }
581
584 sConfig.Channel = ADC_CHANNEL_9;
585 sConfig.Rank = ADC_REGULAR_RANK_4;
586 if (HAL_ADC_ConfigChannel(&hadc2, &sConfig) != HAL_OK)
587 {
589 }
590
593 sConfig.Channel = ADC_CHANNEL_11;
594 sConfig.Rank = ADC_REGULAR_RANK_5;
595 if (HAL_ADC_ConfigChannel(&hadc2, &sConfig) != HAL_OK)
596 {
598 }
599
602 sConfig.Channel = ADC_CHANNEL_13;
603 sConfig.Rank = ADC_REGULAR_RANK_6;
604 if (HAL_ADC_ConfigChannel(&hadc2, &sConfig) != HAL_OK)
605 {
607 }
608
611 sConfig.Channel = ADC_CHANNEL_15;
612 sConfig.Rank = ADC_REGULAR_RANK_7;
613 if (HAL_ADC_ConfigChannel(&hadc2, &sConfig) != HAL_OK)
614 {
616 }
617 /* USER CODE BEGIN ADC2_Init 2 */
618
619 /* USER CODE END ADC2_Init 2 */
620
621}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_ADC3_Init()

static void MX_ADC3_Init ( void  )
static

ADC3 Initialization Function.

Parameters
None
Return values
None

Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion)

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Definition at line 628 of file main.c.

629{
630
631 /* USER CODE BEGIN ADC3_Init 0 */
632
633 /* USER CODE END ADC3_Init 0 */
634
635 ADC_ChannelConfTypeDef sConfig = {0};
636
637 /* USER CODE BEGIN ADC3_Init 1 */
638
639 /* USER CODE END ADC3_Init 1 */
640
643 hadc3.Instance = ADC3;
644 hadc3.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4;
645 hadc3.Init.Resolution = ADC_RESOLUTION_12B;
646 hadc3.Init.ScanConvMode = ADC_SCAN_ENABLE;
647 hadc3.Init.ContinuousConvMode = DISABLE;
648 hadc3.Init.DiscontinuousConvMode = DISABLE;
649 hadc3.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_RISING;
650 hadc3.Init.ExternalTrigConv = ADC_EXTERNALTRIGCONV_T2_TRGO;
651 hadc3.Init.DataAlign = ADC_DATAALIGN_RIGHT;
652 hadc3.Init.NbrOfConversion = 8;
653 hadc3.Init.DMAContinuousRequests = ENABLE;
654 hadc3.Init.EOCSelection = ADC_EOC_SINGLE_CONV;
655 if (HAL_ADC_Init(&hadc3) != HAL_OK)
656 {
658 }
659
662 sConfig.Channel = ADC_CHANNEL_4;
663 sConfig.Rank = ADC_REGULAR_RANK_1;
664 sConfig.SamplingTime = ADC_SAMPLETIME_28CYCLES;
665 if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK)
666 {
668 }
669
672 sConfig.Channel = ADC_CHANNEL_5;
673 sConfig.Rank = ADC_REGULAR_RANK_2;
674 if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK)
675 {
677 }
678
681 sConfig.Channel = ADC_CHANNEL_6;
682 sConfig.Rank = ADC_REGULAR_RANK_3;
683 if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK)
684 {
686 }
687
690 sConfig.Channel = ADC_CHANNEL_7;
691 sConfig.Rank = ADC_REGULAR_RANK_4;
692 if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK)
693 {
695 }
696
699 sConfig.Channel = ADC_CHANNEL_8;
700 sConfig.Rank = ADC_REGULAR_RANK_5;
701 if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK)
702 {
704 }
705
708 sConfig.Channel = ADC_CHANNEL_9;
709 sConfig.Rank = ADC_REGULAR_RANK_6;
710 if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK)
711 {
713 }
714
717 sConfig.Channel = ADC_CHANNEL_14;
718 sConfig.Rank = ADC_REGULAR_RANK_7;
719 if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK)
720 {
722 }
723
726 sConfig.Channel = ADC_CHANNEL_15;
727 sConfig.Rank = ADC_REGULAR_RANK_8;
728 if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK)
729 {
731 }
732 /* USER CODE BEGIN ADC3_Init 2 */
733
734 /* USER CODE END ADC3_Init 2 */
735
736}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_CAN1_Init()

static void MX_CAN1_Init ( void  )
static

CAN1 Initialization Function.

Parameters
None
Return values
None

Definition at line 743 of file main.c.

744{
745
746 /* USER CODE BEGIN CAN1_Init 0 */
747
748 /* USER CODE END CAN1_Init 0 */
749
750 /* USER CODE BEGIN CAN1_Init 1 */
751
752 /* USER CODE END CAN1_Init 1 */
753 hcan1.Instance = CAN1;
754 hcan1.Init.Prescaler = 3;
755 hcan1.Init.Mode = CAN_MODE_NORMAL;
756 hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ;
757 hcan1.Init.TimeSeg1 = CAN_BS1_13TQ;
758 hcan1.Init.TimeSeg2 = CAN_BS2_2TQ;
759 hcan1.Init.TimeTriggeredMode = DISABLE;
760 hcan1.Init.AutoBusOff = DISABLE;
761 hcan1.Init.AutoWakeUp = DISABLE;
762 hcan1.Init.AutoRetransmission = DISABLE;
763 hcan1.Init.ReceiveFifoLocked = DISABLE;
764 hcan1.Init.TransmitFifoPriority = DISABLE;
765 if (HAL_CAN_Init(&hcan1) != HAL_OK)
766 {
768 }
769 /* USER CODE BEGIN CAN1_Init 2 */
770 CAN_FilterTypeDef sFilterConfig;
771 sFilterConfig.FilterBank = 0;
772 sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
773 sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
774 sFilterConfig.FilterIdHigh = 0x0000;
775 sFilterConfig.FilterIdLow = 0x0000;
776 sFilterConfig.FilterMaskIdHigh = 0x0000;
777 sFilterConfig.FilterMaskIdLow = 0x0000;
778 sFilterConfig.FilterFIFOAssignment = CAN_RX_FIFO0;
779 sFilterConfig.FilterActivation = ENABLE;
780 sFilterConfig.SlaveStartFilterBank = 14;
781 HAL_CAN_ConfigFilter(&hcan1, &sFilterConfig);
782
783 // Stop CAN
784 HAL_CAN_Stop(&hcan1);
785 // Start CAN
786 if (HAL_CAN_Start(&hcan1) != HAL_OK) {
787 printf("CAN1 Start Error: ErrorCode = 0x%lX\r\n", hcan1.ErrorCode);
788 }
789
790 // Start IRQ for CAN Rx
791 if (HAL_CAN_ActivateNotification(&hcan1, CAN_IT_RX_FIFO0_MSG_PENDING) != HAL_OK) {
792 printf("interrupt CAN1 init failed\r\n");
793 }
794 /* USER CODE END CAN1_Init 2 */
795
796}
CAN_HandleTypeDef hcan1
Definition: main.c:68
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_CAN2_Init()

static void MX_CAN2_Init ( void  )
static

CAN2 Initialization Function.

Parameters
None
Return values
None

Definition at line 803 of file main.c.

804{
805
806 /* USER CODE BEGIN CAN2_Init 0 */
807
808 /* USER CODE END CAN2_Init 0 */
809
810 /* USER CODE BEGIN CAN2_Init 1 */
811
812 /* USER CODE END CAN2_Init 1 */
813 hcan2.Instance = CAN2;
814 hcan2.Init.Prescaler = 4;
815 hcan2.Init.Mode = CAN_MODE_NORMAL;
816 hcan2.Init.SyncJumpWidth = CAN_SJW_1TQ;
817 hcan2.Init.TimeSeg1 = CAN_BS1_10TQ;
818 hcan2.Init.TimeSeg2 = CAN_BS2_1TQ;
819 hcan2.Init.TimeTriggeredMode = DISABLE;
820 hcan2.Init.AutoBusOff = DISABLE;
821 hcan2.Init.AutoWakeUp = DISABLE;
822 hcan2.Init.AutoRetransmission = DISABLE;
823 hcan2.Init.ReceiveFifoLocked = DISABLE;
824 hcan2.Init.TransmitFifoPriority = DISABLE;
825 if (HAL_CAN_Init(&hcan2) != HAL_OK)
826 {
828 }
829 /* USER CODE BEGIN CAN2_Init 2 */
830 CAN_FilterTypeDef sFilterConfig;
831 sFilterConfig.FilterBank = 0;
832 sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
833 sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
834 sFilterConfig.FilterIdHigh = 0x0000;
835 sFilterConfig.FilterIdLow = 0x0000;
836 sFilterConfig.FilterMaskIdHigh = 0x0000;
837 sFilterConfig.FilterMaskIdLow = 0x0000;
838 sFilterConfig.FilterFIFOAssignment = CAN_RX_FIFO0;
839 sFilterConfig.FilterActivation = ENABLE;
840 sFilterConfig.SlaveStartFilterBank = 14;
841 HAL_CAN_ConfigFilter(&hcan2, &sFilterConfig);
842
843 // Stop CAN
844 HAL_CAN_Stop(&hcan2);
845 // Start CAN
846 if (HAL_CAN_Start(&hcan2) != HAL_OK) {
847 printf("CAN2 Start Error: ErrorCode = 0x%lX\r\n", hcan2.ErrorCode);
848 }
849
850 // Start IRQ for CAN Rx
851 if (HAL_CAN_ActivateNotification(&hcan2, CAN_IT_RX_FIFO0_MSG_PENDING) != HAL_OK) {
852 printf("interrupt CAN2 init failed\r\n");
853 }
854 /* USER CODE END CAN2_Init 2 */
855
856}
CAN_HandleTypeDef hcan2
Definition: main.c:69
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_CAN3_Init()

static void MX_CAN3_Init ( void  )
static

CAN3 Initialization Function.

Parameters
None
Return values
None

Definition at line 863 of file main.c.

864{
865
866 /* USER CODE BEGIN CAN3_Init 0 */
867
868 /* USER CODE END CAN3_Init 0 */
869
870 /* USER CODE BEGIN CAN3_Init 1 */
871
872 /* USER CODE END CAN3_Init 1 */
873 hcan3.Instance = CAN3;
874 hcan3.Init.Prescaler = 16;
875 hcan3.Init.Mode = CAN_MODE_NORMAL;
876 hcan3.Init.SyncJumpWidth = CAN_SJW_1TQ;
877 hcan3.Init.TimeSeg1 = CAN_BS1_1TQ;
878 hcan3.Init.TimeSeg2 = CAN_BS2_1TQ;
879 hcan3.Init.TimeTriggeredMode = DISABLE;
880 hcan3.Init.AutoBusOff = DISABLE;
881 hcan3.Init.AutoWakeUp = DISABLE;
882 hcan3.Init.AutoRetransmission = DISABLE;
883 hcan3.Init.ReceiveFifoLocked = DISABLE;
884 hcan3.Init.TransmitFifoPriority = DISABLE;
885 if (HAL_CAN_Init(&hcan3) != HAL_OK)
886 {
888 }
889 /* USER CODE BEGIN CAN3_Init 2 */
890
891 /* USER CODE END CAN3_Init 2 */
892
893}
CAN_HandleTypeDef hcan3
Definition: main.c:70
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_DAC_Init()

static void MX_DAC_Init ( void  )
static

DAC Initialization Function.

Parameters
None
Return values
None

DAC Initialization

DAC channel OUT1 config

DAC channel OUT2 config

Definition at line 900 of file main.c.

901{
902
903 /* USER CODE BEGIN DAC_Init 0 */
904
905 /* USER CODE END DAC_Init 0 */
906
907 DAC_ChannelConfTypeDef sConfig = {0};
908
909 /* USER CODE BEGIN DAC_Init 1 */
910
911 /* USER CODE END DAC_Init 1 */
912
915 hdac.Instance = DAC;
916 if (HAL_DAC_Init(&hdac) != HAL_OK)
917 {
919 }
920
923 sConfig.DAC_Trigger = DAC_TRIGGER_T2_TRGO;
924 sConfig.DAC_OutputBuffer = DAC_OUTPUTBUFFER_ENABLE;
925 if (HAL_DAC_ConfigChannel(&hdac, &sConfig, DAC_CHANNEL_1) != HAL_OK)
926 {
928 }
929
932 if (HAL_DAC_ConfigChannel(&hdac, &sConfig, DAC_CHANNEL_2) != HAL_OK)
933 {
935 }
936 /* USER CODE BEGIN DAC_Init 2 */
937
938 /* USER CODE END DAC_Init 2 */
939
940}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_DMA_Init()

static void MX_DMA_Init ( void  )
static

Enable DMA controller clock

Definition at line 1250 of file main.c.

1251{
1252
1253 /* DMA controller clock enable */
1254 __HAL_RCC_DMA2_CLK_ENABLE();
1255 __HAL_RCC_DMA1_CLK_ENABLE();
1256
1257 /* DMA interrupt init */
1258 /* DMA1_Stream5_IRQn interrupt configuration */
1259 HAL_NVIC_SetPriority(DMA1_Stream5_IRQn, 5, 0);
1260 HAL_NVIC_EnableIRQ(DMA1_Stream5_IRQn);
1261 /* DMA1_Stream6_IRQn interrupt configuration */
1262 HAL_NVIC_SetPriority(DMA1_Stream6_IRQn, 5, 0);
1263 HAL_NVIC_EnableIRQ(DMA1_Stream6_IRQn);
1264 /* DMA2_Stream0_IRQn interrupt configuration */
1265 HAL_NVIC_SetPriority(DMA2_Stream0_IRQn, 5, 0);
1266 HAL_NVIC_EnableIRQ(DMA2_Stream0_IRQn);
1267 /* DMA2_Stream1_IRQn interrupt configuration */
1268 HAL_NVIC_SetPriority(DMA2_Stream1_IRQn, 5, 0);
1269 HAL_NVIC_EnableIRQ(DMA2_Stream1_IRQn);
1270 /* DMA2_Stream2_IRQn interrupt configuration */
1271 HAL_NVIC_SetPriority(DMA2_Stream2_IRQn, 5, 0);
1272 HAL_NVIC_EnableIRQ(DMA2_Stream2_IRQn);
1273
1274}
Here is the caller graph for this function:

◆ MX_GPIO_Init()

static void MX_GPIO_Init ( void  )
static

GPIO Initialization Function.

Parameters
None
Return values
None

Definition at line 1281 of file main.c.

1282{
1283 GPIO_InitTypeDef GPIO_InitStruct = {0};
1284/* USER CODE BEGIN MX_GPIO_Init_1 */
1285/* USER CODE END MX_GPIO_Init_1 */
1286
1287 /* GPIO Ports Clock Enable */
1288 __HAL_RCC_GPIOE_CLK_ENABLE();
1289 __HAL_RCC_GPIOC_CLK_ENABLE();
1290 __HAL_RCC_GPIOF_CLK_ENABLE();
1291 __HAL_RCC_GPIOH_CLK_ENABLE();
1292 __HAL_RCC_GPIOA_CLK_ENABLE();
1293 __HAL_RCC_GPIOB_CLK_ENABLE();
1294 __HAL_RCC_GPIOG_CLK_ENABLE();
1295 __HAL_RCC_GPIOD_CLK_ENABLE();
1296
1297 /*Configure GPIO pin Output Level */
1298 HAL_GPIO_WritePin(GPIOF, GPIO_PIN_12|GPIO_PIN_13, GPIO_PIN_RESET);
1299
1300 /*Configure GPIO pin Output Level */
1301 HAL_GPIO_WritePin(GPIOE, GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_11
1302 |GPIO_PIN_13, GPIO_PIN_RESET);
1303
1304 /*Configure GPIO pin Output Level */
1305 HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14|GPIO_PIN_15, GPIO_PIN_RESET);
1306
1307 /*Configure GPIO pin Output Level */
1308 HAL_GPIO_WritePin(GPIOG, GPIO_PIN_9, GPIO_PIN_RESET);
1309
1310 /*Configure GPIO pin Output Level */
1311 HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET);
1312
1313 /*Configure GPIO pins : PE3 PE4 PE10 PE12
1314 PE14 PE15 PE0 PE1 */
1315 GPIO_InitStruct.Pin = GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_10|GPIO_PIN_12
1316 |GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1;
1317 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
1318 GPIO_InitStruct.Pull = GPIO_NOPULL;
1319 HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
1320
1321 /*Configure GPIO pin : USER_Btn_Pin */
1322 GPIO_InitStruct.Pin = USER_Btn_Pin;
1323 GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
1324 GPIO_InitStruct.Pull = GPIO_NOPULL;
1325 HAL_GPIO_Init(USER_Btn_GPIO_Port, &GPIO_InitStruct);
1326
1327 /*Configure GPIO pins : PF2 PF11 */
1328 GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_11;
1329 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
1330 GPIO_InitStruct.Pull = GPIO_NOPULL;
1331 HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
1332
1333 /*Configure GPIO pins : PB2 PB10 PB11 PB12
1334 PB14 PB15 PB4 PB6 */
1335 GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12
1336 |GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_4|GPIO_PIN_6;
1337 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
1338 GPIO_InitStruct.Pull = GPIO_NOPULL;
1339 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
1340
1341 /*Configure GPIO pins : PF12 PF13 */
1342 GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13;
1343 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
1344 GPIO_InitStruct.Pull = GPIO_NOPULL;
1345 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
1346 HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
1347
1348 /*Configure GPIO pins : PG0 PG1 PG2 PG3
1349 PG4 PG5 PG6 PG8
1350 PG10 PG11 PG15 */
1351 GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
1352 |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_8
1353 |GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_15;
1354 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
1355 GPIO_InitStruct.Pull = GPIO_NOPULL;
1356 HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
1357
1358 /*Configure GPIO pins : PE7 PE8 PE9 PE11
1359 PE13 */
1360 GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_11
1361 |GPIO_PIN_13;
1362 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
1363 GPIO_InitStruct.Pull = GPIO_NOPULL;
1364 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
1365 HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
1366
1367 /*Configure GPIO pins : PD10 PD11 PD12 PD13
1368 PD3 PD4 PD5 PD6
1369 PD7 */
1370 GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13
1371 |GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6
1372 |GPIO_PIN_7;
1373 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
1374 GPIO_InitStruct.Pull = GPIO_NOPULL;
1375 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
1376
1377 /*Configure GPIO pins : PD14 PD15 */
1378 GPIO_InitStruct.Pin = GPIO_PIN_14|GPIO_PIN_15;
1379 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
1380 GPIO_InitStruct.Pull = GPIO_NOPULL;
1381 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
1382 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
1383
1384 /*Configure GPIO pin : USB_OverCurrent_Pin */
1385 GPIO_InitStruct.Pin = USB_OverCurrent_Pin;
1386 GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
1387 GPIO_InitStruct.Pull = GPIO_NOPULL;
1388 HAL_GPIO_Init(USB_OverCurrent_GPIO_Port, &GPIO_InitStruct);
1389
1390 /*Configure GPIO pins : PC6 PC7 PC8 PC9
1391 PC10 PC11 PC12 */
1392 GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9
1393 |GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12;
1394 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
1395 GPIO_InitStruct.Pull = GPIO_NOPULL;
1396 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
1397 GPIO_InitStruct.Alternate = GPIO_AF12_SDMMC1;
1398 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
1399
1400 /*Configure GPIO pins : PA9 PA10 PA11 PA12 */
1401 GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12;
1402 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
1403 GPIO_InitStruct.Pull = GPIO_NOPULL;
1404 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
1405
1406 /*Configure GPIO pin : PD2 */
1407 GPIO_InitStruct.Pin = GPIO_PIN_2;
1408 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
1409 GPIO_InitStruct.Pull = GPIO_NOPULL;
1410 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
1411 GPIO_InitStruct.Alternate = GPIO_AF12_SDMMC1;
1412 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
1413
1414 /*Configure GPIO pin : PG9 */
1415 GPIO_InitStruct.Pin = GPIO_PIN_9;
1416 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
1417 GPIO_InitStruct.Pull = GPIO_NOPULL;
1418 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
1419 HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
1420
1421 /*Configure GPIO pin : LD2_Pin */
1422 GPIO_InitStruct.Pin = LD2_Pin;
1423 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
1424 GPIO_InitStruct.Pull = GPIO_NOPULL;
1425 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
1426 HAL_GPIO_Init(LD2_GPIO_Port, &GPIO_InitStruct);
1427
1428 /*Configure GPIO pins : PB8 PB9 */
1429 GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9;
1430 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
1431 GPIO_InitStruct.Pull = GPIO_NOPULL;
1432 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
1433 GPIO_InitStruct.Alternate = GPIO_AF12_SDMMC1;
1434 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
1435
1436/* USER CODE BEGIN MX_GPIO_Init_2 */
1437/* USER CODE END MX_GPIO_Init_2 */
1438}
#define USB_OverCurrent_GPIO_Port
Definition: main.h:73
#define LD2_GPIO_Port
Definition: main.h:79
#define USB_OverCurrent_Pin
Definition: main.h:72
#define USER_Btn_Pin
Definition: main.h:64
#define USER_Btn_GPIO_Port
Definition: main.h:65
#define LD2_Pin
Definition: main.h:78
Here is the caller graph for this function:

◆ MX_I2C2_Init()

static void MX_I2C2_Init ( void  )
static

I2C2 Initialization Function.

Parameters
None
Return values
None

Configure Analogue filter

Configure Digital filter

Definition at line 947 of file main.c.

948{
949
950 /* USER CODE BEGIN I2C2_Init 0 */
951
952 /* USER CODE END I2C2_Init 0 */
953
954 /* USER CODE BEGIN I2C2_Init 1 */
955
956 /* USER CODE END I2C2_Init 1 */
957 hi2c2.Instance = I2C2;
958 hi2c2.Init.Timing = 0x00506682;
959 hi2c2.Init.OwnAddress1 = 0;
960 hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
961 hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
962 hi2c2.Init.OwnAddress2 = 0;
963 hi2c2.Init.OwnAddress2Masks = I2C_OA2_NOMASK;
964 hi2c2.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
965 hi2c2.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
966 if (HAL_I2C_Init(&hi2c2) != HAL_OK)
967 {
969 }
970
973 if (HAL_I2CEx_ConfigAnalogFilter(&hi2c2, I2C_ANALOGFILTER_ENABLE) != HAL_OK)
974 {
976 }
977
980 if (HAL_I2CEx_ConfigDigitalFilter(&hi2c2, 0) != HAL_OK)
981 {
983 }
984 /* USER CODE BEGIN I2C2_Init 2 */
985
986 /* USER CODE END I2C2_Init 2 */
987
988}
I2C_HandleTypeDef hi2c2
Definition: main.c:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_I2C4_Init()

static void MX_I2C4_Init ( void  )
static

I2C4 Initialization Function.

Parameters
None
Return values
None

Configure Analogue filter

Configure Digital filter

Definition at line 995 of file main.c.

996{
997
998 /* USER CODE BEGIN I2C4_Init 0 */
999
1000 /* USER CODE END I2C4_Init 0 */
1001
1002 /* USER CODE BEGIN I2C4_Init 1 */
1003
1004 /* USER CODE END I2C4_Init 1 */
1005 hi2c4.Instance = I2C4;
1006 hi2c4.Init.Timing = 0x00506682;
1007 hi2c4.Init.OwnAddress1 = 0;
1008 hi2c4.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
1009 hi2c4.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
1010 hi2c4.Init.OwnAddress2 = 0;
1011 hi2c4.Init.OwnAddress2Masks = I2C_OA2_NOMASK;
1012 hi2c4.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
1013 hi2c4.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
1014 if (HAL_I2C_Init(&hi2c4) != HAL_OK)
1015 {
1016 Error_Handler();
1017 }
1018
1021 if (HAL_I2CEx_ConfigAnalogFilter(&hi2c4, I2C_ANALOGFILTER_ENABLE) != HAL_OK)
1022 {
1023 Error_Handler();
1024 }
1025
1028 if (HAL_I2CEx_ConfigDigitalFilter(&hi2c4, 0) != HAL_OK)
1029 {
1030 Error_Handler();
1031 }
1032 /* USER CODE BEGIN I2C4_Init 2 */
1033
1034 /* USER CODE END I2C4_Init 2 */
1035
1036}
I2C_HandleTypeDef hi2c4
Definition: main.c:77
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_SPI4_Init()

static void MX_SPI4_Init ( void  )
static

SPI4 Initialization Function.

Parameters
None
Return values
None

Definition at line 1043 of file main.c.

1044{
1045
1046 /* USER CODE BEGIN SPI4_Init 0 */
1047
1048 /* USER CODE END SPI4_Init 0 */
1049
1050 /* USER CODE BEGIN SPI4_Init 1 */
1051
1052 /* USER CODE END SPI4_Init 1 */
1053 /* SPI4 parameter configuration*/
1054 hspi4.Instance = SPI4;
1055 hspi4.Init.Mode = SPI_MODE_MASTER;
1056 hspi4.Init.Direction = SPI_DIRECTION_2LINES;
1057 hspi4.Init.DataSize = SPI_DATASIZE_4BIT;
1058 hspi4.Init.CLKPolarity = SPI_POLARITY_LOW;
1059 hspi4.Init.CLKPhase = SPI_PHASE_1EDGE;
1060 hspi4.Init.NSS = SPI_NSS_SOFT;
1061 hspi4.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2;
1062 hspi4.Init.FirstBit = SPI_FIRSTBIT_MSB;
1063 hspi4.Init.TIMode = SPI_TIMODE_DISABLE;
1064 hspi4.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
1065 hspi4.Init.CRCPolynomial = 7;
1066 hspi4.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE;
1067 hspi4.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;
1068 if (HAL_SPI_Init(&hspi4) != HAL_OK)
1069 {
1070 Error_Handler();
1071 }
1072 /* USER CODE BEGIN SPI4_Init 2 */
1073
1074 /* USER CODE END SPI4_Init 2 */
1075
1076}
SPI_HandleTypeDef hspi4
Definition: main.c:79
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_SPI6_Init()

static void MX_SPI6_Init ( void  )
static

SPI6 Initialization Function.

Parameters
None
Return values
None

Definition at line 1083 of file main.c.

1084{
1085
1086 /* USER CODE BEGIN SPI6_Init 0 */
1087
1088 /* USER CODE END SPI6_Init 0 */
1089
1090 /* USER CODE BEGIN SPI6_Init 1 */
1091
1092 /* USER CODE END SPI6_Init 1 */
1093 /* SPI6 parameter configuration*/
1094 hspi6.Instance = SPI6;
1095 hspi6.Init.Mode = SPI_MODE_MASTER;
1096 hspi6.Init.Direction = SPI_DIRECTION_2LINES;
1097 hspi6.Init.DataSize = SPI_DATASIZE_4BIT;
1098 hspi6.Init.CLKPolarity = SPI_POLARITY_LOW;
1099 hspi6.Init.CLKPhase = SPI_PHASE_1EDGE;
1100 hspi6.Init.NSS = SPI_NSS_SOFT;
1101 hspi6.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2;
1102 hspi6.Init.FirstBit = SPI_FIRSTBIT_MSB;
1103 hspi6.Init.TIMode = SPI_TIMODE_DISABLE;
1104 hspi6.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
1105 hspi6.Init.CRCPolynomial = 7;
1106 hspi6.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE;
1107 hspi6.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;
1108 if (HAL_SPI_Init(&hspi6) != HAL_OK)
1109 {
1110 Error_Handler();
1111 }
1112 /* USER CODE BEGIN SPI6_Init 2 */
1113
1114 /* USER CODE END SPI6_Init 2 */
1115
1116}
SPI_HandleTypeDef hspi6
Definition: main.c:80
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_TIM1_Init()

static void MX_TIM1_Init ( void  )
static

TIM1 Initialization Function.

Parameters
None
Return values
None

Definition at line 1123 of file main.c.

1124{
1125
1126 /* USER CODE BEGIN TIM1_Init 0 */
1127
1128 /* USER CODE END TIM1_Init 0 */
1129
1130 TIM_ClockConfigTypeDef sClockSourceConfig = {0};
1131 TIM_MasterConfigTypeDef sMasterConfig = {0};
1132
1133 /* USER CODE BEGIN TIM1_Init 1 */
1134
1135 /* USER CODE END TIM1_Init 1 */
1136 htim1.Instance = TIM1;
1137 htim1.Init.Prescaler = 47999;
1138 htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
1139 htim1.Init.Period = 999;
1140 htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
1141 htim1.Init.RepetitionCounter = 0;
1142 htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
1143 if (HAL_TIM_Base_Init(&htim1) != HAL_OK)
1144 {
1145 Error_Handler();
1146 }
1147 sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
1148 if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK)
1149 {
1150 Error_Handler();
1151 }
1152 sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
1153 sMasterConfig.MasterOutputTrigger2 = TIM_TRGO2_RESET;
1154 sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
1155 if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK)
1156 {
1157 Error_Handler();
1158 }
1159 /* USER CODE BEGIN TIM1_Init 2 */
1160
1161 /* USER CODE END TIM1_Init 2 */
1162
1163}
TIM_HandleTypeDef htim1
Definition: main.c:82
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_TIM2_Init()

static void MX_TIM2_Init ( void  )
static

TIM2 Initialization Function.

Parameters
None
Return values
None

Definition at line 1170 of file main.c.

1171{
1172
1173 /* USER CODE BEGIN TIM2_Init 0 */
1174
1175 /* USER CODE END TIM2_Init 0 */
1176
1177 TIM_ClockConfigTypeDef sClockSourceConfig = {0};
1178 TIM_MasterConfigTypeDef sMasterConfig = {0};
1179
1180 /* USER CODE BEGIN TIM2_Init 1 */
1181
1182 /* USER CODE END TIM2_Init 1 */
1183 htim2.Instance = TIM2;
1184 htim2.Init.Prescaler = 0;
1185 htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
1186 htim2.Init.Period = 479999;
1187 htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
1188 htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
1189 if (HAL_TIM_Base_Init(&htim2) != HAL_OK)
1190 {
1191 Error_Handler();
1192 }
1193 sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
1194 if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK)
1195 {
1196 Error_Handler();
1197 }
1198 sMasterConfig.MasterOutputTrigger = TIM_TRGO_UPDATE;
1199 sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
1200 if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK)
1201 {
1202 Error_Handler();
1203 }
1204 /* USER CODE BEGIN TIM2_Init 2 */
1205 if (HAL_TIM_Base_Start_IT(&htim2) != HAL_OK) {
1206 Error_Handler();
1207 }
1208 /* USER CODE END TIM2_Init 2 */
1209
1210}
TIM_HandleTypeDef htim2
Definition: main.c:83
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_USART3_UART_Init()

static void MX_USART3_UART_Init ( void  )
static

USART3 Initialization Function.

Parameters
None
Return values
None

Definition at line 1217 of file main.c.

1218{
1219
1220 /* USER CODE BEGIN USART3_Init 0 */
1221
1222 /* USER CODE END USART3_Init 0 */
1223
1224 /* USER CODE BEGIN USART3_Init 1 */
1225
1226 /* USER CODE END USART3_Init 1 */
1227 huart3.Instance = USART3;
1228 huart3.Init.BaudRate = 115200;
1229 huart3.Init.WordLength = UART_WORDLENGTH_8B;
1230 huart3.Init.StopBits = UART_STOPBITS_1;
1231 huart3.Init.Parity = UART_PARITY_NONE;
1232 huart3.Init.Mode = UART_MODE_TX_RX;
1233 huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE;
1234 huart3.Init.OverSampling = UART_OVERSAMPLING_16;
1235 huart3.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
1236 huart3.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
1237 if (HAL_UART_Init(&huart3) != HAL_OK)
1238 {
1239 Error_Handler();
1240 }
1241 /* USER CODE BEGIN USART3_Init 2 */
1242
1243 /* USER CODE END USART3_Init 2 */
1244
1245}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartDefaultTask()

void StartDefaultTask ( void *  argument)

Function implementing the defaultTask thread.

Parameters
argumentNot used
Return values
None

Definition at line 1481 of file main.c.

1482{
1483 /* USER CODE BEGIN 5 */
1484 /* Infinite loop */
1485 for(;;)
1486 {
1487 osDelay(1);
1488 }
1489 /* USER CODE END 5 */
1490}
Here is the caller graph for this function:

◆ SystemClock_Config()

void SystemClock_Config ( void  )

System Clock Configuration.

Return values
None

Configure LSE Drive Capability

Configure the main internal regulator output voltage

Initializes the RCC Oscillators according to the specified parameters in the RCC_OscInitTypeDef structure.

Initializes the CPU, AHB and APB buses clocks

Definition at line 366 of file main.c.

367{
368 RCC_OscInitTypeDef RCC_OscInitStruct = {0};
369 RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
370
373 HAL_PWR_EnableBkUpAccess();
374
377 __HAL_RCC_PWR_CLK_ENABLE();
378 __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);
379
383 RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
384 RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;
385 RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
386 RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
387 RCC_OscInitStruct.PLL.PLLM = 4;
388 RCC_OscInitStruct.PLL.PLLN = 96;
389 RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
390 RCC_OscInitStruct.PLL.PLLQ = 4;
391 RCC_OscInitStruct.PLL.PLLR = 2;
392 if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
393 {
395 }
396
399 RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
400 |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
401 RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
402 RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
403 RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
404 RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
405
406 if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
407 {
409 }
410}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vApplicationIdleHook()

void vApplicationIdleHook ( void  )

Definition at line 1458 of file main.c.

1458 {
1459 // Called when no tasks are running
1460 // Can enter low power mode here
1461}

◆ vApplicationMallocFailedHook()

void vApplicationMallocFailedHook ( void  )

Definition at line 1453 of file main.c.

1453 {
1454 printf("ERROR: FreeRTOS malloc failed!\n");
1455 for(;;);
1456}

◆ vApplicationStackOverflowHook()

void vApplicationStackOverflowHook ( TaskHandle_t  xTask,
char *  pcTaskName 
)

Definition at line 1463 of file main.c.

1463 {
1464 printf("ERROR: Stack overflow in task: %s\n", pcTaskName);
1465 for(;;);
1466}

◆ vApplicationTickHook()

void vApplicationTickHook ( void  )

Definition at line 1468 of file main.c.

1468 {
1469 // Called on each FreeRTOS tick (optional)
1470 // Keep this very short and fast
1471}

Variable Documentation

◆ adc1_buffer

uint32_t adc1_buffer[ADC1_CHANNEL_SIZE]

Definition at line 123 of file main.c.

◆ adc2_buffer

uint32_t adc2_buffer[ADC2_CHANNEL_SIZE]

Definition at line 124 of file main.c.

◆ adc3_buffer

uint32_t adc3_buffer[ADC3_CHANNEL_SIZE]

Definition at line 125 of file main.c.

◆ dac1_buffer

uint32_t dac1_buffer[DAC1_BUFFER_SIZE]

Definition at line 126 of file main.c.

◆ dac2_buffer

uint32_t dac2_buffer[DAC2_BUFFER_SIZE]

Definition at line 127 of file main.c.

◆ defaultTask_attributes

const osThreadAttr_t defaultTask_attributes
Initial value:
= {
.name = "defaultTask",
.stack_size = 128 * 4,
.priority = (osPriority_t) osPriorityNormal,
}

Definition at line 89 of file main.c.

◆ defaultTaskHandle

osThreadId_t defaultTaskHandle

Definition at line 88 of file main.c.

◆ digital_in_buffer

uint8_t digital_in_buffer[NUM_DIGITAL_INPUTS]

Definition at line 129 of file main.c.

◆ digital_out_buffer

uint8_t digital_out_buffer[NUM_DIGITAL_OUTPUTS]

Definition at line 128 of file main.c.

◆ hadc1

ADC_HandleTypeDef hadc1

Definition at line 61 of file main.c.

◆ hadc2

ADC_HandleTypeDef hadc2

Definition at line 62 of file main.c.

◆ hadc3

ADC_HandleTypeDef hadc3

Definition at line 63 of file main.c.

◆ hcan1

CAN_HandleTypeDef hcan1

Definition at line 68 of file main.c.

◆ hcan2

CAN_HandleTypeDef hcan2

Definition at line 69 of file main.c.

◆ hcan3

CAN_HandleTypeDef hcan3

Definition at line 70 of file main.c.

◆ hdac

DAC_HandleTypeDef hdac

Definition at line 72 of file main.c.

◆ hdma_adc1

DMA_HandleTypeDef hdma_adc1

Definition at line 64 of file main.c.

◆ hdma_adc2

DMA_HandleTypeDef hdma_adc2

Definition at line 65 of file main.c.

◆ hdma_adc3

DMA_HandleTypeDef hdma_adc3

Definition at line 66 of file main.c.

◆ hdma_dac1

DMA_HandleTypeDef hdma_dac1

Definition at line 73 of file main.c.

◆ hdma_dac2

DMA_HandleTypeDef hdma_dac2

Definition at line 74 of file main.c.

◆ hi2c2

I2C_HandleTypeDef hi2c2

Definition at line 76 of file main.c.

◆ hi2c4

I2C_HandleTypeDef hi2c4

Definition at line 77 of file main.c.

◆ hspi4

SPI_HandleTypeDef hspi4

Definition at line 79 of file main.c.

◆ hspi6

SPI_HandleTypeDef hspi6

Definition at line 80 of file main.c.

◆ htim1

TIM_HandleTypeDef htim1

Definition at line 82 of file main.c.

◆ htim2

TIM_HandleTypeDef htim2

Definition at line 83 of file main.c.

◆ huart3

UART_HandleTypeDef huart3

Definition at line 85 of file main.c.