Structure to hold driver interface -> function mapping. More...

Detailed Description

Structure to hold driver interface -> function mapping.

Definition at line 89 of file candev.h.

#include <candev.h>

Data Fields

int(* send )(candev_t *dev, const struct can_frame *frame)
 Send packet. More...
 
int(* abort )(candev_t *dev, const struct can_frame *frame)
 Abort a packet sending. More...
 
int(* init )(candev_t *dev)
 the driver's initialization function More...
 
void(* isr )(candev_t *dev)
 a driver's user-space ISR handler More...
 
int(* get )(candev_t *dev, canopt_t opt, void *value, size_t max_len)
 Get an option value from a given CAN device. More...
 
int(* set )(candev_t *dev, canopt_t opt, void *value, size_t value_len)
 Set an option value for a given CAN device. More...
 
int(* set_filter )(candev_t *dev, const struct can_filter *filter)
 Set a receive filter. More...
 
int(* remove_filter )(candev_t *dev, const struct can_filter *filter)
 Remove a filter. More...
 

Field Documentation

◆ abort

int(* candev_driver::abort) (candev_t *dev, const struct can_frame *frame)

Abort a packet sending.

Parameters
[in]devCAN device descriptor
[in]frameCAN frame to abort
Returns
< 0 on error
0 on OK

Definition at line 110 of file candev.h.

◆ get

int(* candev_driver::get) (candev_t *dev, canopt_t opt, void *value, size_t max_len)

Get an option value from a given CAN device.

Parameters
[in]devCAN device descriptor
[in]optoption type
[out]valuepointer to store the option's value in
[in]max_lenmaximal amount of byte that fit into value
Returns
number of bytes written to value
<0 on error

Definition at line 139 of file candev.h.

◆ init

int(* candev_driver::init) (candev_t *dev)

the driver's initialization function

Parameters
[in]devCAN device descriptor
Returns
< 0 on error, 0 on success

Definition at line 119 of file candev.h.

◆ isr

void(* candev_driver::isr) (candev_t *dev)

a driver's user-space ISR handler

Parameters
[in]devCAN device descriptor

Definition at line 126 of file candev.h.

◆ remove_filter

int(* candev_driver::remove_filter) (candev_t *dev, const struct can_filter *filter)

Remove a filter.

Parameters
[in]devCAN device descriptor
[in]filterfilter to remove
Returns
0 on success
<0 on error

Definition at line 174 of file candev.h.

◆ send

int(* candev_driver::send) (candev_t *dev, const struct can_frame *frame)

Send packet.

Parameters
[in]devCAN device descriptor
[in]frameCAN frame to send
Returns
< 0 on error
mailbox id >= 0 if OK

Definition at line 99 of file candev.h.

◆ set

int(* candev_driver::set) (candev_t *dev, canopt_t opt, void *value, size_t value_len)

Set an option value for a given CAN device.

Parameters
[in]devCAN device descriptor
[in]optoption type
[in]valuevalue to set
[in]value_lenthe length of value
Returns
number of bytes used from value
<0 on error

Definition at line 152 of file candev.h.

◆ set_filter

int(* candev_driver::set_filter) (candev_t *dev, const struct can_filter *filter)

Set a receive filter.

Parameters
[in]devCAN device descriptor
[in]filterfilter to set
Returns
a positive filter number
<0 on error

Definition at line 163 of file candev.h.


The documentation for this struct was generated from the following file: