Midnight Sun Firmware
Loading...
Searching...
No Matches
motor_can.h
1#pragma once
2
3/************************************************************************************************
4 * @file motor_can.h
5 *
6 * @brief Header file for motor can
7 *
8 * @date 2025-11-25
9 * @author Midnight Sun Team #24 - MSXVI
10 ************************************************************************************************/
11
12/* Standard library Headers */
13#include <stdint.h>
14
15/* Inter-component Headers */
16#include "can.h"
17#include "status.h"
18
19/* Intra-component Headers */
20#include "front_controller.h"
21#include "ws22_motor_can.h"
22
29#define VEL_TO_RPM_RATIO 0.57147 // from MSXV
30
38
46
51
52StatusCode motor_can_transmit_drive_command(void);
53
54StatusCode motor_can_process_rx(CanMessage *msg);
StatusCode motor_can_init(FrontControllerStorage *storage)
Initializes the motor can, loads front controller storage data.
Definition: motor_can.c:154
StatusCode motor_can_get_current_state(VehicleDriveState *current_state)
retrieve current vehicle drive state
Definition: motor_can.c:164
StatusCode motor_can_update_target_current_velocity()
Updates target current and velocity of motors based on drive state.
Definition: motor_can.c:88
VehicleDriveState
Vehicle drive states.
Definition: global_enums.h:32
StatusCode
StatusCodes for various errors.
Definition: status.h:27
CAN message structure.
Definition: can_msg.h:56
Front Controller storage.
Definition: front_controller.h:93