U.B.O.R
The [U]seless [B]ox [O]rganizing [R]obot. A FreeRTOS study project written in C which implements a multitasked control unit for a belt conveyor system with robotic sorting arms.
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Data Structures | Macros | Typedefs | Functions
ubor CAN

Utility to send and receive CAN messages. More...

Data Structures

struct  msg_link_s
 This datatype combines a message queue its id and a mask for filtering. More...
 

Macros

#define SIZE_MAP   100
 
#define QUEUE_SIZE   10
 
#define STACKSIZE_TASK   256
 
#define PRIORITY_TASK   2
 

Typedefs

typedef struct msg_link_s msg_link_t
 This datatype combines a message queue its id and a mask for filtering. More...
 

Functions

bool ucan_link_message_to_queue_mask (uint16_t mask, uint16_t message_id, QueueHandle_t queue)
 Set a message mask to map multiple message to a queue global. More...
 
bool ucan_link_message_to_queue (uint16_t message_id, QueueHandle_t queue)
 Link a single message type to a queue global. More...
 
bool ucan_init (void)
 Initialize the hardware and call each init function global. More...
 
bool ucan_send_data (uint8_t n_data_bytes, uint16_t msg_id, const uint8_t *data)
 Send data to the can output message queue global. More...
 

Detailed Description

Utility to send and receive CAN messages.

Macro Definition Documentation

◆ PRIORITY_TASK

#define PRIORITY_TASK   2

Definition at line 31 of file ucan.c.

◆ QUEUE_SIZE

#define QUEUE_SIZE   10

Definition at line 29 of file ucan.c.

◆ SIZE_MAP

#define SIZE_MAP   100

Definition at line 28 of file ucan.c.

◆ STACKSIZE_TASK

#define STACKSIZE_TASK   256

Definition at line 30 of file ucan.c.

Typedef Documentation

◆ msg_link_t

typedef struct msg_link_s msg_link_t

This datatype combines a message queue its id and a mask for filtering.

Function Documentation

◆ ucan_init()

bool ucan_init ( void  )

Initialize the hardware and call each init function global.

Returns
True if successful

Definition at line 212 of file ucan.c.

Here is the caller graph for this function:

◆ ucan_link_message_to_queue()

bool ucan_link_message_to_queue ( uint16_t  message_id,
QueueHandle_t  queue 
)

Link a single message type to a queue global.

Parameters
[in]message_idUnique integer which serves as id for the queue
[in]queueFreeRTOS message queue
Returns
True if successful false if there is not enough space left

Definition at line 202 of file ucan.c.

Here is the call graph for this function:

◆ ucan_link_message_to_queue_mask()

bool ucan_link_message_to_queue_mask ( uint16_t  mask,
uint16_t  message_id,
QueueHandle_t  queue 
)

Set a message mask to map multiple message to a queue global.

Parameters
[in]maskBinary mask for filtering
[in]message_idUnique integer which serves as id for the queue
[in]queueFreeRTOS message queue
Returns
True if successful false if there is not enough space left

Definition at line 178 of file ucan.c.

Here is the caller graph for this function:

◆ ucan_send_data()

bool ucan_send_data ( uint8_t  n_data_bytes,
uint16_t  msg_id,
const uint8_t *  data 
)

Send data to the can output message queue global.

Parameters
[in]message_idUnique integer which serves as id for the queue
[in]n_data_bytesSize of the payload in bytes
[in]*dataPayload data to transmit
Returns
True if successful

Definition at line 264 of file ucan.c.