PER Firmware
Loading...
Searching...
No Matches
main.c File Reference

"Torque Vector" node source code More...

#include "main.h"
#include "can_library/generated/TORQUE_VECTOR.h"
#include "common/rtos/rtos.h"
#include "common/heartbeat/heartbeat.h"
#include "common/phal_G4/fdcan/fdcan.h"
#include "common/phal_G4/gpio/gpio.h"
#include "common/phal_G4/rcc/rcc.h"
#include "common/phal_G4/usart/usart.h"
#include "common/phal_G4/pin_defs/g474ret6.h"
#include "common/utils/countof.h"
#include "common/watchdog/watchdog.h"
#include "control_loop.h"
#include "sensors.h"
#include "telemetry.h"
Include dependency graph for main.c:

Functions

void HardFault_Handler (void)
 
 DEFINE_CAN_TASKS ()
 
 RTOS_DEFINE_TASK (control_loop, CONTROL_LOOP_PERIOD_MS, TASK_PRIORITY_NORMAL, STACK_4096)
 
 RTOS_DEFINE_TASK (gps_periodic, GPS_THREAD_PERIOD_MS, TASK_PRIORITY_LOW, STACK_1024)
 
 RTOS_DEFINE_TASK (report_telemetry_25hz, TELEMETRY_25HZ_PERIOD_MS, TASK_PRIORITY_LOW, STACK_512)
 
 RTOS_DEFINE_TASK (report_telemetry_1hz, TELEMETRY_1HZ_PERIOD_MS, TASK_PRIORITY_LOW, STACK_512)
 
 DEFINE_WATCHDOG_TASK ()
 
 DEFINE_HEARTBEAT_TASK (nullptr)
 
int main (void)
 

Variables

PHAL_GPIO_InitConfig_t gpio_config []
 
static constexpr uint32_t GPS_BAUD_RATE = 460'800
 
static constexpr PHAL_USART_Idx_t GPS_USART = USART3_IDX
 

Detailed Description

"Torque Vector" node source code

Author
Irving Wang (irvin.nosp@m.gw@p.nosp@m.urdue.nosp@m..edu)

Function Documentation

◆ DEFINE_CAN_TASKS()

DEFINE_CAN_TASKS ( )

◆ DEFINE_HEARTBEAT_TASK()

DEFINE_HEARTBEAT_TASK ( nullptr )

◆ DEFINE_WATCHDOG_TASK()

DEFINE_WATCHDOG_TASK ( )

◆ HardFault_Handler()

void HardFault_Handler ( void )
extern

◆ main()

int main ( void )
Here is the call graph for this function:

◆ RTOS_DEFINE_TASK() [1/4]

◆ RTOS_DEFINE_TASK() [2/4]

◆ RTOS_DEFINE_TASK() [3/4]

◆ RTOS_DEFINE_TASK() [4/4]

Variable Documentation

◆ gpio_config

PHAL_GPIO_InitConfig_t gpio_config[]
Initial value:
= {
}
#define ERROR_LED_PIN
Definition main.h:20
#define HEARTBEAT_LED_PIN
Definition main.h:18
#define ERROR_LED_PORT
Definition main.h:19
#define CONNECTION_LED_PIN
Definition main.h:22
#define HEARTBEAT_LED_PORT
Definition main.h:17
#define CONNECTION_LED_PORT
Definition main.h:21
static const PHAL_GPIO_InitConfig_t PHAL_PIN_DEFS_FDCAN2_RX_PB12
Definition g474ret6.h:31
static const PHAL_GPIO_InitConfig_t PHAL_PIN_DEFS_FDCAN2_TX_PB13
Definition g474ret6.h:32
static const PHAL_GPIO_InitConfig_t PHAL_PIN_DEFS_USART3_RX_PB11
Definition g474ret6.h:70
static const PHAL_GPIO_InitConfig_t PHAL_PIN_DEFS_USART3_TX_PB10
Definition g474ret6.h:69
static const PHAL_GPIO_InitConfig_t PHAL_PIN_DEFS_USART1_RX_PA10
Definition g474ret6.h:52
static const PHAL_GPIO_InitConfig_t PHAL_PIN_DEFS_USART1_TX_PA9
Definition g474ret6.h:51
@ GPIO_OUTPUT_LOW_SPEED
Definition gpio.h:32
#define PHAL_GPIO_INIT_OUTPUT(gpio_bank, pin_num, ospeed_sel)
Construct PHAL_GPIO_InitConfig_t for an output (push-pull) pin.
Definition gpio.h:154
#define BASE_RESET_PIN
Definition main.h:29
#define BASE_RESET_PORT
Definition main.h:28
#define ROVER_RESET_PORT
Definition main.h:24
#define ROVER_RESET_PIN
Definition main.h:25

◆ GPS_BAUD_RATE

uint32_t GPS_BAUD_RATE = 460'800
staticconstexpr

◆ GPS_USART

PHAL_USART_Idx_t GPS_USART = USART3_IDX
staticconstexpr