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.
ucan.h
Go to the documentation of this file.
1 #ifndef UCAN_H
2 #define UCAN_H
3 
4 /*----- Header-Files ---------------------------------------------------------*/
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <string.h>
8 #include <stdbool.h>
9 
10 #include <carme.h>
11 #include <can.h>
12 #include <stm32f4xx.h>
13 #include <FreeRTOS.h>
14 #include <queue.h>
15 #include <task.h>
16 #include <semphr.h>
17 
18 #include "display.h"
19 
20 /*----- Defines --------------------------------------------------------------*/
21 
22 #define UCAN_LOG_SENT 0
23 #define UCAN_LOG_SENDING 0
24 #define UCAN_LOG_RECEIVE 0
25 #define UCAN_LOG_DISPATCH 0
26 #define UCAN_LOG_DROP 0
27 
28 #define LOG_IF(cond,...) do{ if(cond) display_log(__VA_ARGS__); } while(false) // Write to log using loglevels
29 
30 /*----- Data types -----------------------------------------------------------*/
31 
32 /*----- Function prototypes --------------------------------------------------*/
33 bool ucan_init(void);
34 bool ucan_send_data(uint8_t n_data_bytes, uint16_t msg_id, const uint8_t *data);
35 bool ucan_link_message_to_queue(uint16_t message_id, QueueHandle_t queue);
36 bool ucan_link_message_to_queue_mask(uint16_t mask, uint16_t message_id, QueueHandle_t queue);
37 
38 #endif // UCAN_H
bool ucan_init(void)
Initialize the hardware and call each init function global.
Definition: ucan.c:212
bool ucan_link_message_to_queue(uint16_t message_id, QueueHandle_t queue)
Link a single message type to a queue global.
Definition: ucan.c:202
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.
Definition: ucan.c:264
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.
Definition: ucan.c:178