ChibiOS/HAL  6.1.0
QSPI Driver

Generic QSPI Driver. More...

Collaboration diagram for QSPI Driver:

Detailed Description

Generic QSPI Driver.

This module defines an abstract interface for a Quad SPI communication interface.

Precondition
In order to use the QSPI driver the HAL_USE_QSPI option must be enabled in halconf.h.

Transfer options

#define QSPI_CFG_CMD_MASK   (0xFFLU << 0LU)
 
#define QSPI_CFG_CMD(n)   ((n) << 0LU)
 
#define QSPI_CFG_CMD_MODE_MASK   (3LU << 8LU)
 
#define QSPI_CFG_CMD_MODE_NONE   (0LU << 8LU)
 
#define QSPI_CFG_CMD_MODE_ONE_LINE   (1LU << 8LU)
 
#define QSPI_CFG_CMD_MODE_TWO_LINES   (2LU << 8LU)
 
#define QSPI_CFG_CMD_MODE_FOUR_LINES   (3LU << 8LU)
 
#define QSPI_CFG_ADDR_MODE_MASK   (3LU << 10LU)
 
#define QSPI_CFG_ADDR_MODE_NONE   (0LU << 10LU)
 
#define QSPI_CFG_ADDR_MODE_ONE_LINE   (1LU << 10LU)
 
#define QSPI_CFG_ADDR_MODE_TWO_LINES   (2LU << 10LU)
 
#define QSPI_CFG_ADDR_MODE_FOUR_LINES   (3LU << 10LU)
 
#define QSPI_CFG_ADDR_SIZE_MASK   (3LU << 12LU)
 
#define QSPI_CFG_ADDR_SIZE_8   (0LU << 12LU)
 
#define QSPI_CFG_ADDR_SIZE_16   (1LU << 12LU)
 
#define QSPI_CFG_ADDR_SIZE_24   (2LU << 12LU)
 
#define QSPI_CFG_ADDR_SIZE_32   (3LU << 12LU)
 
#define QSPI_CFG_ALT_MODE_MASK   (3LU << 14LU)
 
#define QSPI_CFG_ALT_MODE_NONE   (0LU << 14LU)
 
#define QSPI_CFG_ALT_MODE_ONE_LINE   (1LU << 14LU)
 
#define QSPI_CFG_ALT_MODE_TWO_LINES   (2LU << 14LU)
 
#define QSPI_CFG_ALT_MODE_FOUR_LINES   (3LU << 14LU)
 
#define QSPI_CFG_ALT_SIZE_MASK   (3LU << 16LU)
 
#define QSPI_CFG_ALT_SIZE_8   (0LU << 16LU)
 
#define QSPI_CFG_ALT_SIZE_16   (1LU << 16LU)
 
#define QSPI_CFG_ALT_SIZE_24   (2LU << 16LU)
 
#define QSPI_CFG_ALT_SIZE_32   (3LU << 16LU)
 
#define QSPI_CFG_DUMMY_CYCLES_MASK   (0x1FLU << 18LU)
 
#define QSPI_CFG_DUMMY_CYCLES(n)   ((n) << 18LU)
 
#define QSPI_CFG_DATA_MODE_MASK   (3LU << 24LU)
 
#define QSPI_CFG_DATA_MODE_NONE   (0LU << 24LU)
 
#define QSPI_CFG_DATA_MODE_ONE_LINE   (1LU << 24LU)
 
#define QSPI_CFG_DATA_MODE_TWO_LINES   (2LU << 24LU)
 
#define QSPI_CFG_DATA_MODE_FOUR_LINES   (3LU << 24LU)
 
#define QSPI_CFG_SIOO   (1LU << 28LU)
 
#define QSPI_CFG_DDRM   (1LU << 31LU)
 

QSPI configuration options

#define QSPI_USE_WAIT   TRUE
 Enables synchronous APIs. More...
 
#define QSPI_USE_MUTUAL_EXCLUSION   TRUE
 Enables the qspiAcquireBus() and qspiReleaseBus() APIs. More...
 

Macro Functions

#define qspiStartCommandI(qspip, cmdp)
 Sends a command without data phase. More...
 
#define qspiStartSendI(qspip, cmdp, n, txbuf)
 Sends data over the QSPI bus. More...
 
#define qspiStartReceiveI(qspip, cmdp, n, rxbuf)
 Receives data from the QSPI bus. More...
 
#define qspiMapFlashI(qspip, cmdp, addrp)   qspi_lld_map_flash(qspip, cmdp, addrp)
 Maps in memory space a QSPI flash device. More...
 
#define qspiUnmapFlashI(qspip)   qspi_lld_unmap_flash(qspip)
 Maps in memory space a QSPI flash device. More...
 

Low level driver helper macros

#define _qspi_wakeup_isr(qspip)
 Wakes up the waiting thread. More...
 
#define _qspi_isr_code(qspip)
 Common ISR code. More...
 

QSPI capabilities

#define QSPI_SUPPORTS_MEMMAP   TRUE
 

Configuration options

#define PLATFORM_QSPI_USE_QSPI1   FALSE
 QSPID1 driver enable switch. More...
 

Typedefs

typedef struct QSPIDriver QSPIDriver
 Type of a structure representing an QSPI driver. More...
 
typedef void(* qspicallback_t) (QSPIDriver *qspip)
 Type of a QSPI notification callback. More...
 

Data Structures

struct  qspi_command_t
 Type of a QSPI command descriptor. More...
 
struct  QSPIConfig
 Driver configuration structure. More...
 
struct  QSPIDriver
 Structure representing an QSPI driver. More...
 

Functions

void qspiInit (void)
 QSPI Driver initialization. More...
 
void qspiObjectInit (QSPIDriver *qspip)
 Initializes the standard part of a QSPIDriver structure. More...
 
void qspiStart (QSPIDriver *qspip, const QSPIConfig *config)
 Configures and activates the QSPI peripheral. More...
 
void qspiStop (QSPIDriver *qspip)
 Deactivates the QSPI peripheral. More...
 
void qspiStartCommand (QSPIDriver *qspip, const qspi_command_t *cmdp)
 Sends a command without data phase. More...
 
void qspiStartSend (QSPIDriver *qspip, const qspi_command_t *cmdp, size_t n, const uint8_t *txbuf)
 Sends a command with data over the QSPI bus. More...
 
void qspiStartReceive (QSPIDriver *qspip, const qspi_command_t *cmdp, size_t n, uint8_t *rxbuf)
 Sends a command then receives data over the QSPI bus. More...
 
void qspiCommand (QSPIDriver *qspip, const qspi_command_t *cmdp)
 Sends a command without data phase. More...
 
void qspiSend (QSPIDriver *qspip, const qspi_command_t *cmdp, size_t n, const uint8_t *txbuf)
 Sends a command with data over the QSPI bus. More...
 
void qspiReceive (QSPIDriver *qspip, const qspi_command_t *cmdp, size_t n, uint8_t *rxbuf)
 Sends a command then receives data over the QSPI bus. More...
 
void qspiMapFlash (QSPIDriver *qspip, const qspi_command_t *cmdp, uint8_t **addrp)
 Maps in memory space a QSPI flash device. More...
 
void qspiUnmapFlash (QSPIDriver *qspip)
 Unmaps from memory space a QSPI flash device. More...
 
void qspiAcquireBus (QSPIDriver *qspip)
 Gains exclusive access to the QSPI bus. More...
 
void qspiReleaseBus (QSPIDriver *qspip)
 Releases exclusive access to the QSPI bus. More...
 
void qspi_lld_init (void)
 Low level QSPI driver initialization. More...
 
void qspi_lld_start (QSPIDriver *qspip)
 Configures and activates the QSPI peripheral. More...
 
void qspi_lld_stop (QSPIDriver *qspip)
 Deactivates the QSPI peripheral. More...
 
void qspi_lld_command (QSPIDriver *qspip, const qspi_command_t *cmdp)
 Sends a command without data phase. More...
 
void qspi_lld_send (QSPIDriver *qspip, const qspi_command_t *cmdp, size_t n, const uint8_t *txbuf)
 Sends a command with data over the QSPI bus. More...
 
void qspi_lld_receive (QSPIDriver *qspip, const qspi_command_t *cmdp, size_t n, uint8_t *rxbuf)
 Sends a command then receives data over the QSPI bus. More...
 
void qspi_lld_map_flash (QSPIDriver *qspip, const qspi_command_t *cmdp, uint8_t **addrp)
 Maps in memory space a QSPI flash device. More...
 
void qspi_lld_unmap_flash (QSPIDriver *qspip)
 Unmaps from memory space a QSPI flash device. More...
 

Enumerations

Variables

QSPIDriver QSPID1
 QSPID1 driver identifier. More...
 

Macro Definition Documentation

#define QSPI_USE_WAIT   TRUE

Enables synchronous APIs.

Note
Disabling this option saves both code and data space.

Definition at line 90 of file hal_qspi.h.

#define QSPI_USE_MUTUAL_EXCLUSION   TRUE

Enables the qspiAcquireBus() and qspiReleaseBus() APIs.

Note
Disabling this option saves both code and data space.

Definition at line 98 of file hal_qspi.h.

#define qspiStartCommandI (   qspip,
  cmdp 
)
Value:
{ \
osalDbgAssert(((cmdp)->cfg & QSPI_CFG_DATA_MODE_MASK) == \
QSPI_CFG_DATA_MODE_NONE, \
"data mode specified"); \
(qspip)->state = QSPI_ACTIVE; \
qspi_lld_command(qspip, cmdp); \
}
void qspi_lld_command(QSPIDriver *qspip, const qspi_command_t *cmdp)
Sends a command without data phase.
Definition: hal_qspi_lld.c:123
#define osalDbgAssert(c, remark)
Condition assertion.
Definition: osal.h:258

Sends a command without data phase.

Postcondition
At the end of the operation the configured callback is invoked.
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
Function Class:This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.

Definition at line 154 of file hal_qspi.h.

Referenced by qspiCommand(), and qspiStartCommand().

#define qspiStartSendI (   qspip,
  cmdp,
  n,
  txbuf 
)
Value:
{ \
osalDbgAssert(((cmdp)->cfg & QSPI_CFG_DATA_MODE_MASK) != \
QSPI_CFG_DATA_MODE_NONE, \
"data mode required"); \
(qspip)->state = QSPI_ACTIVE; \
qspi_lld_send(qspip, cmdp, n, txbuf); \
}
void qspi_lld_send(QSPIDriver *qspip, const qspi_command_t *cmdp, size_t n, const uint8_t *txbuf)
Sends a command with data over the QSPI bus.
Definition: hal_qspi_lld.c:140
#define osalDbgAssert(c, remark)
Condition assertion.
Definition: osal.h:258

Sends data over the QSPI bus.

This asynchronous function starts a transmit operation.

Postcondition
At the end of the operation the configured callback is invoked.
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
[in]nnumber of bytes to send or zero if no data phase
[in]txbufthe pointer to the transmit buffer
Function Class:This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.

Definition at line 174 of file hal_qspi.h.

Referenced by qspiSend(), and qspiStartSend().

#define qspiStartReceiveI (   qspip,
  cmdp,
  n,
  rxbuf 
)
Value:
{ \
osalDbgAssert(((cmdp)->cfg & QSPI_CFG_DATA_MODE_MASK) != \
QSPI_CFG_DATA_MODE_NONE, \
"data mode required"); \
(qspip)->state = QSPI_ACTIVE; \
qspi_lld_receive(qspip, cmdp, n, rxbuf); \
}
void qspi_lld_receive(QSPIDriver *qspip, const qspi_command_t *cmdp, size_t n, uint8_t *rxbuf)
Sends a command then receives data over the QSPI bus.
Definition: hal_qspi_lld.c:160
#define osalDbgAssert(c, remark)
Condition assertion.
Definition: osal.h:258

Receives data from the QSPI bus.

This asynchronous function starts a receive operation.

Postcondition
At the end of the operation the configured callback is invoked.
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
[in]nnumber of bytes to receive or zero if no data phase
[out]rxbufthe pointer to the receive buffer
Function Class:This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.

Definition at line 194 of file hal_qspi.h.

Referenced by qspiReceive(), and qspiStartReceive().

#define qspiMapFlashI (   qspip,
  cmdp,
  addrp 
)    qspi_lld_map_flash(qspip, cmdp, addrp)

Maps in memory space a QSPI flash device.

Precondition
The memory flash device must be initialized appropriately before mapping it in memory space.
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
[out]addrppointer to the memory start address of the mapped flash or NULL
Function Class:This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.

Definition at line 215 of file hal_qspi.h.

Referenced by qspiMapFlash().

#define qspiUnmapFlashI (   qspip)    qspi_lld_unmap_flash(qspip)

Maps in memory space a QSPI flash device.

Postcondition
The memory flash device must be re-initialized for normal commands exchange.
Parameters
[in]qspippointer to the QSPIDriver object
Function Class:This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.

Definition at line 227 of file hal_qspi.h.

Referenced by qspiUnmapFlash().

#define _qspi_wakeup_isr (   qspip)
Value:
{ \
osalThreadResumeI(&(qspip)->thread, MSG_OK); \
}
static void osalSysLockFromISR(void)
Enters a critical zone from ISR context.
Definition: osal.h:550
static void osalSysUnlockFromISR(void)
Leaves a critical zone from ISR context.
Definition: osal.h:560
void osalThreadResumeI(thread_reference_t *trp, msg_t msg)
Wakes up a thread waiting on a thread reference object.
Definition: osal.c:230

Wakes up the waiting thread.

Parameters
[in]qspippointer to the QSPIDriver object
Function Class:Not an API, this function is for internal use only.

Definition at line 244 of file hal_qspi.h.

#define _qspi_isr_code (   qspip)
Value:
{ \
if ((qspip)->config->end_cb) { \
(qspip)->state = QSPI_COMPLETE; \
(qspip)->config->end_cb(qspip); \
if ((qspip)->state == QSPI_COMPLETE) \
(qspip)->state = QSPI_READY; \
} \
else \
(qspip)->state = QSPI_READY; \
}
#define _qspi_wakeup_isr(qspip)
Wakes up the waiting thread.
Definition: hal_qspi.h:244

Common ISR code.

This code handles the portable part of the ISR code:

  • Callback invocation.
  • Waiting thread wakeup, if any.
  • Driver state transitions.
Note
This macro is meant to be used in the low level drivers implementation only.
Parameters
[in]qspippointer to the QSPIDriver object
Function Class:Not an API, this function is for internal use only.

Definition at line 267 of file hal_qspi.h.

#define PLATFORM_QSPI_USE_QSPI1   FALSE

QSPID1 driver enable switch.

If set to TRUE the support for QSPID1 is included.

Note
The default is FALSE.

Definition at line 55 of file hal_qspi_lld.h.

Typedef Documentation

typedef struct QSPIDriver QSPIDriver

Type of a structure representing an QSPI driver.

Definition at line 70 of file hal_qspi_lld.h.

typedef void(* qspicallback_t) (QSPIDriver *qspip)

Type of a QSPI notification callback.

Parameters
[in]qspippointer to the QSPIDriver object triggering the callback

Definition at line 78 of file hal_qspi_lld.h.

Enumeration Type Documentation

Driver state machine possible states.

Enumerator
QSPI_UNINIT 

Not initialized.

QSPI_STOP 

Stopped.

QSPI_READY 

Ready.

QSPI_ACTIVE 

Exchanging data.

QSPI_COMPLETE 

Asynchronous operation complete.

QSPI_MEMMAP 

In memory mapped mode.

Definition at line 113 of file hal_qspi.h.

Function Documentation

void qspiInit ( void  )

QSPI Driver initialization.

Note
This function is implicitly invoked by halInit(), there is no need to explicitly initialize the driver.
Function Class:Initializer, this function just initializes an object and can be invoked before the kernel is initialized.

Definition at line 56 of file hal_qspi.c.

References qspi_lld_init().

Referenced by halInit().

Here is the call graph for this function:

void qspiObjectInit ( QSPIDriver qspip)

Initializes the standard part of a QSPIDriver structure.

Parameters
[out]qspippointer to the QSPIDriver object
Function Class:Initializer, this function just initializes an object and can be invoked before the kernel is initialized.

Definition at line 68 of file hal_qspi.c.

References QSPIDriver::config, QSPIDriver::mutex, osalMutexObjectInit(), QSPI_STOP, QSPIDriver::state, and QSPIDriver::thread.

Referenced by qspi_lld_init().

Here is the call graph for this function:

void qspiStart ( QSPIDriver qspip,
const QSPIConfig config 
)

Configures and activates the QSPI peripheral.

Parameters
[in]qspippointer to the QSPIDriver object
[in]configpointer to the QSPIConfig object
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 91 of file hal_qspi.c.

References QSPIDriver::config, osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), qspi_lld_start(), QSPI_READY, QSPI_STOP, and QSPIDriver::state.

Here is the call graph for this function:

void qspiStop ( QSPIDriver qspip)

Deactivates the QSPI peripheral.

Note
Deactivating the peripheral also enforces a release of the slave select line.
Parameters
[in]qspippointer to the QSPIDriver object
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 116 of file hal_qspi.c.

References QSPIDriver::config, osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), qspi_lld_stop(), QSPI_READY, QSPI_STOP, and QSPIDriver::state.

Here is the call graph for this function:

void qspiStartCommand ( QSPIDriver qspip,
const qspi_command_t cmdp 
)

Sends a command without data phase.

Postcondition
At the end of the operation the configured callback is invoked.
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 141 of file hal_qspi.c.

References osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), QSPI_READY, qspiStartCommandI, and QSPIDriver::state.

Here is the call graph for this function:

void qspiStartSend ( QSPIDriver qspip,
const qspi_command_t cmdp,
size_t  n,
const uint8_t *  txbuf 
)

Sends a command with data over the QSPI bus.

Postcondition
At the end of the operation the configured callback is invoked.
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
[in]nnumber of bytes to send
[in]txbufthe pointer to the transmit buffer
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 165 of file hal_qspi.c.

References osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), QSPI_READY, qspiStartSendI, and QSPIDriver::state.

Here is the call graph for this function:

void qspiStartReceive ( QSPIDriver qspip,
const qspi_command_t cmdp,
size_t  n,
uint8_t *  rxbuf 
)

Sends a command then receives data over the QSPI bus.

Postcondition
At the end of the operation the configured callback is invoked.
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
[in]nnumber of bytes to send
[out]rxbufthe pointer to the receive buffer
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 191 of file hal_qspi.c.

References osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), QSPI_READY, qspiStartReceiveI, and QSPIDriver::state.

Here is the call graph for this function:

void qspiCommand ( QSPIDriver qspip,
const qspi_command_t cmdp 
)

Sends a command without data phase.

Precondition
In order to use this function the option QSPI_USE_WAIT must be enabled.
In order to use this function the driver must have been configured without callbacks (end_cb = NULL).
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 219 of file hal_qspi.c.

References QSPIDriver::config, QSPIConfig::end_cb, osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), osalThreadSuspendS(), QSPI_READY, qspiStartCommandI, QSPIDriver::state, and QSPIDriver::thread.

Here is the call graph for this function:

void qspiSend ( QSPIDriver qspip,
const qspi_command_t cmdp,
size_t  n,
const uint8_t *  txbuf 
)

Sends a command with data over the QSPI bus.

Precondition
In order to use this function the option QSPI_USE_WAIT must be enabled.
In order to use this function the driver must have been configured without callbacks (end_cb = NULL).
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
[in]nnumber of bytes to send
[in]txbufthe pointer to the transmit buffer
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 249 of file hal_qspi.c.

References QSPIDriver::config, QSPIConfig::end_cb, osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), osalThreadSuspendS(), QSPI_READY, qspiStartSendI, QSPIDriver::state, and QSPIDriver::thread.

Here is the call graph for this function:

void qspiReceive ( QSPIDriver qspip,
const qspi_command_t cmdp,
size_t  n,
uint8_t *  rxbuf 
)

Sends a command then receives data over the QSPI bus.

Precondition
In order to use this function the option QSPI_USE_WAIT must be enabled.
In order to use this function the driver must have been configured without callbacks (end_cb = NULL).
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
[in]nnumber of bytes to send
[out]rxbufthe pointer to the receive buffer
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 281 of file hal_qspi.c.

References QSPIDriver::config, QSPIConfig::end_cb, osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), osalThreadSuspendS(), QSPI_READY, qspiStartReceiveI, QSPIDriver::state, and QSPIDriver::thread.

Here is the call graph for this function:

void qspiMapFlash ( QSPIDriver qspip,
const qspi_command_t cmdp,
uint8_t **  addrp 
)

Maps in memory space a QSPI flash device.

Precondition
The memory flash device must be initialized appropriately before mapping it in memory space.
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
[out]addrppointer to the memory start address of the mapped flash or NULL
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 313 of file hal_qspi.c.

References osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), QSPI_MEMMAP, QSPI_READY, qspiMapFlashI, and QSPIDriver::state.

Here is the call graph for this function:

void qspiUnmapFlash ( QSPIDriver qspip)

Unmaps from memory space a QSPI flash device.

Postcondition
The memory flash device must be re-initialized for normal commands exchange.
Parameters
[in]qspippointer to the QSPIDriver object
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 339 of file hal_qspi.c.

References osalDbgAssert, osalDbgCheck, osalSysLock(), osalSysUnlock(), QSPI_MEMMAP, QSPI_READY, qspiUnmapFlashI, and QSPIDriver::state.

Here is the call graph for this function:

void qspiAcquireBus ( QSPIDriver qspip)

Gains exclusive access to the QSPI bus.

This function tries to gain ownership to the QSPI bus, if the bus is already being used then the invoking thread is queued.

Precondition
In order to use this function the option QSPI_USE_MUTUAL_EXCLUSION must be enabled.
Parameters
[in]qspippointer to the QSPIDriver object
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 366 of file hal_qspi.c.

References QSPIDriver::mutex, osalDbgCheck, and osalMutexLock().

Here is the call graph for this function:

void qspiReleaseBus ( QSPIDriver qspip)

Releases exclusive access to the QSPI bus.

Precondition
In order to use this function the option QSPI_USE_MUTUAL_EXCLUSION must be enabled.
Parameters
[in]qspippointer to the QSPIDriver object
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 382 of file hal_qspi.c.

References QSPIDriver::mutex, osalDbgCheck, and osalMutexUnlock().

Here is the call graph for this function:

void qspi_lld_init ( void  )

Low level QSPI driver initialization.

Function Class:Not an API, this function is for internal use only.

Definition at line 63 of file hal_qspi_lld.c.

References qspiObjectInit().

Referenced by qspiInit().

Here is the call graph for this function:

void qspi_lld_start ( QSPIDriver qspip)

Configures and activates the QSPI peripheral.

Parameters
[in]qspippointer to the QSPIDriver object
Function Class:Not an API, this function is for internal use only.

Definition at line 77 of file hal_qspi_lld.c.

References QSPI_STOP, and QSPIDriver::state.

Referenced by qspiStart().

void qspi_lld_stop ( QSPIDriver qspip)

Deactivates the QSPI peripheral.

Parameters
[in]qspippointer to the QSPIDriver object
Function Class:Not an API, this function is for internal use only.

Definition at line 99 of file hal_qspi_lld.c.

References QSPI_READY, and QSPIDriver::state.

Referenced by qspiStop().

void qspi_lld_command ( QSPIDriver qspip,
const qspi_command_t cmdp 
)

Sends a command without data phase.

Postcondition
At the end of the operation the configured callback is invoked.
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
Function Class:Not an API, this function is for internal use only.

Definition at line 123 of file hal_qspi_lld.c.

void qspi_lld_send ( QSPIDriver qspip,
const qspi_command_t cmdp,
size_t  n,
const uint8_t *  txbuf 
)

Sends a command with data over the QSPI bus.

Postcondition
At the end of the operation the configured callback is invoked.
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
[in]nnumber of bytes to send
[in]txbufthe pointer to the transmit buffer
Function Class:Not an API, this function is for internal use only.

Definition at line 140 of file hal_qspi_lld.c.

void qspi_lld_receive ( QSPIDriver qspip,
const qspi_command_t cmdp,
size_t  n,
uint8_t *  rxbuf 
)

Sends a command then receives data over the QSPI bus.

Postcondition
At the end of the operation the configured callback is invoked.
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
[in]nnumber of bytes to send
[out]rxbufthe pointer to the receive buffer
Function Class:Not an API, this function is for internal use only.

Definition at line 160 of file hal_qspi_lld.c.

void qspi_lld_map_flash ( QSPIDriver qspip,
const qspi_command_t cmdp,
uint8_t **  addrp 
)

Maps in memory space a QSPI flash device.

Precondition
The memory flash device must be initialized appropriately before mapping it in memory space.
Parameters
[in]qspippointer to the QSPIDriver object
[in]cmdppointer to the command descriptor
[out]addrppointer to the memory start address of the mapped flash or NULL
Function Class:Not an API, this function is for internal use only.

Definition at line 182 of file hal_qspi_lld.c.

void qspi_lld_unmap_flash ( QSPIDriver qspip)

Unmaps from memory space a QSPI flash device.

Postcondition
The memory flash device must be re-initialized for normal commands exchange.
Parameters
[in]qspippointer to the QSPIDriver object
Function Class:Not an API, this function is for internal use only.

Definition at line 200 of file hal_qspi_lld.c.

Variable Documentation

QSPIDriver QSPID1

QSPID1 driver identifier.

Definition at line 39 of file hal_qspi_lld.c.