Structure to hold driver interface -> function mapping.
More...
Structure to hold driver interface -> function mapping.
Definition at line 89 of file candev.h.
#include <candev.h>
|
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...
|
|
◆ abort
Abort a packet sending.
- Parameters
-
[in] | dev | CAN device descriptor |
[in] | frame | CAN 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] | dev | CAN device descriptor |
[in] | opt | option type |
[out] | value | pointer to store the option's value in |
[in] | max_len | maximal 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] | dev | CAN 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] | dev | CAN device descriptor |
Definition at line 126 of file candev.h.
◆ remove_filter
Remove a filter
.
- Parameters
-
[in] | dev | CAN device descriptor |
[in] | filter | filter to remove |
- Returns
- 0 on success
-
<0 on error
Definition at line 174 of file candev.h.
◆ send
Send packet.
- Parameters
-
[in] | dev | CAN device descriptor |
[in] | frame | CAN 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] | dev | CAN device descriptor |
[in] | opt | option type |
[in] | value | value to set |
[in] | value_len | the length of value |
- Returns
- number of bytes used from
value
-
<0 on error
Definition at line 152 of file candev.h.
◆ set_filter
Set a receive filter
.
- Parameters
-
[in] | dev | CAN device descriptor |
[in] | filter | filter 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: