PebbleOS v4.47.0-1075-g013613c8a
Loading...
Searching...
No Matches
pbl_can_ops Struct Reference

Controller driver operations. More...

#include <can.h>

Data Fields

int(* init )(const struct pbl_can *can)
 Bring the controller up, stopped.
 
int(* get_core_clock )(const struct pbl_can *can, uint32_t *rate)
 Get the rate of the clock time quanta are counted in, in Hz.
 
int(* configure )(const struct pbl_can *can, const struct pbl_can_timing *nominal, const struct pbl_can_timing *data, uint32_t mode)
 Apply the bit timing, the data phase's NULL without PBL_CAN_MODE_FD, and the mode, on the next start.
 
int(* set_filter )(const struct pbl_can *can, uint8_t idx, const struct pbl_can_filter *filter)
 Set acceptance filter idx, or disable it if filter is NULL, on the next start.
 
int(* start )(const struct pbl_can *can)
 Join the bus.
 
void(* stop )(const struct pbl_can *can)
 Leave the bus, completing the frames in flight with -ENETDOWN.
 
int(* send )(const struct pbl_can *can, const struct pbl_can_frame *frame, pbl_can_tx_callback_t cb, void *arg)
 Queue a frame, calling pbl_can_tx_done() with cb and arg once it is done.
 
void(* abort )(const struct pbl_can *can)
 Abort the frames in flight, which complete with -ECANCELED unless they were sent.
 
int(* get_state )(const struct pbl_can *can, enum pbl_can_bus_state *state, struct pbl_can_err_cnt *cnt)
 Get the state and error counters, while started.
 
int(* recover )(const struct pbl_can *can)
 Start the bus off recovery, with PBL_CAN_MODE_MANUAL_RECOVERY.
 

Detailed Description

Controller driver operations.

init() is called from the device init. configure(), set_filter() and start() are called from a thread with the device lock held, stop() also with interrupts locked. send(), abort() and get_state() and recover() are called with interrupts locked.

Field Documentation

◆ abort

void(* pbl_can_ops::abort) (const struct pbl_can *can)

Abort the frames in flight, which complete with -ECANCELED unless they were sent.

◆ configure

int(* pbl_can_ops::configure) (const struct pbl_can *can, const struct pbl_can_timing *nominal, const struct pbl_can_timing *data, uint32_t mode)

Apply the bit timing, the data phase's NULL without PBL_CAN_MODE_FD, and the mode, on the next start.

Returns 0 or a negative errno.

◆ get_core_clock

int(* pbl_can_ops::get_core_clock) (const struct pbl_can *can, uint32_t *rate)

Get the rate of the clock time quanta are counted in, in Hz.

Returns 0 or a negative errno.

◆ get_state

int(* pbl_can_ops::get_state) (const struct pbl_can *can, enum pbl_can_bus_state *state, struct pbl_can_err_cnt *cnt)

Get the state and error counters, while started.

Returns 0 or a negative errno.

◆ init

int(* pbl_can_ops::init) (const struct pbl_can *can)

Bring the controller up, stopped.

Returns 0 or a negative errno.

◆ recover

int(* pbl_can_ops::recover) (const struct pbl_can *can)

Start the bus off recovery, with PBL_CAN_MODE_MANUAL_RECOVERY.

Returns 0 or a negative errno.

◆ send

int(* pbl_can_ops::send) (const struct pbl_can *can, const struct pbl_can_frame *frame, pbl_can_tx_callback_t cb, void *arg)

Queue a frame, calling pbl_can_tx_done() with cb and arg once it is done.

Returns 0, or -EBUSY if the controller has no room for it.

◆ set_filter

int(* pbl_can_ops::set_filter) (const struct pbl_can *can, uint8_t idx, const struct pbl_can_filter *filter)

Set acceptance filter idx, or disable it if filter is NULL, on the next start.

Returns 0 or a negative errno.

◆ start

int(* pbl_can_ops::start) (const struct pbl_can *can)

Join the bus.

Returns 0 or a negative errno.

◆ stop

void(* pbl_can_ops::stop) (const struct pbl_can *can)

Leave the bus, completing the frames in flight with -ENETDOWN.


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