aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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