ChibiOS 21.11.4
|
WSPI Driver macros and structures. More...
#include "hal_wspi_lld.h"
Go to the source code of this file.
Data Structures | |
struct | wspi_command_t |
Type of a WSPI command descriptor. More... | |
struct | hal_wspi_config |
Driver configuration structure. More... | |
struct | hal_wspi_driver |
Structure representing an WSPI driver. More... |
Macros | |
WSPI configuration options | |
#define | WSPI_USE_WAIT TRUE |
Enables synchronous APIs. | |
#define | WSPI_USE_MUTUAL_EXCLUSION TRUE |
Enables the wspiAcquireBus() and wspiReleaseBus() APIs. | |
Transfer options | |
| |
#define | WSPI_CFG_CMD_MODE_MASK (7LU << 0LU) |
#define | WSPI_CFG_CMD_MODE_NONE (0LU << 0LU) |
#define | WSPI_CFG_CMD_MODE_ONE_LINE (1LU << 0LU) |
#define | WSPI_CFG_CMD_MODE_TWO_LINES (2LU << 0LU) |
#define | WSPI_CFG_CMD_MODE_FOUR_LINES (3LU << 0LU) |
#define | WSPI_CFG_CMD_MODE_EIGHT_LINES (4LU << 0LU) |
#define | WSPI_CFG_CMD_DTR (1LU << 3LU) |
#define | WSPI_CFG_CMD_SIZE_MASK (3LU << 4LU) |
#define | WSPI_CFG_CMD_SIZE_8 (0LU << 4LU) |
#define | WSPI_CFG_CMD_SIZE_16 (1LU << 4LU) |
#define | WSPI_CFG_CMD_SIZE_24 (2LU << 4LU) |
#define | WSPI_CFG_CMD_SIZE_32 (3LU << 4LU) |
#define | WSPI_CFG_ADDR_MODE_MASK (7LU << 8LU) |
#define | WSPI_CFG_ADDR_MODE_NONE (0LU << 8LU) |
#define | WSPI_CFG_ADDR_MODE_ONE_LINE (1LU << 8LU) |
#define | WSPI_CFG_ADDR_MODE_TWO_LINES (2LU << 8LU) |
#define | WSPI_CFG_ADDR_MODE_FOUR_LINES (3LU << 8LU) |
#define | WSPI_CFG_ADDR_MODE_EIGHT_LINES (4LU << 8LU) |
#define | WSPI_CFG_ADDR_DTR (1LU << 11LU) |
#define | WSPI_CFG_ADDR_SIZE_MASK (3LU << 12LU) |
#define | WSPI_CFG_ADDR_SIZE_8 (0LU << 12LU) |
#define | WSPI_CFG_ADDR_SIZE_16 (1LU << 12LU) |
#define | WSPI_CFG_ADDR_SIZE_24 (2LU << 12LU) |
#define | WSPI_CFG_ADDR_SIZE_32 (3LU << 12LU) |
#define | WSPI_CFG_ALT_MODE_MASK (7LU << 16LU) |
#define | WSPI_CFG_ALT_MODE_NONE (0LU << 16LU) |
#define | WSPI_CFG_ALT_MODE_ONE_LINE (1LU << 16LU) |
#define | WSPI_CFG_ALT_MODE_TWO_LINES (2LU << 16LU) |
#define | WSPI_CFG_ALT_MODE_FOUR_LINES (3LU << 16LU) |
#define | WSPI_CFG_ALT_MODE_EIGHT_LINES (4LU << 16LU) |
#define | WSPI_CFG_ALT_DTR (1LU << 19LU) |
#define | WSPI_CFG_ALT_SIZE_MASK (3LU << 20LU) |
#define | WSPI_CFG_ALT_SIZE_8 (0LU << 20LU) |
#define | WSPI_CFG_ALT_SIZE_16 (1LU << 20LU) |
#define | WSPI_CFG_ALT_SIZE_24 (2LU << 20LU) |
#define | WSPI_CFG_ALT_SIZE_32 (3LU << 20LU) |
#define | WSPI_CFG_DATA_MODE_MASK (7LU << 24LU) |
#define | WSPI_CFG_DATA_MODE_NONE (0LU << 24LU) |
#define | WSPI_CFG_DATA_MODE_ONE_LINE (1LU << 24LU) |
#define | WSPI_CFG_DATA_MODE_TWO_LINES (2LU << 24LU) |
#define | WSPI_CFG_DATA_MODE_FOUR_LINES (3LU << 24LU) |
#define | WSPI_CFG_DATA_MODE_EIGHT_LINES (4LU << 24LU) |
#define | WSPI_CFG_DATA_DTR (1LU << 27LU) |
#define | WSPI_CFG_DQS_ENABLE (1LU << 29LU) |
#define | WSPI_CFG_SIOO (1LU << 31LU) |
#define | WSPI_CFG_ALL_DTR |
Macro Functions | |
#define | wspiStartCommandI(wspip, cmdp) |
Sends a command without data phase. | |
#define | wspiStartSendI(wspip, cmdp, n, txbuf) |
Sends data over the WSPI bus. | |
#define | wspiStartReceiveI(wspip, cmdp, n, rxbuf) |
Receives data from the WSPI bus. | |
#define | wspiMapFlashI(wspip, cmdp, addrp) |
Maps in memory space a WSPI flash device. | |
#define | wspiUnmapFlashI(wspip) |
Maps in memory space a WSPI flash device. | |
Low level driver helper macros | |
#define | _wspi_wakeup_isr(wspip, msg) |
Wakes up the waiting thread. | |
#define | _wspi_isr_code(wspip) |
Common ISR code. | |
#define | _wspi_error_code(wspip) |
Common error ISR code. |
Typedefs | |
typedef struct hal_wspi_driver | WSPIDriver |
Type of a structure representing an WSPI driver. | |
typedef struct hal_wspi_config | WSPIConfig |
Type of a structure representing an WSPI driver configuration. | |
typedef void(* | wspicallback_t) (WSPIDriver *wspip) |
Type of a WSPI notification callback. |
Enumerations | |
enum | wspistate_t { WSPI_UNINIT = 0 , WSPI_STOP = 1 , WSPI_READY = 2 , WSPI_SEND = 3 , WSPI_RECEIVE = 4 , WSPI_COMPLETE = 5 , WSPI_MEMMAP = 6 } |
Driver state machine possible states. More... |
Functions | |
void | wspiInit (void) |
WSPI Driver initialization. | |
void | wspiObjectInit (WSPIDriver *wspip) |
Initializes the standard part of a WSPIDriver structure. | |
msg_t | wspiStart (WSPIDriver *wspip, const WSPIConfig *config) |
Configures and activates the WSPI peripheral. | |
void | wspiStop (WSPIDriver *wspip) |
Deactivates the WSPI peripheral. | |
void | wspiStartCommand (WSPIDriver *wspip, const wspi_command_t *cmdp) |
Sends a command without data phase. | |
void | wspiStartSend (WSPIDriver *wspip, const wspi_command_t *cmdp, size_t n, const uint8_t *txbuf) |
Sends a command with data over the WSPI bus. | |
void | wspiStartReceive (WSPIDriver *wspip, const wspi_command_t *cmdp, size_t n, uint8_t *rxbuf) |
Sends a command then receives data over the WSPI bus. | |
bool | wspiCommand (WSPIDriver *wspip, const wspi_command_t *cmdp) |
Sends a command without data phase. | |
bool | wspiSend (WSPIDriver *wspip, const wspi_command_t *cmdp, size_t n, const uint8_t *txbuf) |
Sends a command with data over the WSPI bus. | |
bool | wspiReceive (WSPIDriver *wspip, const wspi_command_t *cmdp, size_t n, uint8_t *rxbuf) |
Sends a command then receives data over the WSPI bus. | |
void | wspiMapFlash (WSPIDriver *wspip, const wspi_command_t *cmdp, uint8_t **addrp) |
Maps in memory space a WSPI flash device. | |
void | wspiUnmapFlash (WSPIDriver *wspip) |
Unmaps from memory space a WSPI flash device. | |
void | wspiAcquireBus (WSPIDriver *wspip) |
Gains exclusive access to the WSPI bus. | |
void | wspiReleaseBus (WSPIDriver *wspip) |
Releases exclusive access to the WSPI bus. |
WSPI Driver macros and structures.
Definition in file hal_wspi.h.