aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/SPC5xx/EDMA_v1
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-03-04 08:17:33 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-03-04 08:17:33 +0000
commite47644864d5d9a3ca0c201ad270ce993a1cb543f (patch)
treed22ccee3df30e61e579c79287fb19fbc20639abe /os/hal/platforms/SPC5xx/EDMA_v1
parent8fa38496b7cac89b8625c6665fdc191777a8c06a (diff)
downloadChibiOS-e47644864d5d9a3ca0c201ad270ce993a1cb543f.tar.gz
ChibiOS-e47644864d5d9a3ca0c201ad270ce993a1cb543f.tar.bz2
ChibiOS-e47644864d5d9a3ca0c201ad270ce993a1cb543f.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5351 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/SPC5xx/EDMA_v1')
-rw-r--r--os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c10
-rw-r--r--os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h19
2 files changed, 20 insertions, 9 deletions
diff --git a/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c b/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c
index 7979c37a9..2a1725e0d 100644
--- a/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c
+++ b/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.c
@@ -41,6 +41,8 @@
/* Driver local variables and types. */
/*===========================================================================*/
+static edma_channel_config_t channels[SPC5_EDMA_NCHANNELS];
+
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
@@ -67,22 +69,22 @@ void edmaInit(void) {
*
* @param[in] ccfg channel configuration
* @return The channel TCD pointer.
- * @retval NULL if the channel cannot be allocated.
+ * @retval EDMA_ERROR if the channel cannot be allocated.
*
* @special
*/
-edma_tcd_t *edmaAllocChannel(const edma_channel_config_t *ccfg) {
+edma_channel_t edmaAllocChannel(const edma_channel_config_t *ccfg) {
}
/**
* @brief EDMA channel allocation.
*
- * @param[in] tcd channel TCD pointer
+ * @param[in] channel the channel number
*
* @special
*/
-void edmaReleaseChannel(edma_tcd_t *tcd) {
+void edmaReleaseChannel(edma_channel_t channel) {
}
diff --git a/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h b/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h
index 3aa899122..b0506e7b5 100644
--- a/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h
+++ b/os/hal/platforms/SPC5xx/EDMA_v1/spc5_edma.h
@@ -33,6 +33,11 @@
/* Driver constants. */
/*===========================================================================*/
+/**
+ * @brief EDMA channel allocation error.
+ */
+#define EDMA_ERROR -1
+
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
@@ -46,6 +51,11 @@
/*===========================================================================*/
/**
+ * @brief Type of and EDMA channel number.
+ */
+typedef int32_t edma_channel_t;
+
+/**
* @brief Type of an EDMA TCD.
*/
typedef struct {
@@ -64,11 +74,10 @@ typedef void (*edma_isr_t)(edma_tcd_t *tcd, void *p);
* @brief Type of an EDMA channel configuration structure.
*/
typedef struct {
- uint32_t dma_periph; /**< @brief Peripheral associated to
- the channel. */
+ uint32_t dma_periph; /**< @brief Peripheral to be
+ associated to the channel. */
edma_isr_t dma_func; /**< @brief Channel ISR callback. */
void *dma_param; /**< @brief Channel callback param. */
-
} edma_channel_config_t;
/*===========================================================================*/
@@ -83,8 +92,8 @@ typedef struct {
extern "C" {
#endif
void edmaInit(void);
- edma_tcd_t *edmaAllocChannel(const edma_channel_config_t *ccfg);
- void edmaReleaseChannel(edma_tcd_t *tcd);
+ edma_channel_t edmaAllocChannel(const edma_channel_config_t *ccfg);
+ void edmaReleaseChannel(edma_channel_t *channel);
#ifdef __cplusplus
}
#endif