steering-wheel-stm/Core/Inc/vehicle.h

25 lines
570 B
C

#ifndef __VEHICLE_H
#define __VEHICLE_H
#include "state.h"
#include "stm32g4xx_hal.h"
#include "stm32g4xx_hal_def.h"
#include "stm32g4xx_hal_fdcan.h"
#define CAN_ID_MISSION_SELECT 0x400
#define CAN_ID_BUTTONS 0x401
#define CAN_ID_AS_MISSION_FB 0x410
#define CAN_BUTTONS_LEFT (1 << 0)
#define CAN_BUTTONS_RIGHT (1 << 1)
#define CAN_BUTTONS_R2D (1 << 2)
#define CAN_BUTTONS_ENTER (1 << 3)
void vehicle_init(FDCAN_HandleTypeDef* handle);
HAL_StatusTypeDef vehicle_send_mission_select(Mission mission);
HAL_StatusTypeDef vehicle_send_buttons();
#endif // __VEHICLE_H