Go to the source code of this file.
|
void | comm_can_init (void) |
|
void | comm_can_transmit (uint32_t id, uint8_t *data, uint8_t len) |
|
void | comm_can_send_buffer (uint8_t controller_id, uint8_t *data, unsigned int len, bool send) |
|
void | comm_can_set_duty (uint8_t controller_id, float duty) |
|
void | comm_can_set_current (uint8_t controller_id, float current) |
|
void | comm_can_set_current_brake (uint8_t controller_id, float current) |
|
void | comm_can_set_rpm (uint8_t controller_id, float rpm) |
|
void | comm_can_set_pos (uint8_t controller_id, float pos) |
|
can_status_msg * | comm_can_get_status_msg_index (int index) |
|
can_status_msg * | comm_can_get_status_msg_id (int id) |
|
#define CAN_STATUS_MSG_INT_MS 1 |
#define CAN_STATUS_MSGS_TO_STORE 10 |
Get status message by id.
- Parameters
-
id | Id of the controller that sent the status message. |
- Returns
- The message or 0 for an invalid id.
Get status message by index.
- Parameters
-
- Returns
- The message or 0 for an invalid index.
void comm_can_init |
( |
void |
| ) |
|
void comm_can_send_buffer |
( |
uint8_t |
controller_id, |
|
|
uint8_t * |
data, |
|
|
unsigned int |
len, |
|
|
bool |
send |
|
) |
| |
Send a buffer up to RX_BUFFER_SIZE bytes as fragments. If the buffer is 6 bytes or less it will be sent in a single CAN frame, otherwise it will be split into several frames.
- Parameters
-
controller_id | The controller id to send to. |
data | The payload. |
len | The payload length. |
send | If true, this packet will be passed to the send function of commands. Otherwise, it will be passed to the process function. |
void comm_can_set_current |
( |
uint8_t |
controller_id, |
|
|
float |
current |
|
) |
| |
void comm_can_set_current_brake |
( |
uint8_t |
controller_id, |
|
|
float |
current |
|
) |
| |
void comm_can_set_duty |
( |
uint8_t |
controller_id, |
|
|
float |
duty |
|
) |
| |
void comm_can_set_pos |
( |
uint8_t |
controller_id, |
|
|
float |
pos |
|
) |
| |
void comm_can_set_rpm |
( |
uint8_t |
controller_id, |
|
|
float |
rpm |
|
) |
| |
void comm_can_transmit |
( |
uint32_t |
id, |
|
|
uint8_t * |
data, |
|
|
uint8_t |
len |
|
) |
| |