|
|
|
@ -18,7 +18,7 @@ void talk_to_slave(uint8_t opcode, uint8_t addr, uint8_t flags)
|
|
|
|
|
|
|
|
|
|
|
|
uint16_t spi_master_communicate(uint8_t opcode, uint8_t address, uint16_t value)
|
|
|
|
uint16_t spi_master_communicate(uint8_t opcode, uint8_t address, uint16_t value)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint8_t flags = spi_proto_needs();
|
|
|
|
uint8_t flags = spi_proto_needs(opcode);
|
|
|
|
write_data[2] = value >> 8;
|
|
|
|
write_data[2] = value >> 8;
|
|
|
|
write_data[3] = value & 0xff;
|
|
|
|
write_data[3] = value & 0xff;
|
|
|
|
talk_to_slave(opcode, address, flags);
|
|
|
|
talk_to_slave(opcode, address, flags);
|
|
|
|
|