Add GPDMA LLI function to enable interrupt after LLI operation is complete.
This commit is contained in:
@ -44,3 +44,7 @@ void gpdma_channel_interrupt_tc_clear(const uint_fast8_t channel) {
|
|||||||
void gpdma_channel_interrupt_error_clear(const uint_fast8_t channel) {
|
void gpdma_channel_interrupt_error_clear(const uint_fast8_t channel) {
|
||||||
GPDMA_INTERRCLR = GPDMA_INTERRCLR_INTERRCLR(1 << channel);
|
GPDMA_INTERRCLR = GPDMA_INTERRCLR_INTERRCLR(1 << channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gpdma_lli_enable_interrupt(gpdma_lli_t* const lli) {
|
||||||
|
lli->ccontrol |= GPDMA_CCONTROL_I(1);
|
||||||
|
}
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include <libopencm3/lpc43xx/gpdma.h>
|
||||||
|
|
||||||
void gpdma_controller_enable();
|
void gpdma_controller_enable();
|
||||||
|
|
||||||
void gpdma_channel_enable(const uint_fast8_t channel);
|
void gpdma_channel_enable(const uint_fast8_t channel);
|
||||||
@ -32,4 +34,6 @@ void gpdma_channel_disable(const uint_fast8_t channel);
|
|||||||
void gpdma_channel_interrupt_tc_clear(const uint_fast8_t channel);
|
void gpdma_channel_interrupt_tc_clear(const uint_fast8_t channel);
|
||||||
void gpdma_channel_interrupt_error_clear(const uint_fast8_t channel);
|
void gpdma_channel_interrupt_error_clear(const uint_fast8_t channel);
|
||||||
|
|
||||||
|
void gpdma_lli_enable_interrupt(gpdma_lli_t* const lli);
|
||||||
|
|
||||||
#endif/*__GPDMA_H__*/
|
#endif/*__GPDMA_H__*/
|
||||||
|
@ -46,7 +46,6 @@ void sgpio_dma_configure_lli(
|
|||||||
const uint_fast8_t source_master = direction_transmit ? 1 : 0;
|
const uint_fast8_t source_master = direction_transmit ? 1 : 0;
|
||||||
const uint_fast8_t destination_master = direction_transmit ? 0 : 1;
|
const uint_fast8_t destination_master = direction_transmit ? 0 : 1;
|
||||||
const uint_fast8_t lli_fetch_master = direction_transmit ? 0 : 1;
|
const uint_fast8_t lli_fetch_master = direction_transmit ? 0 : 1;
|
||||||
const uint_fast8_t interrupt_after_this_lli = i & 1;
|
|
||||||
|
|
||||||
lli[i].csrcaddr = direction_transmit ? memory_address : peripheral_address;
|
lli[i].csrcaddr = direction_transmit ? memory_address : peripheral_address;
|
||||||
lli[i].cdestaddr = direction_transmit ? peripheral_address : memory_address;
|
lli[i].cdestaddr = direction_transmit ? peripheral_address : memory_address;
|
||||||
@ -64,7 +63,7 @@ void sgpio_dma_configure_lli(
|
|||||||
GPDMA_CCONTROL_PROT1(0) |
|
GPDMA_CCONTROL_PROT1(0) |
|
||||||
GPDMA_CCONTROL_PROT2(0) |
|
GPDMA_CCONTROL_PROT2(0) |
|
||||||
GPDMA_CCONTROL_PROT3(0) |
|
GPDMA_CCONTROL_PROT3(0) |
|
||||||
GPDMA_CCONTROL_I(interrupt_after_this_lli)
|
GPDMA_CCONTROL_I(0)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user