54static volatile struct channel_ctrl channel_config[UDMA_CONF_MAX_CHANNEL + 1]
55 __attribute__ ((section(
".udma_channel_control_table")));
67 memset((
void *)&channel_config, 0,
sizeof(channel_config));
80 if(channel > UDMA_CONF_MAX_CHANNEL) {
84 channel_config[channel].src_end_ptr = src_end;
90 if(channel > UDMA_CONF_MAX_CHANNEL) {
94 channel_config[channel].dst_end_ptr = dst_end;
100 if(channel > UDMA_CONF_MAX_CHANNEL) {
104 channel_config[channel].ctrl_word = ctrl;
113 if(channel > UDMA_CONF_MAX_CHANNEL) {
118 base_chmap += (channel >> 3) * 4;
121 shift = (channel & 0x07);
124 REG(base_chmap) = (REG(base_chmap) & ~(0x0F << shift)) | (enc << shift);
130 if(channel > UDMA_CONF_MAX_CHANNEL) {
140 if(channel > UDMA_CONF_MAX_CHANNEL) {
151 if(channel > UDMA_CONF_MAX_CHANNEL) {
161 if(channel > UDMA_CONF_MAX_CHANNEL) {
172 if(channel > UDMA_CONF_MAX_CHANNEL) {
182 if(channel > UDMA_CONF_MAX_CHANNEL) {
193 if(channel > UDMA_CONF_MAX_CHANNEL) {
203 if(channel > UDMA_CONF_MAX_CHANNEL) {
214 if(channel > UDMA_CONF_MAX_CHANNEL) {
224 if(channel > UDMA_CONF_MAX_CHANNEL) {
235 if(channel > UDMA_CONF_MAX_CHANNEL) {
245 if(channel > UDMA_CONF_MAX_CHANNEL) {
249 return (channel_config[channel].ctrl_word & 0x07);
Header file for the cc2538 devices definitions.
@ UDMA_ERR_IRQn
µDMA Error Interrupt
@ UDMA_SW_IRQn
µDMA Software Interrupt
#define CC2538_DEV_RLSRAM_ADDR
Regular-leakage SRAM address.
bool udma_is_valid_source_address(uintptr_t source_address)
Checks if data can be DMAed from the given address.
void udma_set_channel_dst(uint8_t channel, uint32_t dst_end)
Sets the channel's destination address.
void udma_init()
Initialise the uDMA driver.
void udma_channel_mask_set(uint8_t channel)
Disable peripheral triggers for a uDMA channel.
#define UDMA_ERRCLR
DMA bus error clear.
void udma_channel_enable(uint8_t channel)
Enables a uDMA channel.
#define UDMA_ALTCLR
DMA channel primary alternate clear.
uint8_t udma_channel_get_mode(uint8_t channel)
Retrieve the current mode for a channel.
void udma_channel_sw_request(uint8_t channel)
Generate a software trigger to start a transfer.
void udma_channel_use_burst(uint8_t channel)
Configure a channel to only use burst transfers.
#define UDMA_CFG
DMA configuration.
#define UDMA_PRIOCLR
DMA channel priority clear.
#define UDMA_USEBURSTCLR
DMA channel useburst clear.
#define UDMA_PRIOSET
DMA channel priority set.
void udma_channel_disable(uint8_t channel)
Disables a uDMA channel.
#define UDMA_SWREQ
DMA channel software request.
void udma_channel_prio_set_high(uint8_t channel)
Set a uDMA channel to high priority.
void udma_channel_mask_clr(uint8_t channel)
Enable peripheral triggers for a uDMA channel.
void udma_set_channel_control_word(uint8_t channel, uint32_t ctrl)
Configure the channel's control word.
#define UDMA_ENASET
DMA channel enable set.
#define UDMA_USEBURSTSET
DMA channel useburst set.
#define UDMA_REQMASKCLR
DMA channel request mask clear.
#define UDMA_CHIS_CHIS
Channel [n] interrupt status.
#define UDMA_CHIS
DMA channel interrupt status.
#define UDMA_ALTSET
DMA channel primary alternate set.
void udma_set_channel_assignment(uint8_t channel, uint8_t enc)
Choose an encoding for a uDMA channel.
#define UDMA_CHMAP0
DMA channel map select 0.
#define UDMA_REQMASKSET
DMA channel request mask set.
void udma_channel_use_single(uint8_t channel)
Configure a channel to use single as well as burst requests.
#define UDMA_ENACLR
DMA channel enable clear.
#define UDMA_CTLBASE
DMA channel control base pointer.
void udma_channel_use_primary(uint8_t channel)
Use the primary control data structure for a channel.
void udma_channel_prio_set_default(uint8_t channel)
Set a uDMA channel to default priority.
void udma_set_channel_src(uint8_t channel, uint32_t src_end)
Sets the channels source address.
void udma_channel_use_alternate(uint8_t channel)
Use the alternate control data structure for a channel.
#define UDMA_CFG_MASTEN
Controller master enable.
Header file for the ARM Nested Vectored Interrupt Controller.
Header file with register manipulation macro definitions.
Header file with register, macro and function declarations for the cc2538 micro-DMA controller module...