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