/* Only Special Function Registers (SFRs) can be read at byte level. */
int32_t can_ctrl_sfr_byte_read(struct can_ctrl_dev *dev, uint16_t address, uint8_t *data)
/* Only Special Function Registers (SFRs) can be read at byte level. */
int32_t can_ctrl_sfr_byte_read(struct can_ctrl_dev *dev, uint16_t address, uint8_t *data)
{
	uint8_t spi_msg[] = {0, 0, 0};
	int32_t ret;
	spi_msg[0] |= CAN_CTRL_CMD_MODE(CAN_CTRL_CMD_READ);
	spi_msg[0] |= CAN_CTRL_ADDR_UP_NIBBLE_MODE(address);
	spi_msg[1] |= CAN_CTRL_ADDR_DW_BYTE_MODE(address);
	ret = spi_write_and_read(dev->can_ctrl_spi, spi_msg, 3);
	if(ret != SUCCESS)
		return ret;
	*data = spi_msg[2];
	return ret;
}