RA Flexible Software Package Documentation
Release v5.6.0
|
|
Interface for data transfer functions.
The transfer interface supports background data transfer (no CPU intervention).
Data Structures | |
struct | transfer_callback_args_t |
struct | transfer_properties_t |
struct | transfer_info_t |
struct | transfer_cfg_t |
struct | transfer_api_t |
struct | transfer_instance_t |
Typedefs | |
typedef void | transfer_ctrl_t |
Enumerations | |
enum | transfer_mode_t |
enum | transfer_size_t |
enum | transfer_addr_mode_t |
enum | transfer_repeat_area_t |
enum | transfer_chain_mode_t |
enum | transfer_irq_t |
enum | transfer_start_mode_t |
struct transfer_callback_args_t |
Callback function parameter data.
Data Fields | ||
---|---|---|
void const * | p_context | Placeholder for user data. Set in transfer_api_t::open function in transfer_cfg_t. |
struct transfer_properties_t |
struct transfer_info_t |
This structure specifies the properties of the transfer.
Data Fields | ||
---|---|---|
union transfer_info_t | __unnamed__ | |
void const *volatile | p_src | Source pointer. |
void *volatile | p_dest | Destination pointer. |
volatile uint16_t | num_blocks |
Number of blocks to transfer when using TRANSFER_MODE_BLOCK (both DTC an DMAC) or TRANSFER_MODE_REPEAT (DMAC only) or TRANSFER_MODE_REPEAT_BLOCK (DMAC only), unused in other modes. |
volatile uint16_t | length |
Length of each transfer. Range limited for TRANSFER_MODE_BLOCK, TRANSFER_MODE_REPEAT, and TRANSFER_MODE_REPEAT_BLOCK see HAL driver for details. |
struct transfer_cfg_t |
Driver configuration set in transfer_api_t::open. All elements except p_extend are required and must be initialized.
Data Fields | ||
---|---|---|
transfer_info_t * | p_info |
Pointer to transfer configuration options. If using chain transfer (DTC only), this can be a pointer to an array of chained transfers that will be completed in order. |
void const * | p_extend | Extension parameter for hardware specific settings. |
struct transfer_api_t |
Transfer functions implemented at the HAL layer will follow this API.
Data Fields | |
fsp_err_t(* | open )(transfer_ctrl_t *const p_ctrl, transfer_cfg_t const *const p_cfg) |
fsp_err_t(* | reconfigure )(transfer_ctrl_t *const p_ctrl, transfer_info_t *p_info) |
fsp_err_t(* | reset )(transfer_ctrl_t *const p_ctrl, void const *p_src, void *p_dest, uint16_t const num_transfers) |
fsp_err_t(* | enable )(transfer_ctrl_t *const p_ctrl) |
fsp_err_t(* | disable )(transfer_ctrl_t *const p_ctrl) |
fsp_err_t(* | softwareStart )(transfer_ctrl_t *const p_ctrl, transfer_start_mode_t mode) |
fsp_err_t(* | softwareStop )(transfer_ctrl_t *const p_ctrl) |
fsp_err_t(* | infoGet )(transfer_ctrl_t *const p_ctrl, transfer_properties_t *const p_properties) |
fsp_err_t(* | close )(transfer_ctrl_t *const p_ctrl) |
fsp_err_t(* | reload )(transfer_ctrl_t *const p_ctrl, void const *p_src, void *p_dest, uint32_t const num_transfers) |
fsp_err_t(* | callbackSet )(transfer_ctrl_t *const p_ctrl, void(*p_callback)(transfer_callback_args_t *), void const *const p_context, transfer_callback_args_t *const p_callback_memory) |
fsp_err_t(* transfer_api_t::open) (transfer_ctrl_t *const p_ctrl, transfer_cfg_t const *const p_cfg) |
Initial configuration.
[in,out] | p_ctrl | Pointer to control block. Must be declared by user. Elements set here. |
[in] | p_cfg | Pointer to configuration structure. All elements of this structure must be set by user. |
fsp_err_t(* transfer_api_t::reconfigure) (transfer_ctrl_t *const p_ctrl, transfer_info_t *p_info) |
Reconfigure the transfer. Enable the transfer if p_info is valid.
[in,out] | p_ctrl | Pointer to control block. Must be declared by user. Elements set here. |
[in] | p_info | Pointer to a new transfer info structure. |
fsp_err_t(* transfer_api_t::reset) (transfer_ctrl_t *const p_ctrl, void const *p_src, void *p_dest, uint16_t const num_transfers) |
Reset source address pointer, destination address pointer, and/or length, keeping all other settings the same. Enable the transfer if p_src, p_dest, and length are valid.
[in] | p_ctrl | Control block set in transfer_api_t::open call for this transfer. |
[in] | p_src | Pointer to source. Set to NULL if source pointer should not change. |
[in] | p_dest | Pointer to destination. Set to NULL if destination pointer should not change. |
[in] | num_transfers | Transfer length in normal mode or number of blocks in block mode. In DMAC only, resets number of repeats (initially stored in transfer_info_t::num_blocks) in repeat mode. Not used in repeat mode for DTC. |
fsp_err_t(* transfer_api_t::enable) (transfer_ctrl_t *const p_ctrl) |
Enable transfer. Transfers occur after the activation source event (or when transfer_api_t::softwareStart is called if no peripheral event is chosen as activation source).
[in] | p_ctrl | Control block set in transfer_api_t::open call for this transfer. |
fsp_err_t(* transfer_api_t::disable) (transfer_ctrl_t *const p_ctrl) |
Disable transfer. Transfers do not occur after the activation source event (or when transfer_api_t::softwareStart is called if no peripheral event is chosen as the DMAC activation source).
[in] | p_ctrl | Control block set in transfer_api_t::open call for this transfer. |
fsp_err_t(* transfer_api_t::softwareStart) (transfer_ctrl_t *const p_ctrl, transfer_start_mode_t mode) |
Start transfer in software.
[in] | p_ctrl | Control block set in transfer_api_t::open call for this transfer. |
[in] | mode | Select mode from transfer_start_mode_t. |
fsp_err_t(* transfer_api_t::softwareStop) (transfer_ctrl_t *const p_ctrl) |
Stop transfer in software. The transfer will stop after completion of the current transfer.
[in] | p_ctrl | Control block set in transfer_api_t::open call for this transfer. |
fsp_err_t(* transfer_api_t::infoGet) (transfer_ctrl_t *const p_ctrl, transfer_properties_t *const p_properties) |
Provides information about this transfer.
[in] | p_ctrl | Control block set in transfer_api_t::open call for this transfer. |
[out] | p_properties | Driver specific information. |
fsp_err_t(* transfer_api_t::close) (transfer_ctrl_t *const p_ctrl) |
Releases hardware lock. This allows a transfer to be reconfigured using transfer_api_t::open.
[in] | p_ctrl | Control block set in transfer_api_t::open call for this transfer. |
fsp_err_t(* transfer_api_t::reload) (transfer_ctrl_t *const p_ctrl, void const *p_src, void *p_dest, uint32_t const num_transfers) |
To update next transfer information without interruption during transfer. Allow further transfer continuation.
[in] | p_ctrl | Control block set in transfer_api_t::open call for this transfer. |
[in] | p_src | Pointer to source. Set to NULL if source pointer should not change. |
[in] | p_dest | Pointer to destination. Set to NULL if destination pointer should not change. |
[in] | num_transfers | Transfer length in normal mode or block mode. |
fsp_err_t(* transfer_api_t::callbackSet) (transfer_ctrl_t *const p_ctrl, void(*p_callback)(transfer_callback_args_t *), void const *const p_context, transfer_callback_args_t *const p_callback_memory) |
Specify callback function and optional context pointer and working memory pointer.
[in] | p_ctrl | Control block set in transfer_api_t::open call for this transfer. |
[in] | p_callback | Callback function to register |
[in] | p_context | Pointer to send to callback function |
[in] | p_callback_memory | Pointer to volatile memory where callback structure can be allocated. Callback arguments allocated here are only valid during the callback. |
struct transfer_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
Data Fields | ||
---|---|---|
transfer_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
transfer_cfg_t const * | p_cfg | Pointer to the configuration structure for this instance. |
transfer_api_t const * | p_api | Pointer to the API structure for this instance. |
typedef void transfer_ctrl_t |
Transfer control block. Allocate an instance specific control block to pass into the transfer API calls.
enum transfer_mode_t |
Transfer mode describes what will happen when a transfer request occurs.
Enumerator | |
---|---|
TRANSFER_MODE_NORMAL | In normal mode, each transfer request causes a transfer of transfer_size_t from the source pointer to the destination pointer. The transfer length is decremented and the source and address pointers are updated according to transfer_addr_mode_t. After the transfer length reaches 0, transfer requests will not cause any further transfers. |
TRANSFER_MODE_REPEAT | Repeat mode is like normal mode, except that when the transfer length reaches 0, the pointer to the repeat area and the transfer length will be reset to their initial values. If DMAC is used, the transfer repeats only transfer_info_t::num_blocks times. After the transfer repeats transfer_info_t::num_blocks times, transfer requests will not cause any further transfers. If DTC is used, the transfer repeats continuously (no limit to the number of repeat transfers). |
TRANSFER_MODE_BLOCK | In block mode, each transfer request causes transfer_info_t::length transfers of transfer_size_t. After each individual transfer, the source and destination pointers are updated according to transfer_addr_mode_t. After the block transfer is complete, transfer_info_t::num_blocks is decremented. After the transfer_info_t::num_blocks reaches 0, transfer requests will not cause any further transfers. |
TRANSFER_MODE_REPEAT_BLOCK | In addition to block mode features, repeat-block mode supports a ring buffer of blocks and offsets within a block (to split blocks into arrays of their first data, second data, etc.) |
enum transfer_size_t |
Transfer size specifies the size of each individual transfer. Total transfer length = transfer_size_t * transfer_length_t
enum transfer_addr_mode_t |
Address mode specifies whether to modify (increment or decrement) pointer after each transfer.
Enumerator | |
---|---|
TRANSFER_ADDR_MODE_FIXED | Address pointer remains fixed after each transfer. |
TRANSFER_ADDR_MODE_OFFSET | Offset is added to the address pointer after each transfer. |
TRANSFER_ADDR_MODE_INCREMENTED | Address pointer is incremented by associated transfer_size_t after each transfer. |
TRANSFER_ADDR_MODE_DECREMENTED | Address pointer is decremented by associated transfer_size_t after each transfer. |
Repeat area options (source or destination). In TRANSFER_MODE_REPEAT, the selected pointer returns to its original value after transfer_info_t::length transfers. In TRANSFER_MODE_BLOCK and TRANSFER_MODE_REPEAT_BLOCK, the selected pointer returns to its original value after each transfer.
Enumerator | |
---|---|
TRANSFER_REPEAT_AREA_DESTINATION | Destination area repeated in TRANSFER_MODE_REPEAT or TRANSFER_MODE_BLOCK or TRANSFER_MODE_REPEAT_BLOCK. |
TRANSFER_REPEAT_AREA_SOURCE | Source area repeated in TRANSFER_MODE_REPEAT or TRANSFER_MODE_BLOCK or TRANSFER_MODE_REPEAT_BLOCK. |
Chain transfer mode options.
Enumerator | |
---|---|
TRANSFER_CHAIN_MODE_DISABLED | Chain mode not used. |
TRANSFER_CHAIN_MODE_EACH | Switch to next transfer after a single transfer from this transfer_info_t. |
TRANSFER_CHAIN_MODE_END | Complete the entire transfer defined in this transfer_info_t before chaining to next transfer. |
enum transfer_irq_t |
Interrupt options.