diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-03-05 15:37:10 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-03-05 15:37:10 +0000 |
commit | b8861047963cae44890f8928d4fe1a2bcad864b1 (patch) | |
tree | 74efac85fb4b913ead73d52e769b8ffd2cbfbd76 /os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c | |
parent | 736ee907455c8842e0ebd928f3bc8ddeff2ab9f9 (diff) | |
download | ChibiOS-b8861047963cae44890f8928d4fe1a2bcad864b1.tar.gz ChibiOS-b8861047963cae44890f8928d4fe1a2bcad864b1.tar.bz2 ChibiOS-b8861047963cae44890f8928d4fe1a2bcad864b1.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5364 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c')
-rw-r--r-- | os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c b/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c index cbb7e7ef8..0998289c2 100644 --- a/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c +++ b/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c @@ -748,4 +748,46 @@ void edmaChannelRelease(edma_channel_t channel) { channels[channel] = NULL;
}
+/**
+ * @brief EDMA channel setup.
+ *
+ * @param[in] channel eDMA channel number
+ * @param[in] src source address
+ * @param[in] dst destination address
+ * @param[in] soff source address offset
+ * @param[in] doff destination address offset
+ * @param[in] ssize source transfer size
+ * @param[in] dsize destination transfer size
+ * @param[in] nbytes minor loop count
+ * @param[in] iter major loop count
+ * @param[in] dlast_sga Last Destination Address Adjustment or
+ * Scatter Gather Address
+ * @param[in] slast last source address adjustment
+ * @param[in] mode LSW of TCD register 7
+ */
+void edmaChannelSetupx(edma_channel_t channel,
+ void *src,
+ void *dst,
+ uint32_t soff,
+ uint32_t doff,
+ uint32_t ssize,
+ uint32_t dsize,
+ uint32_t nbytes,
+ uint32_t iter,
+ uint32_t slast,
+ uint32_t dlast,
+ uint32_t mode) {
+
+ edma_tcd_t *tcdp = edmaGetTCD(channel);
+
+ tcdp->word[0] = (uint32_t)src;
+ tcdp->word[1] = (ssize << 24) | (dsize << 16) | soff;
+ tcdp->word[2] = nbytes;
+ tcdp->word[3] = slast;
+ tcdp->word[0] = (uint32_t)dst;
+ tcdp->word[5] = (iter << 16) | doff;
+ tcdp->word[6] = dlast;
+ tcdp->word[7] = (iter << 16) | mode;
+}
+
/** @} */
|