![]() |
Synergy Software Package User's Manual
|
DMA Controller (DMAC). More...
Data Structures | |
| struct | dmac_instance_ctrl_t |
| struct | transfer_on_dmac_cfg_t |
Macros | |
| #define | DMAC_REPEAT_BLOCK_MAX_LENGTH (0x400) |
| #define | DMAC_NORMAL_MAX_LENGTH (0xFFFF) |
| #define | DUMMY_ADDRESS ((void *) 0x40005500) |
Functions | |
| ssp_err_t | R_DMAC_Open (transfer_ctrl_t *const p_api_ctrl, transfer_cfg_t const *const p_cfg) |
| Initialize transfer and enables transfer in ICU. Implements transfer_api_t::open. More... | |
| ssp_err_t | R_DMAC_Reset (transfer_ctrl_t *const p_api_ctrl, void const *volatile p_src, void *volatile p_dest, uint16_t const num_transfers) |
| Reset transfer source, destination, and number of transfers. More... | |
| ssp_err_t | R_DMAC_Start (transfer_ctrl_t *const p_api_ctrl, transfer_start_mode_t mode) |
| Start transfer. Implements transfer_api_t::start. More... | |
| ssp_err_t | R_DMAC_Stop (transfer_ctrl_t *const p_api_ctrl) |
| Stop transfer. Implements transfer_api_t::stop. More... | |
| ssp_err_t | R_DMAC_Enable (transfer_ctrl_t *const p_api_ctrl) |
| Enable transfer. Implements transfer_api_t::enable. More... | |
| ssp_err_t | R_DMAC_Disable (transfer_ctrl_t *const p_api_ctrl) |
| Disable transfer. Implements transfer_api_t::disable. More... | |
| ssp_err_t | R_DMAC_InfoGet (transfer_ctrl_t *const p_api_ctrl, transfer_properties_t *const p_info) |
| Set driver specific information in provided pointer. Implements transfer_api_t::infoGet. More... | |
| ssp_err_t | R_DMAC_Close (transfer_ctrl_t *const p_api_ctrl) |
| Disable transfer and clean up internal data. Implements transfer_api_t::close. More... | |
| ssp_err_t | R_DMAC_VersionGet (ssp_version_t *const p_version) |
| Set driver version based on compile time macros. More... | |
| ssp_err_t | R_DMAC_BlockReset (transfer_ctrl_t *const p_api_ctrl, void const *volatile p_src, void *volatile p_dest, uint16_t const length, transfer_size_t size, uint16_t const num_transfers) |
| Reset transfer source, destination, length and number of transfers for block transfer. More... | |
| ssp_err_t | R_DMAC_Stop_ActivationRequest (transfer_ctrl_t *const p_api_ctrl) |
| Clears the DMA activation request with a DMA dummy transfer as per flowchart in the hardware manual. Implements transfer_api_t::Stop_ActivationRequest. This function to be used only in scenario when a DMA activation request source might occur in the next request after a DMA transfer completes. If this happens, the DMA transfer starts and the DMA activation request is held in DMAC. More... | |
DMA Controller (DMAC).
Extends the Transfer Interface.
The Direct Memory Access (DMA) Controller allows data transfers to occur in place of or in addition to any interrupt. It also supports data transfers using software start.
| #define DMAC_NORMAL_MAX_LENGTH (0xFFFF) |
Length limited to 65535 transfers for normal mode
| #define DMAC_REPEAT_BLOCK_MAX_LENGTH (0x400) |
Length limited to 1024 transfers for repeat and block mode
| #define DUMMY_ADDRESS ((void *) 0x40005500) |
Reserved memory area for dummy write transfer as per Hardware user manual
| ssp_err_t R_DMAC_BlockReset | ( | transfer_ctrl_t *const | p_api_ctrl, |
| void const *volatile | p_src, | ||
| void *volatile | p_dest, | ||
| uint16_t const | length, | ||
| transfer_size_t | size, | ||
| uint16_t const | num_transfers | ||
| ) |
Reset transfer source, destination, length and number of transfers for block transfer.
| SSP_SUCCESS | Transfer reset successfully. |
| SSP_ERR_ASSERTION | An input parameter is invalid. |
| SSP_ERR_IN_USE | Transfer is in progress. Wait for transfer to complete. |
| SSP_ERR_NOT_ENABLED | DMAC is not enabled. A valid source and destination must be provided in either open() or blockReset(). |
Enables transfers on this activation source.
| ssp_err_t R_DMAC_Close | ( | transfer_ctrl_t *const | p_api_ctrl | ) |
Disable transfer and clean up internal data. Implements transfer_api_t::close.
| SSP_SUCCESS | Successful close. |
| SSP_ERR_ASSERTION | An input parameter is invalid. |
| SSP_ERR_NOT_OPEN | Handle is not initialized. Call R_DMAC_Open to initialize the control block. |
| SSP_ERR_IN_USE | Transfer is in progress. Wait for transfer to complete. |
Disable DMAC transfers, disable DMAC interrupts, and remove DMAC trigger from ICU register.
Clear ID so control block can be reused.
Release BSP hardware lock on this channel
| ssp_err_t R_DMAC_Disable | ( | transfer_ctrl_t *const | p_api_ctrl | ) |
Disable transfer. Implements transfer_api_t::disable.
| SSP_SUCCESS | Counter value written successfully. |
| SSP_ERR_ASSERTION | An input parameter is invalid. |
| SSP_ERR_NOT_OPEN | Handle is not initialized. Call R_DMAC_Open to initialize the control block. |
Disable transfer.
| ssp_err_t R_DMAC_Enable | ( | transfer_ctrl_t *const | p_api_ctrl | ) |
Enable transfer. Implements transfer_api_t::enable.
| SSP_SUCCESS | Counter value written successfully. |
| SSP_ERR_ASSERTION | An input parameter is invalid. |
| SSP_ERR_NOT_OPEN | Handle is not initialized. Call R_DMAC_Open to initialize the control block. |
Enable transfer.
| ssp_err_t R_DMAC_InfoGet | ( | transfer_ctrl_t *const | p_api_ctrl, |
| transfer_properties_t *const | p_info | ||
| ) |
Set driver specific information in provided pointer. Implements transfer_api_t::infoGet.
| SSP_SUCCESS | Counter value written successfully. |
| SSP_ERR_NOT_OPEN | Handle is not initialized. Call R_DMAC_Open to initialize the control block. |
| SSP_ERR_ASSERTION | An input parameter is invalid. |
If a transfer is active, store it in p_in_progress.
Store maximum transfer length.
Store remaining transfer length.
| ssp_err_t R_DMAC_Open | ( | transfer_ctrl_t *const | p_api_ctrl, |
| transfer_cfg_t const *const | p_cfg | ||
| ) |
Initialize transfer and enables transfer in ICU. Implements transfer_api_t::open.
| SSP_SUCCESS | Successful open. Transfer is configured and will start when trigger occurs. |
| SSP_ERR_ASSERTION | An input parameter is invalid. |
| SSP_ERR_NOT_ENABLED | Auto-enable was requested, but enable failed. |
| SSP_ERR_IRQ_BSP_DISABLED | The IRQ associated with the activation source is not enabled in the BSP. |
| SSP_ERR_INVALID_SIZE | Invalid offset value. |
| SSP_ERR_IN_USE | The BSP hardware lock for the DMAC is not available. |
Get the IRQ vectors, event info and set the NVIC priority for dmac.
Acquire BSP hardware lock for channel used.
Configure the DMAC according to the flowchart "Activating the DMAC" in chapter 16.3.7 of hardware manual NoSecurity_r01uh0488ej0040_sc32.pdf.
Set the offset value in offset addressing mode.
Configure DMA transfer and sources
Update internal variables.
Mark driver as open by initializing "DMAC" in its ASCII equivalent.
If auto_enable is true, enable transfer and ELC events if software start is used.
| ssp_err_t R_DMAC_Reset | ( | transfer_ctrl_t *const | p_api_ctrl, |
| void const *volatile | p_src, | ||
| void *volatile | p_dest, | ||
| uint16_t const | num_transfers | ||
| ) |
Reset transfer source, destination, and number of transfers.
| SSP_SUCCESS | Transfer reset successfully. |
| SSP_ERR_ASSERTION | An input parameter is invalid. |
| SSP_ERR_NOT_ENABLED | DMAC is not enabled. A valid source and destination must be provided in either open() or reset(). |
| SSP_ERR_IN_USE | Transfer is in progress. Wait for transfer to complete. |
Enables transfers on this activation source.
| ssp_err_t R_DMAC_Start | ( | transfer_ctrl_t *const | p_api_ctrl, |
| transfer_start_mode_t | mode | ||
| ) |
Start transfer. Implements transfer_api_t::start.
| SSP_SUCCESS | Transfer started written successfully. |
| SSP_ERR_ASSERTION | An input parameter is invalid. |
| SSP_ERR_NOT_OPEN | Handle is not initialized. Call R_DMAC_Open to initialize the control block. |
| SSP_ERR_UNSUPPORTED | Handle was not configured for software activation. |
Set autoclear bit and software start bit.
| ssp_err_t R_DMAC_Stop | ( | transfer_ctrl_t *const | p_api_ctrl | ) |
Stop transfer. Implements transfer_api_t::stop.
| SSP_SUCCESS | Transfer stopped written successfully. |
| SSP_ERR_ASSERTION | An input parameter is invalid. |
| SSP_ERR_NOT_OPEN | Handle is not initialized. Call R_DMAC_Open to initialize the control block. |
Reset auto clear bit and clear software transfer request.
| ssp_err_t R_DMAC_Stop_ActivationRequest | ( | transfer_ctrl_t *const | p_api_ctrl | ) |
Clears the DMA activation request with a DMA dummy transfer as per flowchart in the hardware manual. Implements transfer_api_t::Stop_ActivationRequest. This function to be used only in scenario when a DMA activation request source might occur in the next request after a DMA transfer completes. If this happens, the DMA transfer starts and the DMA activation request is held in DMAC.
| SSP_SUCCESS | Successful transfer. |
| SSP_ERR_ASSERTION | An input parameter is invalid. |
| SSP_ERR_NOT_OPEN | Handle is not initialized. Call R_DMAC_Open to initialize the control block. |
Clear the DMA activation request with a DMA dummy transfer as per flowchart in the hardware manual.
Disable DMAC transfer.
Disable the IRQ pin as a DMACm request source
Set the DMAC transfer size
Set source and destination address to 4000_5500 as per hardware manual.
Set number of transfer operations
Disable DMAC transfer.
Wait for the DMAC transfer end
| ssp_err_t R_DMAC_VersionGet | ( | ssp_version_t *const | p_version | ) |
Set driver version based on compile time macros.
| SSP_SUCCESS | Successful close. |
| SSP_ERR_ASSERTION | An input parameter is invalid. |