Go to the documentation of this file.
35 MODE_NORMAL = MCP2515_CANSTAT_OPMOD_NORMAL,
36 MODE_SLEEP = MCP2515_CANSTAT_OPMOD_SLEEP,
37 MODE_LOOPBACK = MCP2515_CANSTAT_OPMOD_LOOPBACK,
38 MODE_LISTEN_ONLY = MCP2515_CANSTAT_OPMOD_LISTEN_ONLY,
39 MODE_CONFIG = MCP2515_CANSTAT_OPMOD_CONFIGURATION,
47 INT_RX0 = MCP2515_CANINTF_RX0IF,
48 INT_RX1 = MCP2515_CANINTF_RX1IF,
49 INT_TX0 = MCP2515_CANINTF_TX0IF,
50 INT_TX1 = MCP2515_CANINTF_TX1IF,
51 INT_TX2 = MCP2515_CANINTF_TX2IF,
52 INT_ERROR = MCP2515_CANINTF_ERRIF,
53 INT_WAKEUP = MCP2515_CANINTF_WAKIF,
54 INT_MESSAGE_ERROR = MCP2515_CANINTF_MERRF,
61 ERR_WARNING = MCP2515_EFLG_EWARN,
62 ERR_RX_WARNING = MCP2515_EFLG_RXWAR,
63 ERR_TX_WARNING = MCP2515_EFLG_TXWAR,
64 ERR_RX_PASSIVE = MCP2515_EFLG_RXEP,
65 ERR_TX_PASSIVE = MCP2515_EFLG_TXEP,
66 ERR_TX_BUS_OFF = MCP2515_EFLG_TXBO,
67 ERR_RX_0_OVERFLOW = MCP2515_EFLG_RX0OVR,
68 ERR_RX_1_OVERFLOW = MCP2515_EFLG_RX1OVR,
72 #define MCP2515_WKUP_SRC_INTERNAL 1
int mcp2515_send(candev_mcp2515_t *dev, const struct can_frame *frame, int mailbox)
Send frame through the corresponding tx mailbox.
mcp2515_mode
MCP2515 mode.
enum mcp2515_interrupt mcp2515_get_irq(candev_mcp2515_t *dev)
Get MCP2515 interrupt type.
int mcp2515_receive(candev_mcp2515_t *dev, struct can_frame *frame, int mailbox)
Receive frame from the corresponding rx mailbox.
enum mcp2515_mode mcp2515_get_mode(candev_mcp2515_t *dev)
Get MCP2515 mode of operation.
mcp2515_interrupt
MCP2515 interrupt.
Definition of the implementation of the CAN controller driver.
int mcp2515_set_filter(candev_mcp2515_t *dev, int filter_id, uint32_t filter)
Set the @ filter_id to the position in the mailbox.
int mcp2515_abort(candev_mcp2515_t *dev, int mailbox)
Abort communication.
int mcp2515_init_irqs(candev_mcp2515_t *dev)
Initialize MCP2515 interrupts.
Controller Area Network frame.
enum mcp2515_mode mcp2515_set_mode(candev_mcp2515_t *dev, enum mcp2515_mode mode)
Set MCP2515 mode of operation.
mcp2515_error
MCP2515 error.
int mcp2515_set_mask(candev_mcp2515_t *dev, int mailbox, uint32_t mask)
Set the @ mask to the mailbox.
int mcp2515_configure_bittiming(candev_mcp2515_t *dev)
Configure the bit timing of the MCP2515.
uint8_t mcp2515_get_errors(candev_mcp2515_t *dev)
Get the error flags.
int mcp2515_init(candev_mcp2515_t *dev, void(*irq_cb)(void *))
Initialize pins and SPI interface.
MCP2515 device descriptor.
int mcp2515_clear_irq(candev_mcp2515_t *dev, enum mcp2515_interrupt irq)
Clear MCP2515 interrupt.
void mcp2515_reset(candev_mcp2515_t *dev)
Reset MCP2515 device with dedicated pin.
void mcp2515_wake_up(candev_mcp2515_t *dev)
Wake up MCP2515.
Driver for the Microchip MCP2515 can controller.
int mcp2515_tx_err_occurred(candev_mcp2515_t *dev, int mailbox)
Get if an tx error occurred on MCP2515.