DMA配置
1.DMA_configChannel(uint32_t base, const DMA_ConfigParams *config)
- function description: Sets the DMA to transfer data on the specified channel
- parameter description:
- input parameters:
base is the base address of the DMA channel control register config: configuration parameters
- return parameter:/
2.DMA_configAddress(uint32_t base, const void *destAddr, const void *srcAddr)
- function description: Configure DMA channel
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register destAddr: is the destination address srcAddr: is a source address
- return parameter:/
3.DMA_configBurst(uint32_t base, uint16_t size, int16_t srcStep, int16_t destStep)
- function description: Configure the burst setting of DMA channel
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register size: is the number of words transferred per burst, the possible number varies from 1 word to 32 words srcstep: is the amount by which the source address is incremented or decremented after each word of the burst deststep: isthe amount by which the destination address is incremented or decremented after each word of the burst, Specifies the address step that should be added to the source and destination addresses after each transfer word of the burst. Only signed values between -4096 and 4095 are valid
- return parameter:/
4.DMA_configTransfer(uint32_t base, uint32_t transferSize, int16_t srcStep, int16_t destStep)
- function description: Configure the transfer parameters of the specified DMA channel
- parameter description:
- input parameters:
base: The base address of the DMA module. This parameter identifies the DMA controller or channel to be configured. Transfer Size: Specifies the size of the data transfer in DMA transfers (for example, processor word size, such as bytes, halfwords, words). Srcstep: source address step value. The source address is incremented (or decremented) by this value after each transfer. A positive value indicates an address increment and a negative value indicates an address decrement. Deststep: destination address step value. The destination address is incremented (or decremented) by this value after each transfer. A positive value indicates an address increment and a negative value indicates an address decrement.
- return parameter:/
5.DMA_configMode(uint32_t base, DMA_Trigger trigger, uint32_t config)
- function description: Configures the DMA channel trigger and model
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register trigger: is the interrupt source that triggers the DMA transfer config: is a bit field that contains several configuration options
- return parameter:/
6.DMA_isBaseValid(uint32_t base)
- function description: Checks the DMA channel base address
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register
- return parameter:/
7.DMA_initController(void)
- function description: Initializes the DMA controller to a known state
- parameter description:
- input parameter:/
- return parameter:/
8.DMA_triggerSoftReset(void)
- function description: Channel soft reset
- parameter description:
- input parameter:/
- return parameter:/
9.DMA_setEmulationMode(DMA_EmulationMode mode)
- function description: Set DMA emulation mode
- parameter description:
- input parameters:
mode: emulation mode
- return parameters:
10.DMA_enableTrigger(uint32_t base)
- function description: Enables a peripheral device to trigger a DMA transfer
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register
- return parameters:
11.DMA_disableTrigger(uint32_t base)
- function description: Prohibit peripheral devices from triggering DMA transfers.
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register
- return parameters:
12.DMA_forceTrigger(uint32_t base)
- function description: Forces a peripheral trigger on the DMA channel
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register
- return parameters:
13.DMA_clearTriggerFlag(uint32_t base)
- function description: Clears the peripheral trigger flag of the DMA channel
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register
- return parameters:
14.DMA_getTransferStatusFlag(uint32_t base)
- function description: Gets the status of the transfer status flag of the DMA channel.
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register
- return parameters:
15.DMA_getBurstStatusFlag(uint32_t base)
- function description: Gets the status of the DMA channel burst status flag
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register
- return parameters:
16.DMA_getRunStatusFlag(uint32_t base)
- function description: Gets the status of the running status flag of the DMA channel.
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register
- return parameters:
17.DMA_getOverflowFlag(uint32_t base)
- function description: Gets the status of the DMA channel overflow flag
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register
- return parameters:
18.DMA_getTriggerFlagStatus(uint32_t base)
- function description: Gets the status of the peripheral trigger flag of the DMA channel.
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register
- return parameters:
19.DMA_startChannel(u8 channel)
- function description: Starts a DMA channel
- parameter description:
- input parameters:
channel: MDA channel
- return parameters:
20.DMA_stopChannel(u8 channel)
- function description: Stops the DMA channel
- parameter description:
- input parameters:
channel: MDA channel
- return parameters:
21.DMA_getInterruptStatus(uint32_t base)
- function description: Get DMA interrupt status
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register
- return parameters:
22.DMA_enableInterrupt(uint32_t base, u32 flag)
- function description: Start DMA interrupt
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register flag: flag bit
-Return parameters:
23.DMA_disableInterrupt(uint32_t base, u32 flag)
- function description: Disables DMA interrupt
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register flag: flag bit
- return parameters:
24.DMA_enableOverrunInterrupt(uint32_t base)
- function description: Enables DMA channel overflow interrupt
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register
- return parameters:
25.DMA_disableOverrunInterrupt(uint32_t base)
- function description: Disables DMA channel overflow interrupt
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register
- return parameters:
26.DMA_clearErrorFlag(uint32_t base, u32 flag)
- function description: Clears the DMA channel error flag
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register flag: flag bit
- return parameters:
27.DMA_setInterruptMode(uint32_t base, DMA_InterruptMode mode)
- function description: Set the interrupt generation mode of DMA channel interrupt
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register mode: is a flag that indicates the channel interrupt mode.
- return parameters:
28.DMA_setPriorityMode(bool ch1IsHighPri)
- function description: Sets the DMA channel priority mode
- parameter description:
- input parameters:
ch1IsHighPri: is a flag indicating the channel interrupt mode
- return parameters:
29.DMA_configSourceAddress(uint32_t base, const void *srcAddr)
- function description: Configure the source address of DMA channel
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register srcAddr: is a source address
- return parameters:
30.DMA_configDestAddress(uint32_t base, const void *destAddr)
- function description: Configure the destination address of the DMA channel
- parameter description:
- input parameters:
base: is the base address of the DMA channel control register srcAddr: is a destination address
- return parameters: