Macros
Hardware SPI macros. More...
Macros | |
#define | SPI_FLAG_CLOCK_RISING_EDGE ( 1 << SPI_FLAG_CLOCK_EDGE_SHIFT ) |
Data is valid on rising edge flag. | |
#define | SPI_FLAG_CLOCK_FALLING_EDGE ( 0 << SPI_FLAG_CLOCK_EDGE_SHIFT ) |
Data is valid on falling edge flag. | |
#define | SPI_FLAG_CLOCK_IDLE_HIGH ( 1 << SPI_FLAG_CLOCK_IDLE_SHIFT ) |
Clock idles high flag. | |
#define | SPI_FLAG_CLOCK_IDLE_LOW ( 0 << SPI_FLAG_CLOCK_IDLE_SHIFT ) |
Clock idles low flag. | |
#define | SPI_FLAG_MSB_FIRST ( 1 << SPI_FLAG_BIT_FIRST_SHIFT ) |
Shift Most-Significant Bit first flag. | |
#define | SPI_FLAG_LSB_FIRST ( 0 << SPI_FLAG_BIT_FIRST_SHIFT ) |
Shift Least-Significant Bit first flag. | |
#define | SPI_FLAG_READ_AFTER_WRITE ( 1 << SPI_FLAG_READ_AFTER_WRITE_SHIFT ) |
Allow for reading after writing flag When this is specified, when data is written to the SPI slave, the simultaneously read data is buffered. More... | |
#define | SPI_FLAG_NO_READ_AFTER_WRITE ( 0 << SPI_FLAG_READ_AFTER_WRITE_SHIFT ) |
Don't read after writing. More... | |
#define | SPI_FLAG_KEEP_ASSERTED ( 1 << SPI_FLAG_KEEP_ASSERTED_SHIFT ) |
Keep the slave-select signal asserted after the API call. More... | |
#define | SPI_FLAG_DONT_KEEK_ASSERTED ( 0 << SPI_FLAG_KEEP_ASSERTED_SHIFT ) |
De-select the slave-select signal after the API call. | |
#define | SPI_FLAG_HEXIFY ( 1 << SPI_FLAG_HEXIFY_SHIFT ) |
When set, input data to the write command is converted from a hex string to binary. More... | |
#define | SPI_FLAG_NO_HEXIFY ( 0 << SPI_FLAG_HEXIFY_SHIFT ) |
Read/write data is always binary. | |
Detailed Description
Hardware SPI macros.
Macro Definition Documentation
#define SPI_FLAG_HEXIFY ( 1 << SPI_FLAG_HEXIFY_SHIFT ) |
When set, input data to the write command is converted from a hex string to binary.
Output data from the read command is converted from binary to a hex string.
- Note
- When this flag is set, up to
rx buffer
/2 -1 bytes may be read at a time - This flag is only used by the 'stream' API
#define SPI_FLAG_KEEP_ASSERTED ( 1 << SPI_FLAG_KEEP_ASSERTED_SHIFT ) |
Keep the slave-select signal asserted after the API call.
For the 'stream' API, this have has the following behavior: Sometimes it is necessary to keep the slave-select asserted between reads/writes. If this flag is not specified (i.e. SPI_FLAG_DONT_KEEK_ASSERTED) the slave-select is de-asserted after a read/write command. When this flag is specified, after a slave-select is asserted for a read/write command, it remains asserted until one of the events occurs:
- close command is issued for the stream
- A different
slave-select gpio
is specified as an argument to a read/write command - 0 bytes written to stream (i.e.
write handle 0
)
#define SPI_FLAG_NO_READ_AFTER_WRITE ( 0 << SPI_FLAG_READ_AFTER_WRITE_SHIFT ) |
Don't read after writing.
(i.e. drop read data while writing)
- Note
- This is only used by the 'stream' APIs.
#define SPI_FLAG_READ_AFTER_WRITE ( 1 << SPI_FLAG_READ_AFTER_WRITE_SHIFT ) |
Allow for reading after writing flag When this is specified, when data is written to the SPI slave, the simultaneously read data is buffered.
If this flag is not specified, when data is written, the read data is dropped.
- Note
- This is only used by the 'stream' APIs.