Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_dma

Driver for DMA. More...

Data Structures

struct  bc_dma_channel_config_t
 DMA channel configuration. More...
 

Enumerations

enum  bc_dma_channel_t {
  BC_DMA_CHANNEL_1 = 0,
  BC_DMA_CHANNEL_2 = 1,
  BC_DMA_CHANNEL_3 = 2,
  BC_DMA_CHANNEL_4 = 3,
  BC_DMA_CHANNEL_5 = 4,
  BC_DMA_CHANNEL_6 = 5,
  BC_DMA_CHANNEL_7 = 6
}
 DMA channels. More...
 
enum  bc_dma_request_t {
  BC_DMA_REQUEST_0 = 0,
  BC_DMA_REQUEST_1 = 1,
  BC_DMA_REQUEST_2 = 2,
  BC_DMA_REQUEST_3 = 3,
  BC_DMA_REQUEST_4 = 4,
  BC_DMA_REQUEST_5 = 5,
  BC_DMA_REQUEST_6 = 6,
  BC_DMA_REQUEST_7 = 7,
  BC_DMA_REQUEST_8 = 8,
  BC_DMA_REQUEST_9 = 9,
  BC_DMA_REQUEST_10 = 10,
  BC_DMA_REQUEST_11 = 11,
  BC_DMA_REQUEST_12 = 12,
  BC_DMA_REQUEST_13 = 13,
  BC_DMA_REQUEST_14 = 14,
  BC_DMA_REQUEST_15 = 15
}
 DMA requests. More...
 
enum  bc_dma_direction_t {
  BC_DMA_DIRECTION_TO_PERIPHERAL = 0,
  BC_DMA_DIRECTION_TO_RAM = 1
}
 DMA channel directions. More...
 
enum  bc_dma_size_t {
  BC_DMA_SIZE_1 = 0,
  BC_DMA_SIZE_2 = 1,
  BC_DMA_SIZE_4 = 2
}
 DMA channel data size. More...
 
enum  bc_dma_mode_t {
  BC_DMA_MODE_STANDARD = 0,
  BC_DMA_MODE_CIRCULAR = 1
}
 DMA channel mode. More...
 
enum  bc_dma_event_t {
  BC_DMA_EVENT_ERROR = 0,
  BC_DMA_EVENT_HALF_DONE = 1,
  BC_DMA_EVENT_DONE = 2
}
 DMA channel event. More...
 
enum  bc_dma_priority_t {
  BC_DMA_PRIORITY_LOW = 0,
  BC_DMA_PRIORITY_MEDIUM = 1,
  BC_DMA_PRIORITY_HIGH = 2,
  BC_DMA_PRIORITY_VERY_HIGH = 3
}
 DMA channel priority. More...
 

Functions

void bc_dma_init (void)
 Initialize DMA.
 
void bc_dma_channel_config (bc_dma_channel_t channel, bc_dma_channel_config_t *config)
 Configure DMA channel. More...
 
void bc_dma_set_event_handler (bc_dma_channel_t channel, void(*event_handler)(bc_dma_channel_t, bc_dma_event_t, void *), void *event_param)
 Set callback function. More...
 
void bc_dma_channel_run (bc_dma_channel_t channel)
 Start DMA channel. More...
 
void bc_dma_channel_stop (bc_dma_channel_t channel)
 Stop DMA channel. More...
 
size_t bc_dma_channel_get_length (bc_dma_channel_t channel)
 

Detailed Description

Driver for DMA.

Enumeration Type Documentation

DMA channels.

Enumerator
BC_DMA_CHANNEL_1 

DMA channel 1.

BC_DMA_CHANNEL_2 

DMA channel 2.

BC_DMA_CHANNEL_3 

DMA channel 3.

BC_DMA_CHANNEL_4 

DMA channel 4.

BC_DMA_CHANNEL_5 

DMA channel 5, used for SPI.

BC_DMA_CHANNEL_6 

DMA channel 6.

BC_DMA_CHANNEL_7 

DMA channel 7.

Definition at line 12 of file bc_dma.h.

DMA channel directions.

Enumerator
BC_DMA_DIRECTION_TO_PERIPHERAL 

DMA channel direction from RAM to peripheral.

BC_DMA_DIRECTION_TO_RAM 

DMA channel direction from peripheral to RAM.

Definition at line 93 of file bc_dma.h.

DMA channel event.

Enumerator
BC_DMA_EVENT_ERROR 

DMA channel event error.

BC_DMA_EVENT_HALF_DONE 

DMA channel event half done.

BC_DMA_EVENT_DONE 

DMA channel event done.

Definition at line 132 of file bc_dma.h.

DMA channel mode.

Enumerator
BC_DMA_MODE_STANDARD 

DMA channel mode standard.

BC_DMA_MODE_CIRCULAR 

DMA channel mode circular.

Definition at line 120 of file bc_dma.h.

DMA channel priority.

Enumerator
BC_DMA_PRIORITY_LOW 

DMA channel priority is low.

BC_DMA_PRIORITY_MEDIUM 

DMA channel priority is medium.

BC_DMA_PRIORITY_HIGH 

DMA channel priority is high.

BC_DMA_PRIORITY_VERY_HIGH 

DMA channel priority is very high.

Definition at line 147 of file bc_dma.h.

DMA requests.

Enumerator
BC_DMA_REQUEST_0 

DMA request 0.

BC_DMA_REQUEST_1 

DMA request 1.

BC_DMA_REQUEST_2 

DMA request 2.

BC_DMA_REQUEST_3 

DMA request 3.

BC_DMA_REQUEST_4 

DMA request 4.

BC_DMA_REQUEST_5 

DMA request 5.

BC_DMA_REQUEST_6 

DMA request 6.

BC_DMA_REQUEST_7 

DMA request 7.

BC_DMA_REQUEST_8 

DMA request 8.

BC_DMA_REQUEST_9 

DMA request 9.

BC_DMA_REQUEST_10 

DMA request 10.

BC_DMA_REQUEST_11 

DMA request 11.

BC_DMA_REQUEST_12 

DMA request 12.

BC_DMA_REQUEST_13 

DMA request 13.

BC_DMA_REQUEST_14 

DMA request 14.

BC_DMA_REQUEST_15 

DMA request 15.

Definition at line 39 of file bc_dma.h.

DMA channel data size.

Enumerator
BC_DMA_SIZE_1 

DMA channel data size 1B.

BC_DMA_SIZE_2 

DMA channel data size 2B.

BC_DMA_SIZE_4 

DMA channel data size 4B.

Definition at line 105 of file bc_dma.h.

Function Documentation

void bc_dma_channel_config ( bc_dma_channel_t  channel,
bc_dma_channel_config_t config 
)

Configure DMA channel.

Parameters
[in]channelDMA channel
[in]configPointer to DMA channel configuration

Definition at line 95 of file bc_dma.c.

Referenced by bc_dac_async_run(), bc_spi_async_transfer(), and bc_uart_async_read_start().

Here is the call graph for this function:

Here is the caller graph for this function:

void bc_dma_channel_run ( bc_dma_channel_t  channel)

Start DMA channel.

Parameters
[in]channelDMA channel

Definition at line 179 of file bc_dma.c.

Referenced by bc_dac_async_run(), bc_spi_async_transfer(), and bc_uart_async_read_start().

Here is the caller graph for this function:

void bc_dma_channel_stop ( bc_dma_channel_t  channel)

Stop DMA channel.

Parameters
[in]channelDMA channel

Definition at line 184 of file bc_dma.c.

Referenced by bc_dac_async_stop(), and bc_uart_async_read_cancel().

Here is the caller graph for this function:

void bc_dma_set_event_handler ( bc_dma_channel_t  channel,
void(*)(bc_dma_channel_t, bc_dma_event_t, void *)  event_handler,
void *  event_param 
)

Set callback function.

Parameters
[in]channelDMA channel
[in]event_handlerFunction address
[in]event_paramOptional event parameter (can be NULL)

Definition at line 173 of file bc_dma.c.

Referenced by bc_dac_async_run(), and bc_spi_init().

Here is the caller graph for this function: