[En-Nut-Discussion] Designing Interfaces, e.g. DMA
Uwe Bonnes
bon at elektron.ikp.physik.tu-darmstadt.de
Fri Jun 29 11:20:21 CEST 2012
Hello,
how is the ethernut strategy to implement functionality like DMA? While
there is some common functionality in the families that have DMA, a lot is
different too. E.g. for setup with NXP, Ole has :
void Lpc17xxGPDMA_Init(void);
int Lpc17xxGPDMA_Setup(gpdma_channel_cfg_t *ch_config);
int Lpc17xxGPDMA_IntGetStatus(gpdma_status_t type, uint8_t ch);
void Lpc17xxGPDMA_ClearIntPending(gpdma_state_clear_t type, uint8_t ch);
void Lpc17xxGPDMA_ChannelCmd(uint8_t ch, int enabled);
while Ulrich for STM did:
void DMA_Setup( uint8_t ch, void* dst, void* src, uint16_t length, uint32_t flags);
void DMA_Enable(uint8_t ch);
void DMA_Disable(uint8_t ch);
void DMA_Init(void);
void DMA_IrqMask( uint8_t ch, uint32_t mask, uint8_t ena);
void DMA_ClearFlag( uint8_t ch, uint32_t flags);
uint32_t DMA_GetFlag( uint8_t ch);
For STM void DMA_Init(void) should perhaps be DMA_Init(uint8_t ch), as
otherwise in parts with two independant DMA controllers, both would be
switched on and consume current, even when only one is needed.
Should every architecture implement it's own incarnation or should we tailor
a common feature set?
Same holds for the ADC/CAN etc.
Bye
--
Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
More information about the En-Nut-Discussion
mailing list