aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD
diff options
context:
space:
mode:
authorgdisirio <gdisirio@110e8d01-0319-4d1e-a829-52ad28d1bb01>2018-11-04 11:01:25 +0000
committergdisirio <gdisirio@110e8d01-0319-4d1e-a829-52ad28d1bb01>2018-11-04 11:01:25 +0000
commit375272e2379121fad39c31a97e1a24a10e4a487c (patch)
tree1cb01ce3a632e26099035b8119ae608923252265 /os/hal/ports/STM32/LLD
parent11c39c1b95bb60026a1c811e63a16c63718e71d3 (diff)
downloadChibiOS-375272e2379121fad39c31a97e1a24a10e4a487c.tar.gz
ChibiOS-375272e2379121fad39c31a97e1a24a10e4a487c.tar.bz2
ChibiOS-375272e2379121fad39c31a97e1a24a10e4a487c.zip
Added an important note.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12406 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/hal/ports/STM32/LLD')
-rw-r--r--os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c b/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c
index ef5994e47..4d94f48ae 100644
--- a/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c
+++ b/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c
@@ -299,6 +299,15 @@ void wspi_lld_command(WSPIDriver *wspip, const wspi_command_t *cmdp) {
/**
* @brief Sends a command with data over the WSPI bus.
* @post At the end of the operation the configured callback is invoked.
+ * @note If using DTR in 8 lines mode then the following restrictions
+ * apply:
+ * - Command size must be 0, 2 or 4 bytes.
+ * - Address must be even.
+ * - Alternate bytes size must be 0, 2 or 4 bytes.
+ * - Data size must be a multiple of two.
+ * .
+ * There is no check on the above conditions in order to keep the
+ * code efficient.
*
* @param[in] wspip pointer to the @p WSPIDriver object
* @param[in] cmdp pointer to the command descriptor
@@ -315,7 +324,7 @@ void wspi_lld_send(WSPIDriver *wspip, const wspi_command_t *cmdp,
dmaStreamSetMode(wspip->dma, wspip->dmamode | STM32_DMA_CR_DIR_M2P);
wspip->ospi->CR &= ~OCTOSPI_CR_FMODE;
- wspip->ospi->DLR = n - 1;
+ wspip->ospi->DLR = n - 1U;
wspip->ospi->TCR = cmdp->dummy;
wspip->ospi->CCR = cmdp->cfg;
wspip->ospi->ABR = cmdp->alt;
@@ -330,6 +339,15 @@ void wspi_lld_send(WSPIDriver *wspip, const wspi_command_t *cmdp,
/**
* @brief Sends a command then receives data over the WSPI bus.
* @post At the end of the operation the configured callback is invoked.
+ * @note If using DTR in 8 lines mode then the following restrictions
+ * apply:
+ * - Command size must be 0, 2 or 4 bytes.
+ * - Address must be even.
+ * - Alternate bytes size must be 0, 2 or 4 bytes.
+ * - Data size must be a multiple of two.
+ * .
+ * There is no check on the above conditions in order to keep the
+ * code efficient.
*
* @param[in] wspip pointer to the @p WSPIDriver object
* @param[in] cmdp pointer to the command descriptor
@@ -346,7 +364,7 @@ void wspi_lld_receive(WSPIDriver *wspip, const wspi_command_t *cmdp,
dmaStreamSetMode(wspip->dma, wspip->dmamode | STM32_DMA_CR_DIR_P2M);
wspip->ospi->CR = (wspip->ospi->CR & ~OCTOSPI_CR_FMODE) | OCTOSPI_CR_FMODE_0;
- wspip->ospi->DLR = n - 1;
+ wspip->ospi->DLR = n - 1U;
wspip->ospi->TCR = cmdp->dummy;
wspip->ospi->CCR = cmdp->cfg;
wspip->ospi->ABR = cmdp->alt;