Synergy Software Package User's Manual

Driver for the Data Transfer Controller (DTC). More...

Data Structures

struct  dtc_instance_ctrl_t
 
struct  dtc_reg_t
 

Macros

#define DTC_REPEAT_BLOCK_MAX_LENGTH   (0x100)
 
#define DTC_NORMAL_MAX_LENGTH   (0x10000)
 

Functions

ssp_err_t R_DTC_Open (transfer_ctrl_t *const p_api_ctrl, transfer_cfg_t const *const p_cfg)
 Set transfer data in the vector table and enable transfer in ICU. Implements transfer_api_t::open. More...
 
ssp_err_t R_DTC_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. Implements transfer_api_t::reset. More...
 
ssp_err_t R_DTC_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_DTC_Stop (transfer_ctrl_t *const p_ctrl)
 Placeholder for unsupported stop function. Implements transfer_api_t::stop. More...
 
ssp_err_t R_DTC_Enable (transfer_ctrl_t *const p_api_ctrl)
 Enable transfer and ELC events if they are used for software start. Implements transfer_api_t::enable. More...
 
ssp_err_t R_DTC_Disable (transfer_ctrl_t *const p_api_ctrl)
 Disable transfer. Implements transfer_api_t::disable. More...
 
ssp_err_t R_DTC_InfoGet (transfer_ctrl_t *const p_api_ctrl, transfer_properties_t *const p_info)
 Set driver specific information. Implements transfer_api_t::infoGet. More...
 
ssp_err_t R_DTC_Close (transfer_ctrl_t *const p_api_ctrl)
 Disables transfer in the ICU, then clears transfer data from the DTC vector table. Implements transfer_api_t::close. More...
 
ssp_err_t R_DTC_VersionGet (ssp_version_t *const p_version)
 Set driver version based on compile time macros. Implements transfer_api_t::versionGet. More...
 
ssp_err_t R_DTC_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)
 BlockReset transfer source, destination, length and number of transfers. Implements transfer_api_t::blockReset. More...
 
ssp_err_t R_DTC_Stop_ActivationRequest (transfer_ctrl_t *const p_api_ctrl)
 Placeholder for unsupported DummyTransfer function. Implements transfer_api_t::Stop_ActivationRequest. More...
 

Detailed Description

Driver for the Data Transfer Controller (DTC).

Summary

Extends Transfer Interface.

The Data Transfer Controller allows data transfers to occur in place of or in addition to any interrupt. It does not support data transfers using software start.

Note
The transfer length is limited to 256 (8 bits) in TRANSFER_MODE_BLOCK and TRANSFER_MODE_REPEAT.

Macro Definition Documentation

◆ DTC_NORMAL_MAX_LENGTH

#define DTC_NORMAL_MAX_LENGTH   (0x10000)

Length limited to 65536 transfers for normal mode

◆ DTC_REPEAT_BLOCK_MAX_LENGTH

#define DTC_REPEAT_BLOCK_MAX_LENGTH   (0x100)

Length limited to 256 transfers for repeat and block mode

Function Documentation

◆ R_DTC_BlockReset()

ssp_err_t R_DTC_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 
)

BlockReset transfer source, destination, length and number of transfers. Implements transfer_api_t::blockReset.

Return values
SSP_SUCCESSTransfer reset successfully.
SSP_ERR_ASSERTIONAn input parameter is invalid.
SSP_ERR_NOT_OPENHandle is not initialized. Call R_DTC_Open to initialize the control block.
SSP_ERR_UNSUPPORTEDIf mode is other than Block Transfer Mode.
SSP_ERR_NOT_ENABLEDEnable failed due to an invalid input parameter:
  • Transfer source must not be NULL.
  • Transfer destination must not be NULL.

Disable transfers on this activation source.

Disable read skip prior to modifying settings. It will be enabled later.

Reset transfer based on input parameters.

Enables transfers on this activation source.

Enable read skip after all settings are complete.

◆ R_DTC_Close()

ssp_err_t R_DTC_Close ( transfer_ctrl_t *const  p_api_ctrl)

Disables transfer in the ICU, then clears transfer data from the DTC vector table. Implements transfer_api_t::close.

Return values
SSP_SUCCESSSuccessful close.
SSP_ERR_ASSERTIONAn input parameter is invalid.
SSP_ERR_NOT_OPENHandle is not initialized. Call R_DTC_Open to initialize the control block.
SSP_ERR_IRQ_BSP_DISABLEDThe IRQ associated with the p_ctrl is not enabled in the BSP.

Clear DTC enable bit in ICU.

Clear pointer in vector table.

◆ R_DTC_Disable()

ssp_err_t R_DTC_Disable ( transfer_ctrl_t *const  p_api_ctrl)

Disable transfer. Implements transfer_api_t::disable.

Return values
SSP_SUCCESSCounter value written successfully.
SSP_ERR_ASSERTIONAn input parameter is invalid.
SSP_ERR_NOT_OPENHandle is not initialized. Call R_DTC_Open to initialize the control block.

Disable transfer.

◆ R_DTC_Enable()

ssp_err_t R_DTC_Enable ( transfer_ctrl_t *const  p_api_ctrl)

Enable transfer and ELC events if they are used for software start. Implements transfer_api_t::enable.

Return values
SSP_SUCCESSCounter value written successfully.
SSP_ERR_ASSERTIONAn input parameter is invalid.
SSP_ERR_NOT_OPENHandle is not initialized. Call R_DTC_Open to initialize the control block.
SSP_ERR_IRQ_BSP_DISABLEDThe IRQ associated with the p_ctrl is not enabled in the BSP.

Enable transfer.

◆ R_DTC_InfoGet()

ssp_err_t R_DTC_InfoGet ( transfer_ctrl_t *const  p_api_ctrl,
transfer_properties_t *const  p_info 
)

Set driver specific information. Implements transfer_api_t::infoGet.

Return values
SSP_SUCCESSCounter value written successfully.
SSP_ERR_ASSERTIONAn input parameter is invalid.
SSP_ERR_NOT_OPENHandle is not initialized. Call R_DTC_Open to initialize the control block.

If a transfer is active, store it in p_in_progress.

Transfer information for the activation source is taken from DTC vector table.

Mask out the high byte in case of repeat transfer.

Store maximum transfer length.

◆ R_DTC_Open()

ssp_err_t R_DTC_Open ( transfer_ctrl_t *const  p_api_ctrl,
transfer_cfg_t const *const  p_cfg 
)

Set transfer data in the vector table and enable transfer in ICU. Implements transfer_api_t::open.

Return values
SSP_SUCCESSSuccessful open. Transfer is configured and will start when trigger occurs.
SSP_ERR_ASSERTIONAn input parameter is invalid.
SSP_ERR_IN_USEThe BSP hardware lock for the DTC is not available, or the index for this IRQ in the DTC vector table is already configured.
SSP_ERR_HW_LOCKEDDTC hardware resource is locked.
SSP_ERR_IRQ_BSP_DISABLEDThe IRQ associated with the activation source is not enabled in the BSP.
SSP_ERR_NOT_ENABLEDAuto-enable was requested, but enable failed due to an invalid input parameter.

Make sure the activation source is mapped in the ICU.

Make sure the activation source is not already being used by the DTC.

Configure the DTC transfer. See the hardware manual for details.

Update internal variables.

Mark driver as open by initializing it to "DTC" in its ASCII equivalent.

If auto_enable is true, enable transfer and ELC events if software start is used.

Enable read skip after all settings are complete.

◆ R_DTC_Reset()

ssp_err_t R_DTC_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. Implements transfer_api_t::reset.

Return values
SSP_SUCCESSTransfer reset successfully.
SSP_ERR_ASSERTIONAn input parameter is invalid.
SSP_ERR_NOT_OPENHandle is not initialized. Call R_DTC_Open to initialize the control block.
SSP_ERR_NOT_ENABLEDTransfer length must not be 0 for repeat and block mode, or enable failed due to an invalid input parameter:
  • Transfer source must not be NULL.
  • Transfer destination must not be NULL.

Disable transfers on this activation source.

Disable read skip prior to modifying settings. It will be enabled later.

Reset transfer based on input parameters.

Enables transfers on this activation source.

Enable read skip after all settings are complete.

◆ R_DTC_Start()

ssp_err_t R_DTC_Start ( transfer_ctrl_t *const  p_api_ctrl,
transfer_start_mode_t  mode 
)

Start transfer. Implements transfer_api_t::start.

Return values
SSP_SUCCESSTransfer started successfully.
SSP_ERR_ASSERTIONAn input parameter is invalid.
SSP_ERR_NOT_OPENHandle is not initialized. Call R_DMAC_Open to initialize the control block.
SSP_ERR_UNSUPPORTEDOne of the following is invalid:
  • Handle was not configured for software activation.
  • Mode not set to TRANSFER_START_MODE_SINGLE.
  • DTC_SOFTWARE_START_ENABLE set to 0 (disabled) in ssp_cfg/driver/r_dtc_cfg.h.

◆ R_DTC_Stop()

ssp_err_t R_DTC_Stop ( transfer_ctrl_t *const  p_ctrl)

Placeholder for unsupported stop function. Implements transfer_api_t::stop.

Return values
SSP_ERR_UNSUPPORTEDDTC software start is not supported.

Mark the input parameter as unused since this function isn't supported.

◆ R_DTC_Stop_ActivationRequest()

ssp_err_t R_DTC_Stop_ActivationRequest ( transfer_ctrl_t *const  p_api_ctrl)

Placeholder for unsupported DummyTransfer function. Implements transfer_api_t::Stop_ActivationRequest.

Return values
SSP_ERR_UNSUPPORTEDR_DTC_Stop_ActivationRequest function is not implemented, Its just a placeholder .

Mark the input parameter as unused since this function isn't supported.

◆ R_DTC_VersionGet()

ssp_err_t R_DTC_VersionGet ( ssp_version_t *const  p_version)

Set driver version based on compile time macros. Implements transfer_api_t::versionGet.

Return values
SSP_SUCCESSSuccessful close.
SSP_ERR_ASSERTIONAn input parameter is invalid.

Set driver version based on compile time macros