Defines an SPI Request Packet. More...
#include <Request.h>
Public Member Functions | |
Request () | |
void | setAsync (Callback callback=nullptr, void *param=nullptr) |
Set request to asynchronous execution with optional callback. More... | |
Set value for command phase | |
void | setCommand (uint16_t command, uint8_t bitCount) |
void | setCommand8 (uint8_t command) |
Set 8-bit command. More... | |
void | setCommand16 (uint16_t command) |
Set 16-bit command. More... | |
Set value for address phase | |
void | setAddress (uint32_t address, uint8_t bitCount) |
void | setAddress24 (uint32_t address) |
Set 24-bit address. More... | |
Public Attributes | |
Device * | device {nullptr} |
Target device for this request. More... | |
Request * | next {nullptr} |
Controller uses this to queue requests. More... | |
uint16_t | cmd {0} |
Command value. More... | |
uint8_t | cmdLen {0} |
Command bits, 0 - 16. More... | |
uint8_t | async: 1 |
Set for asynchronous operation. More... | |
uint8_t | task: 1 |
Controller will execute this request in task mode. More... | |
volatile uint8_t | busy: 1 |
Request in progress. More... | |
uint32_t | addr {0} |
Address value. More... | |
uint8_t | addrLen {0} |
Address bits, 0 - 32. More... | |
uint8_t | dummyLen {0} |
Dummy read bits between address and read data, 0 - 255. More... | |
uint8_t | sizeAlign {0} |
Required size alignment of each transaction (if split up) More... | |
Data | out |
Outgoing data. More... | |
Data | in |
Incoming data. More... | |
Callback | callback {nullptr} |
Completion routine. More... | |
void * | param {nullptr} |
User parameter. More... | |
Detailed Description
Defines an SPI Request Packet.
Request fields may be accessed directly or by use of helper methods.
Application is responsible for managing Request object construction/destruction. Queuing is managed as a linked list so the objects aren't copied.
Applications will typically only require a couple of Request objects, so one can be prepared whilst the other is in flight. This helps to minimises the setup latency between SPI transactions.
Constructor & Destructor Documentation
◆ Request()
|
inline |
Member Function Documentation
◆ setAddress()
|
inline |
- Parameters
-
address bitCount Length of address in bits
◆ setAddress24()
|
inline |
Set 24-bit address.
- Parameters
-
address
◆ setAsync()
|
inline |
Set request to asynchronous execution with optional callback.
◆ setCommand()
|
inline |
- Parameters
-
command bitCount Length of command in bits
◆ setCommand16()
|
inline |
Set 16-bit command.
- Parameters
-
command
◆ setCommand8()
|
inline |
Set 8-bit command.
- Parameters
-
command
Member Data Documentation
◆ addr
uint32_t HSPI::Request::addr {0} |
Address value.
◆ addrLen
uint8_t HSPI::Request::addrLen {0} |
Address bits, 0 - 32.
◆ async
uint8_t HSPI::Request::async |
Set for asynchronous operation.
◆ busy
volatile uint8_t HSPI::Request::busy |
Request in progress.
◆ callback
Callback HSPI::Request::callback {nullptr} |
Completion routine.
◆ cmd
uint16_t HSPI::Request::cmd {0} |
Command value.
◆ cmdLen
uint8_t HSPI::Request::cmdLen {0} |
Command bits, 0 - 16.
◆ device
Device* HSPI::Request::device {nullptr} |
Target device for this request.
◆ dummyLen
uint8_t HSPI::Request::dummyLen {0} |
Dummy read bits between address and read data, 0 - 255.
◆ in
Data HSPI::Request::in |
Incoming data.
◆ next
Request* HSPI::Request::next {nullptr} |
Controller uses this to queue requests.
◆ out
Data HSPI::Request::out |
Outgoing data.
◆ param
void* HSPI::Request::param {nullptr} |
User parameter.
◆ sizeAlign
uint8_t HSPI::Request::sizeAlign {0} |
Required size alignment of each transaction (if split up)
◆ task
uint8_t HSPI::Request::task |
Controller will execute this request in task mode.
The documentation for this struct was generated from the following file: