void(* candev_event_cb_t)(candev_t *dev, candev_event_t event, void *arg)
Event callback for signaling event to upper layers.
int(* set_filter)(candev_t *dev, const struct can_filter *filter)
Set a receive filter.
struct candev_driver candev_driver_t
Structure to hold driver interface -> function mapping.
int(* abort)(candev_t *dev, const struct can_frame *frame)
Abort a packet sending.
Structure to hold driver state.
enum can_state state
device state
candev_event_cb_t event_callback
callback for device events
candev_event_t
Possible event types that are sent from the device driver to the upper layer.
const struct candev_driver * driver
ptr to that driver's interface.
Definitions high-level CAN interface.
int(* set)(candev_t *dev, canopt_t opt, void *value, size_t value_len)
Set an option value for a given CAN device.
void * isr_arg
argument to pass on isr event
Controller Area Network filter.
@ CANDEV_EVENT_TIMEOUT_TX_CONF
tx conf timeout received
Definitions of high-level CAN interface.
int(* init)(candev_t *dev)
the driver's initialization function
struct can_bittiming bittiming
device bittimings
@ CANDEV_EVENT_TX_CONFIRMATION
a packet has been sent
Controller Area Network frame.
@ CANDEV_EVENT_NOEVENT
no event, used internally
can_state
CAN operational and error states.
void(* isr)(candev_t *dev)
a driver's user-space ISR handler
@ CANDEV_EVENT_ERROR_WARNING
driver reached error warning
@ CANDEV_EVENT_RX_INDICATION
a packet has been received
Mutex for thread synchronization.
Structure to hold driver interface -> function mapping.
int(* send)(candev_t *dev, const struct can_frame *frame)
Send packet.
CAN bit-timing parameters.
@ CANDEV_EVENT_ISR
driver needs its ISR handled
int(* remove_filter)(candev_t *dev, const struct can_filter *filter)
Remove a filter.
@ CANDEV_EVENT_BUS_OFF
bus-off detected
@ CANDEV_EVENT_ERROR_PASSIVE
driver switched in error passive
@ CANDEV_EVENT_RX_ERROR
there was an error when receiving
int(* get)(candev_t *dev, canopt_t opt, void *value, size_t max_len)
Get an option value from a given CAN device.
@ CANDEV_EVENT_TX_ERROR
there was an error when transmitting
@ CANDEV_EVENT_WAKE_UP
driver has been woken up by bus