aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-05-23 15:20:39 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-05-23 15:20:39 +0000
commit141f14c79a836c841b70a9fbf90016db9d947cb9 (patch)
tree14864f4a4871dad91424ad403a251d7cf6f0ce44 /os/hal
parentec80f9b8a4b1e82fdc7896c70064c39374522cd1 (diff)
downloadChibiOS-141f14c79a836c841b70a9fbf90016db9d947cb9.tar.gz
ChibiOS-141f14c79a836c841b70a9fbf90016db9d947cb9.tar.bz2
ChibiOS-141f14c79a836c841b70a9fbf90016db9d947cb9.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5750 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r--os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.c9
-rw-r--r--os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h25
2 files changed, 21 insertions, 13 deletions
diff --git a/os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.c b/os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.c
index 9a273f850..e887ee24f 100644
--- a/os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.c
+++ b/os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.c
@@ -283,7 +283,7 @@ static void spi_start_dma_tx8(SPIDriver *spip,
spip->dspi->PUSHR.R = spip->tx_intbuf | (uint32_t)*txbuf++;
/* Setting up TX1 DMA TCD parameters for 8 bits transfers.*/
- edmaChannelSetupLinkedOnMinor(
+ edmaChannelSetupLinked(
spip->tx1_channel, /* channel. */
spip->tx2_channel, /* linkch. */
txbuf, /* src. */
@@ -293,7 +293,7 @@ static void spi_start_dma_tx8(SPIDriver *spip,
0, /* ssize, 8 bits transfers. */
0, /* dsize, 8 bits transfers. */
1, /* nbytes, always one. */
- n/* - 1*/, /* iter. */
+ n - 1, /* iter. */
0, /* slast, no source adjust. */
0, /* dlast, no dest.adjust. */
EDMA_TCD_MODE_DREQ); /* mode. */
@@ -691,6 +691,11 @@ void spi_lld_exchange(SPIDriver *spip, size_t n,
the whole transmitted data is pushed here and the TX DMA is not
activated.*/
spi_tx_prefill8(spip, n, txbuf);
+/* uint8_t *p = rxbuf;
+ *p++ = spip->dspi->POPR.R;
+ *p++ = spip->dspi->POPR.R;
+ *p++ = spip->dspi->POPR.R;
+ *p++ = spip->dspi->POPR.R;*/
}
else {
spi_start_dma_tx8(spip, n, txbuf);
diff --git a/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h b/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h
index 767eb11ff..3c23292eb 100644
--- a/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h
+++ b/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h
@@ -743,7 +743,7 @@ typedef struct {
/**
* @brief Sets the word 5 fields into a TCD.
- * @note Transfers are limited to 511 operations using this modality
+ * @note Transfers are limited to 512 operations using this modality
* (citer parameter).
*
* @param[in] tcdp pointer to an @p edma_tcd_t structure
@@ -753,7 +753,7 @@ typedef struct {
*
* @api
*/
-#define edmaTCDSetWord5LinkedOnMinor(tcdp, linkch, citer, doff) \
+#define edmaTCDSetWord5Linked(tcdp, linkch, citer, doff) \
((tcdp)->word[5] = (((uint32_t)0x80000000) | \
((uint32_t)(linkch) << 25) | \
((uint32_t)(citer) << 16) | \
@@ -785,7 +785,7 @@ typedef struct {
/**
* @brief Sets the word 7 fields into a TCD.
- * @note Transfers are limited to 511 operations using this modality
+ * @note Transfers are limited to 512 operations using this modality
* (biter parameter).
*
* @param[in] tcdp pointer to an @p edma_tcd_t structure
@@ -795,7 +795,7 @@ typedef struct {
*
* @api
*/
-#define edmaTCDSetWord7LinkedOnMinor(tcdp, linkch, biter, mode) \
+#define edmaTCDSetWord7Linked(tcdp, linkch, biter, mode) \
((tcdp)->word[7] = (((uint32_t)0x80000000) | \
((uint32_t)(linkch) << 25) | \
((uint32_t)(biter) << 16) | \
@@ -854,8 +854,9 @@ typedef struct {
}
/**
- * @brief EDMA channel setup with linked channel on minor loop counter.
- * @note Transfers are limited to 511 operations using this modality
+ * @brief EDMA channel setup with linked channel on both minor and major
+ * loop counters.
+ * @note Transfers are limited to 512 operations using this modality
* (iter parameter).
*
* @param[in] channel eDMA channel number
@@ -874,18 +875,20 @@ typedef struct {
*
* @api
*/
-#define edmaChannelSetupLinkedOnMinor(channel, linkch, src, dst, soff, \
- doff, ssize, dsize, nbytes, iter, \
- slast, dlast, mode) { \
+#define edmaChannelSetupLinked(channel, linkch, src, dst, soff, \
+ doff, ssize, dsize, nbytes, iter, \
+ slast, dlast, mode) { \
edma_tcd_t *tcdp = edmaGetTCD(channel); \
edmaTCDSetWord0(tcdp, src); \
edmaTCDSetWord1(tcdp, ssize, dsize, soff); \
edmaTCDSetWord2(tcdp, nbytes); \
edmaTCDSetWord3(tcdp, slast); \
edmaTCDSetWord4(tcdp, dst); \
- edmaTCDSetWord5LinkedOnMinor(tcdp, linkch, iter, doff); \
+ edmaTCDSetWord5Linked(tcdp, linkch, iter, doff); \
edmaTCDSetWord6(tcdp, dlast); \
- edmaTCDSetWord7LinkedOnMinor(tcdp, linkch, iter, mode); \
+ edmaTCDSetWord7Linked(tcdp, linkch, iter, (mode) | \
+ EDMA_TCD_MODE_MELINK | \
+ EDMA_TCD_MODE_MLINKCH(linkch)); \
}
/*===========================================================================*/