WS22 motor can library.
More...
|
|
typedef struct Ws22MotorCanStorage | Ws22MotorCanStorage |
| | WS22 motor CAN interface storage structure.
|
| |
WS22 motor can library.
◆ WS22_CAN_BASE_CONTROL
| #define WS22_CAN_BASE_CONTROL 0x500U |
Base address for control messages
◆ WS22_CAN_BASE_STATUS
| #define WS22_CAN_BASE_STATUS 0x80U |
Base address for status messages
◆ ws22_motor_can_get_control_data()
Get current motor control data.
- Returns
- Pointer to motor control data (read-only)
◆ ws22_motor_can_get_telemetry_data()
Get current motor telemetry data.
- Returns
- Pointer to motor telemetry data (read-only)
◆ ws22_motor_can_init()
Initialize the WS22 motor CAN interface.
- Parameters
-
| storage | Pointer to Front controller storage structure |
- Returns
- STATUS_CODE_OK on success, error code otherwise
◆ ws22_motor_can_process_rx()
| StatusCode ws22_motor_can_process_rx |
( |
uint8_t * |
msg_data_u8, |
|
|
uint32_t |
msg_id_raw, |
|
|
uint8_t |
msg_dlc |
|
) |
| |
Process received CAN message for motor controller.
- Parameters
-
| msg | Pointer to received CAN message |
- Returns
- STATUS_CODE_OK on success, STATUS_CODE_UNIMPLEMENTED for unknown message IDs
◆ ws22_motor_can_set_current()
| StatusCode ws22_motor_can_set_current |
( |
float |
current | ) |
|
Set motor control current command.
- Parameters
-
| current | Motor current command (0.0 to 1.0) |
- Returns
- STATUS_CODE_OK on success, STATUS_CODE_INVALID_ARGS if out of range
◆ ws22_motor_can_set_velocity()
| StatusCode ws22_motor_can_set_velocity |
( |
float |
velocity | ) |
|
Set motor control velocity command.
- Parameters
-
| velocity | Motor velocity command (rpm) |
- Returns
- STATUS_CODE_OK on success, STATUS_CODE_INVALID_ARGS if out of range