Hardware Abstraction Layer for FreeRTOS
can_prv.h File Reference
#include <FreeRTOS.h>
#include <semphr.h>
#include <stdint.h>
#include <stdbool.h>
#include <hal.h>
Include dependency graph for can_prv.h:

Go to the source code of this file.

Data Structures

struct  can_bittiming
 
struct  can_bittiming_const
 

Macros

#define CAN_ALREDY_INITED   1
 
#define can_lock(u, w, e)
 
#define can_unlock(u, e)
 
#define CAN_ADDDEV(ns, p)   HAL_ADDDEV(can, ns, p)
 
#define CAN_GET_DEV(index)   HAL_GET_DEV(can, index)
 
#define CAN_OPS(ns)
 
#define CAN_INIT_DEV(ns)
 
#define CAN_INIT(ns, index, bitrate, pin, pinHigh, callback, data)   struct can * can_init(uint32_t index, uint32_t bitrate, struct gpio_pin *pin, bool pinHigh, bool (*callback)(struct can *can, can_error_t error, can_errorData_t d, void *userData), void *data)
 
#define CAN_DEINIT(ns, c)   int32_t can_deinit(struct can *c)
 
#define CAN_SET_CALLBACK(ns, c, filterID, callback, data)   int32_t can_setCallback(struct can *c, int32_t filterID, bool (*callback)(struct can *can, struct can_msg *msg, void *data), void *data)
 
#define CAN_REGISTER_FILTER(ns, c, filter)   int32_t can_registerFilter(struct can *c, struct can_filter *filter)
 
#define CAN_DEREGISTER_FILTER(ns, c, filterID)   int32_t can_deregisterFilter(struct can *c, int32_t filterID)
 
#define CAN_SEND(ns, c, msg, waittime)   int32_t can_send(struct can *c, struct can_msg *msg, TickType_t waittime)
 
#define CAN_RECV(ns, c, filterID, msg, waittime)   int32_t can_recv(struct can *c, int32_t filterID, struct can_msg *msg, TickType_t waittime)
 
#define CAN_SEND_ISR(ns, c, msg)   int32_t can_sendISR(struct can *c, struct can_msg *msg)
 
#define CAN_RECV_ISR(ns, c, filterID, msg)   int32_t can_recvISR(struct can *c, int32_t filterID, struct can_msg *msg)
 
#define CAN_UP(ns, c)   int32_t can_up(struct can *c)
 
#define CAN_DOWN(ns, c)   int32_t can_down(struct can *c)
 

Functions

int32_t can_genericInit (struct can *can)
 
 HAL_DEFINE_GLOBAL_ARRAY (can)
 
int32_t can_calcBittiming (struct can_bittiming *bt, struct can_bittiming_const const *btc, int64_t clkFreq)
 

Macro Definition Documentation

◆ CAN_ADDDEV

#define CAN_ADDDEV (   ns,
 
)    HAL_ADDDEV(can, ns, p)

◆ CAN_ALREDY_INITED

#define CAN_ALREDY_INITED   1

◆ CAN_DEINIT

#define CAN_DEINIT (   ns,
 
)    int32_t can_deinit(struct can *c)

◆ CAN_DEREGISTER_FILTER

#define CAN_DEREGISTER_FILTER (   ns,
  c,
  filterID 
)    int32_t can_deregisterFilter(struct can *c, int32_t filterID)

◆ CAN_DOWN

#define CAN_DOWN (   ns,
 
)    int32_t can_down(struct can *c)

◆ CAN_GET_DEV

#define CAN_GET_DEV (   index)    HAL_GET_DEV(can, index)

◆ CAN_INIT

#define CAN_INIT (   ns,
  index,
  bitrate,
  pin,
  pinHigh,
  callback,
  data 
)    struct can * can_init(uint32_t index, uint32_t bitrate, struct gpio_pin *pin, bool pinHigh, bool (*callback)(struct can *can, can_error_t error, can_errorData_t d, void *userData), void *data)

◆ CAN_INIT_DEV

#define CAN_INIT_DEV (   ns)

◆ can_lock

#define can_lock (   u,
  w,
 
)

◆ CAN_OPS

#define CAN_OPS (   ns)

◆ CAN_RECV

#define CAN_RECV (   ns,
  c,
  filterID,
  msg,
  waittime 
)    int32_t can_recv(struct can *c, int32_t filterID, struct can_msg *msg, TickType_t waittime)

◆ CAN_RECV_ISR

#define CAN_RECV_ISR (   ns,
  c,
  filterID,
  msg 
)    int32_t can_recvISR(struct can *c, int32_t filterID, struct can_msg *msg)

◆ CAN_REGISTER_FILTER

#define CAN_REGISTER_FILTER (   ns,
  c,
  filter 
)    int32_t can_registerFilter(struct can *c, struct can_filter *filter)

◆ CAN_SEND

#define CAN_SEND (   ns,
  c,
  msg,
  waittime 
)    int32_t can_send(struct can *c, struct can_msg *msg, TickType_t waittime)

◆ CAN_SEND_ISR

#define CAN_SEND_ISR (   ns,
  c,
  msg 
)    int32_t can_sendISR(struct can *c, struct can_msg *msg)

◆ CAN_SET_CALLBACK

#define CAN_SET_CALLBACK (   ns,
  c,
  filterID,
  callback,
  data 
)    int32_t can_setCallback(struct can *c, int32_t filterID, bool (*callback)(struct can *can, struct can_msg *msg, void *data), void *data)

◆ can_unlock

#define can_unlock (   u,
 
)

◆ CAN_UP

#define CAN_UP (   ns,
 
)    int32_t can_up(struct can *c)

Function Documentation

◆ can_calcBittiming()

int32_t can_calcBittiming ( struct can_bittiming bt,
struct can_bittiming_const const *  btc,
int64_t  clkFreq 
)

◆ can_genericInit()

int32_t can_genericInit ( struct can *  can)

◆ HAL_DEFINE_GLOBAL_ARRAY()

HAL_DEFINE_GLOBAL_ARRAY ( can  )