2022-05-29 00:20:28 +02:00
|
|
|
#ifndef __VEHICLE_H
|
|
|
|
#define __VEHICLE_H
|
|
|
|
|
|
|
|
#include "state.h"
|
2022-05-29 00:47:46 +02:00
|
|
|
|
2022-05-29 00:20:28 +02:00
|
|
|
#include "stm32g4xx_hal.h"
|
2022-08-17 08:48:09 +02:00
|
|
|
#include "stm32g4xx_hal_def.h"
|
2022-05-29 00:20:28 +02:00
|
|
|
#include "stm32g4xx_hal_fdcan.h"
|
|
|
|
|
|
|
|
#define CAN_ID_MISSION_SELECT 0x400
|
2022-08-17 08:48:09 +02:00
|
|
|
#define CAN_ID_BUTTONS 0x401
|
2022-05-29 00:20:28 +02:00
|
|
|
#define CAN_ID_AS_MISSION_FB 0x410
|
|
|
|
|
2022-08-17 08:48:09 +02:00
|
|
|
#define CAN_BUTTONS_LEFT (1 << 0)
|
|
|
|
#define CAN_BUTTONS_RIGHT (1 << 1)
|
|
|
|
#define CAN_BUTTONS_R2D (1 << 2)
|
|
|
|
#define CAN_BUTTONS_ENTER (1 << 3)
|
|
|
|
|
2022-05-29 00:47:46 +02:00
|
|
|
void vehicle_init(FDCAN_HandleTypeDef* handle);
|
2022-05-29 00:20:28 +02:00
|
|
|
|
2022-08-17 08:48:09 +02:00
|
|
|
HAL_StatusTypeDef vehicle_send_mission_select(Mission mission);
|
|
|
|
HAL_StatusTypeDef vehicle_send_buttons();
|
2022-05-29 00:20:28 +02:00
|
|
|
|
2022-05-29 00:47:46 +02:00
|
|
|
#endif // __VEHICLE_H
|