aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32')
-rw-r--r--os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c34
-rw-r--r--os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.h13
2 files changed, 47 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c b/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c
index f914b6163..4c8ee0f2d 100644
--- a/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c
+++ b/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c
@@ -291,6 +291,40 @@ void qspi_lld_receive(QSPIDriver *qspip, const qspi_command_t *cmdp,
dmaStreamEnable(qspip->dma);
}
+
+#if (QSPI_SUPPORTS_MEMMAP == TRUE) || defined(__DOXYGEN__)
+/**
+ * @brief Maps in memory space a QSPI flash device.
+ * @pre The memory flash device must be initialized appropriately
+ * before mapping it in memory space.
+ *
+ * @param[in] qspip pointer to the @p QSPIDriver object
+ * @param[in] cmdp pointer to the command descriptor
+ * @param[out] addrp pointer to the memory start address of the mapped
+ * flash or @p NULL
+ *
+ * @notapi
+ */
+void qspi_lld_map_flash(QSPIDriver *qspip,
+ const qspi_command_t *cmdp,
+ uint8_t **addrp) {
+
+}
+
+/**
+ * @brief Maps in memory space a QSPI flash device.
+ * @post The memory flash device must be re-initialized for normal
+ * commands exchange.
+ *
+ * @param[in] qspip pointer to the @p QSPIDriver object
+ *
+ * @notapi
+ */
+void qspi_lld_unmap_flash(QSPIDriver *qspip) {
+
+}
+#endif /* QSPI_SUPPORTS_MEMMAP == TRUE */
+
#endif /* HAL_USE_QSPI */
/** @} */
diff --git a/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.h b/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.h
index 4465755bf..5f8cd86af 100644
--- a/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.h
+++ b/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.h
@@ -32,6 +32,13 @@
/*===========================================================================*/
/**
+ * @name QSPI capabilities
+ * @{
+ */
+#define QSPI_SUPPORTS_MEMMAP FALSE
+/** @} */
+
+/**
* @name DCR register options
* @{
*/
@@ -257,6 +264,12 @@ extern "C" {
size_t n, const uint8_t *txbuf);
void qspi_lld_receive(QSPIDriver *qspip, const qspi_command_t *cmdp,
size_t n, uint8_t *rxbuf);
+#if QSPI_SUPPORTS_MEMMAP == TRUE
+ void qspi_lld_map_flash(QSPIDriver *qspip,
+ const qspi_command_t *cmdp,
+ uint8_t **addrp);
+ void qspi_lld_unmap_flash(QSPIDriver *qspip);
+#endif
#ifdef __cplusplus
}
#endif