AP_HAL: SPIDevice: add fullduplex method

This method is needed when we want to transfer both tx and rx at the
same time, as opposed to common cases for sensors in which they are like
in the I2C interface: half-duplex.
This commit is contained in:
Lucas De Marchi 2016-07-22 01:38:13 -03:00
parent 7ded01cf24
commit 01452bf922
1 changed files with 7 additions and 0 deletions

View File

@ -39,6 +39,13 @@ public:
virtual bool transfer(const uint8_t *send, uint32_t send_len,
uint8_t *recv, uint32_t recv_len) override = 0;
/*
* Like #transfer(), but both @send and @recv buffers are transmitted at
* the same time: because of this they need to be of the same size.
*/
virtual bool transfer_fullduplex(const uint8_t *send, uint8_t *recv,
uint32_t len) = 0;
/* See Device::get_semaphore() */
virtual Semaphore *get_semaphore() override = 0;