piMCP2515
A library for controlling an MCP2515 on the Raspberry Pi and Raspberry Pi Pico
Loading...
Searching...
No Matches
Error/Status Functions

These functions handle Status and Errors. More...

Functions

uint8_t mcp2515_status (pi_mcp2515_t *pi_mcp2515)
 Check status via the STATUS instruction.
uint8_t mcp2515_error_tx_count (pi_mcp2515_t *pi_mcp2515)
 Check the value of the 'transmit' (TX) error counter.
uint8_t mcp2515_error_rx_count (pi_mcp2515_t *pi_mcp2515)
 Check the value of the 'receive' (RX) error counter.
uint8_t mcp2515_error_flags (pi_mcp2515_t *pi_mcp2515)
 Fetch the contents of the error flag (EFLG) register.
bool mcp2515_error (pi_mcp2515_t *pi_mcp2515)
 Check error flags in the EFLG register.
int mcp2515_error_clear_errif (pi_mcp2515_t *pi_mcp2515)
 Clear error interrupt flag.

Detailed Description

These functions handle Status and Errors.

Function Documentation

◆ mcp2515_error()

bool mcp2515_error ( pi_mcp2515_t * pi_mcp2515)

Check error flags in the EFLG register.

Parameters
pi_mcp2515the piMCP2515 handle.
Returns
true if any error flags are set.

◆ mcp2515_error_clear_errif()

int mcp2515_error_clear_errif ( pi_mcp2515_t * pi_mcp2515)

Clear error interrupt flag.

Parameters
pi_mcp2515the piMCP2515 handle.
Returns
zero if success, otherwise non-zero.

◆ mcp2515_error_flags()

uint8_t mcp2515_error_flags ( pi_mcp2515_t * pi_mcp2515)

Fetch the contents of the error flag (EFLG) register.

Parameters
pi_mcp2515the piMCP2515 handle.
Returns
contents of the error flag (EFLG) register.

◆ mcp2515_error_rx_count()

uint8_t mcp2515_error_rx_count ( pi_mcp2515_t * pi_mcp2515)

Check the value of the 'receive' (RX) error counter.

Parameters
pi_mcp2515the piMCP2515 handle.
Returns
the RX error count.

◆ mcp2515_error_tx_count()

uint8_t mcp2515_error_tx_count ( pi_mcp2515_t * pi_mcp2515)

Check the value of the 'transmit' (TX) error counter.

Parameters
pi_mcp2515the piMCP2515 handle.
Returns
the TX error count.

◆ mcp2515_status()

uint8_t mcp2515_status ( pi_mcp2515_t * pi_mcp2515)

Check status via the STATUS instruction.

Parameters
pi_mcp2515the piMCP2515 handle.
Returns
the current status value.