These functions handle manipulating values in the MCP2515's registers.
More...
|
| int | mcp2515_register_read (pi_mcp2515_t *pi_mcp2515, uint8_t *data, uint8_t len, mcp2515_rgstr_t rgstr) |
| | Read a value from a specified register.
|
| int | mcp2515_register_write (pi_mcp2515_t *pi_mcp2515, uint8_t values[], uint8_t len, mcp2515_rgstr_t rgstr) |
| | Write a value to the specified register.
|
| int | mcp2515_register_bitmod (pi_mcp2515_t *pi_mcp2515, const uint8_t data, const uint8_t mask, const mcp2515_rgstr_t rgstr) |
| | Change the value of a register via an SPI bit modify.
|
These functions handle manipulating values in the MCP2515's registers.
◆ mcp2515_register_bitmod()
| int mcp2515_register_bitmod |
( |
pi_mcp2515_t * | pi_mcp2515, |
|
|
const uint8_t | data, |
|
|
const uint8_t | mask, |
|
|
const mcp2515_rgstr_t | rgstr ) |
Change the value of a register via an SPI bit modify.
- Parameters
-
| pi_mcp2515 | the piMCP2515 handle. |
| data | the data to use for the bitmod. |
| mask | the mask to apply where only bits with a 1 value will be updated in the register with the data values. |
| rgstr | the register to perform the bitmod against. |
- Returns
- zero if success, otherwise non-zero.
◆ mcp2515_register_read()
| int mcp2515_register_read |
( |
pi_mcp2515_t * | pi_mcp2515, |
|
|
uint8_t * | data, |
|
|
uint8_t | len, |
|
|
mcp2515_rgstr_t | rgstr ) |
Read a value from a specified register.
- Parameters
-
| pi_mcp2515 | the piMCP2515 handle. |
| data | the destination to copy the read data to. |
| len | the length of the destination buffer. |
| rgstr | the register to read. |
- Returns
- zero if success, otherwise non-zero.
◆ mcp2515_register_write()
| int mcp2515_register_write |
( |
pi_mcp2515_t * | pi_mcp2515, |
|
|
uint8_t | values[], |
|
|
uint8_t | len, |
|
|
mcp2515_rgstr_t | rgstr ) |
Write a value to the specified register.
- Parameters
-
| pi_mcp2515 | the piMCP2515 handle. |
| values | the data to write to the register. |
| len | the length of the data to write. |
| rgstr | the register to write to. |
- Returns
- zero if success, otherwise non-zero.