Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
renesas_rx_dtc.h File Reference

Renesas RX DTC Driver Header File. More...

Go to the source code of this file.

Data Structures

struct  st_transfer_info
 Transfer information structure. More...
struct  st_transfer_properties
 Detailed transfer properties. More...
struct  dtc_transfer_status
 DTC transfer status. More...

Macros

Renesas RX DTC driver definitions.
#define DTC_PLACE_IN_SECTION(x)
 Attribute to place variable in a specific section.
#define DTC_ALIGN_VARIABLE(x)
 Attribute to align variable.
#define DTC_SECTION_ATTRIBUTE    DTC_PLACE_IN_SECTION(".dtc_vector_table")
 DTC vector table section attribute.
#define DTC_VECTOR_TABLE_ENTRIES   (CONFIG_NUM_IRQS)
 Number of DTC vector entries.
#define DTC_PRV_ACT_BIT_MASK   (1 << 15)
 DTC Active flag (DTCSTS.ACT) bit mask.
#define DTC_PRV_VECT_NR_MASK   (0x00FF)
 DTC-Activating Vector Number bits mask.
#define DTC_PRV_MASK_CRAL   (0xFFU)
 Counter Register A Lower Byte Mask.
#define DTC_PRV_OFFSET_CRAH   (8U)
 Counter Register A Upper Byte Offset.
#define DTC_MAX_NORMAL_TRANSFER_LENGTH    (0x10000)
 Max configurable number of transfers in NORMAL MODE.
#define DTC_MAX_REPEAT_TRANSFER_LENGTH    (0x100)
 Max number of transfers per repeat for REPEAT MODE.
#define DTC_MAX_BLOCK_TRANSFER_LENGTH    (0x100)
 Max number of transfers per block in BLOCK MODE.
#define DTC_MAX_BLOCK_COUNT    (0x10000)
 Max configurable number of blocks to transfer in BLOCK MODE.

Typedefs

typedef enum e_transfer_addr_mode transfer_addr_mode_t
 Transfer address mode.
typedef enum e_transfer_repeat_area transfer_repeat_area_t
 Area that repeats during repeat transfer mode.
typedef enum e_transfer_irq transfer_irq_t
 Transfer interrupt type.
typedef enum e_transfer_chain_mode transfer_chain_mode_t
typedef enum e_transfer_size transfer_size_t
 Transfer data size.
typedef enum e_transfer_mode transfer_mode_t
 Transfer mode.
typedef enum e_dtc_act_status dtc_act_status_t
 DTC activation status.
typedef struct st_transfer_info transfer_info_t
 Transfer information structure.
typedef struct st_transfer_properties transfer_properties_t
 Detailed transfer properties.

Enumerations

enum  e_transfer_addr_mode { TRANSFER_ADDR_MODE_FIXED = 0 , TRANSFER_ADDR_MODE_OFFSET = 1 , TRANSFER_ADDR_MODE_INCREMENTED = 2 , TRANSFER_ADDR_MODE_DECREMENTED = 3 }
 Transfer address mode. More...
enum  e_transfer_repeat_area { TRANSFER_REPEAT_AREA_DESTINATION = 0 , TRANSFER_REPEAT_AREA_SOURCE = 1 }
 Area that repeats during repeat transfer mode. More...
enum  e_transfer_irq { TRANSFER_IRQ_END = 0 , TRANSFER_IRQ_EACH = 1 }
 Transfer interrupt type. More...
enum  e_transfer_chain_mode { TRANSFER_CHAIN_MODE_DISABLED = 0 , TRANSFER_CHAIN_MODE_EACH = 2 , TRANSFER_CHAIN_MODE_END = 3 }
enum  e_transfer_size { TRANSFER_SIZE_1_BYTE = 0 , TRANSFER_SIZE_2_BYTE = 1 , TRANSFER_SIZE_4_BYTE = 2 }
 Transfer data size. More...
enum  e_transfer_mode { TRANSFER_MODE_NORMAL = 0 , TRANSFER_MODE_REPEAT = 1 , TRANSFER_MODE_BLOCK = 2 , TRANSFER_MODE_REPEAT_BLOCK = 3 }
 Transfer mode. More...
enum  e_dtc_act_status { DTC_ACT_IDLE = 0 , DTC_ACT_CONFIGURED = 1 , DTC_ACT_IN_PROGRESS = 2 }
 DTC activation status. More...

Functions

int dtc_renesas_rx_off (const struct device *dev)
 Turn off module DTC.
int dtc_renesas_rx_on (const struct device *dev)
 Turn on module DTC.
int dtc_renesas_rx_configuration (const struct device *dev, uint8_t activation_irq, transfer_info_t *p_info)
 Configure the p_info state and write p_info to DTC vector table.
int dtc_renesas_rx_enable_transfer (uint8_t activation_irq)
 Enable transfer in ICU on this activation source.
int dtc_renesas_rx_disable_transfer (uint8_t activation_irq)
 Disable transfer in ICU on this activation source.
int dtc_renesas_rx_start_transfer (const struct device *dev, uint8_t activation_irq)
 Start transfers on this activation source.
int dtc_renesas_rx_stop_transfer (const struct device *dev, uint8_t activation_irq)
 Stop transfers on this activation source.
int dtc_renesas_rx_reset_transfer (const struct device *dev, uint8_t activation_irq, void const *p_src, void *p_dest, uint16_t const num_transfers)
 Reset transfer on this activation source.
void dtc_renesas_rx_get_transfer_status (const struct device *dev, struct dtc_transfer_status *status)
 Get status transfer of DTC module and store it into status pointer.
int dtc_renesas_rx_info_get (const struct device *dev, uint8_t activation_irq, transfer_properties_t *const p_properties)
 Get information about this transfer and store it into p_properties.
static ALWAYS_INLINE bool is_valid_activation_irq (uint8_t activation_irq)

Detailed Description

Renesas RX DTC Driver Header File.

Macro Definition Documentation

◆ DTC_ALIGN_VARIABLE

#define DTC_ALIGN_VARIABLE ( x)
Value:
__aligned(x)

Attribute to align variable.

◆ DTC_MAX_BLOCK_COUNT

#define DTC_MAX_BLOCK_COUNT    (0x10000)

Max configurable number of blocks to transfer in BLOCK MODE.

◆ DTC_MAX_BLOCK_TRANSFER_LENGTH

#define DTC_MAX_BLOCK_TRANSFER_LENGTH    (0x100)

Max number of transfers per block in BLOCK MODE.

◆ DTC_MAX_NORMAL_TRANSFER_LENGTH

#define DTC_MAX_NORMAL_TRANSFER_LENGTH    (0x10000)

Max configurable number of transfers in NORMAL MODE.

Max number of transfers per repeat for REPEAT MODE

◆ DTC_MAX_REPEAT_TRANSFER_LENGTH

#define DTC_MAX_REPEAT_TRANSFER_LENGTH    (0x100)

Max number of transfers per repeat for REPEAT MODE.

Max number of transfers per block in BLOCK MODE

◆ DTC_PLACE_IN_SECTION

#define DTC_PLACE_IN_SECTION ( x)
Value:
__attribute__((section(x))) \
__attribute__((__used__))

Attribute to place variable in a specific section.

◆ DTC_PRV_ACT_BIT_MASK

#define DTC_PRV_ACT_BIT_MASK   (1 << 15)

DTC Active flag (DTCSTS.ACT) bit mask.

◆ DTC_PRV_MASK_CRAL

#define DTC_PRV_MASK_CRAL   (0xFFU)

Counter Register A Lower Byte Mask.

◆ DTC_PRV_OFFSET_CRAH

#define DTC_PRV_OFFSET_CRAH   (8U)

Counter Register A Upper Byte Offset.

◆ DTC_PRV_VECT_NR_MASK

#define DTC_PRV_VECT_NR_MASK   (0x00FF)

DTC-Activating Vector Number bits mask.

◆ DTC_SECTION_ATTRIBUTE

#define DTC_SECTION_ATTRIBUTE    DTC_PLACE_IN_SECTION(".dtc_vector_table")

DTC vector table section attribute.

◆ DTC_VECTOR_TABLE_ENTRIES

#define DTC_VECTOR_TABLE_ENTRIES   (CONFIG_NUM_IRQS)

Number of DTC vector entries.

Typedef Documentation

◆ dtc_act_status_t

DTC activation status.

◆ transfer_addr_mode_t

Transfer address mode.

◆ transfer_chain_mode_t

◆ transfer_info_t

Transfer information structure.

◆ transfer_irq_t

Transfer interrupt type.

Interrupt on each transfer.

◆ transfer_mode_t

Transfer mode.

◆ transfer_properties_t

Detailed transfer properties.

◆ transfer_repeat_area_t

Area that repeats during repeat transfer mode.

◆ transfer_size_t

Transfer data size.

Enumeration Type Documentation

◆ e_dtc_act_status

DTC activation status.

Enumerator
DTC_ACT_IDLE 

Idle state.

DTC_ACT_CONFIGURED 

Configured state.

DTC_ACT_IN_PROGRESS 

In-progress state.

◆ e_transfer_addr_mode

Transfer address mode.

Enumerator
TRANSFER_ADDR_MODE_FIXED 

Mode fixed.

TRANSFER_ADDR_MODE_OFFSET 

Mode offset.

TRANSFER_ADDR_MODE_INCREMENTED 

Mode incremented.

TRANSFER_ADDR_MODE_DECREMENTED 

Mode decremented.

◆ e_transfer_chain_mode

Enumerator
TRANSFER_CHAIN_MODE_DISABLED 

Chaining disabled.

TRANSFER_CHAIN_MODE_EACH 

Chaining disabled.

TRANSFER_CHAIN_MODE_END 

Chain at end.

◆ e_transfer_irq

Transfer interrupt type.

Enumerator
TRANSFER_IRQ_END 

Interrupt at end of transfer.

TRANSFER_IRQ_EACH 

Interrupt on each transfer.

◆ e_transfer_mode

Transfer mode.

Enumerator
TRANSFER_MODE_NORMAL 

Normal transfer mode.

TRANSFER_MODE_REPEAT 

Repeat transfer mode.

TRANSFER_MODE_BLOCK 

Block transfer mode.

TRANSFER_MODE_REPEAT_BLOCK 

Repeat block transfer mode.

◆ e_transfer_repeat_area

Area that repeats during repeat transfer mode.

Enumerator
TRANSFER_REPEAT_AREA_DESTINATION 

Destination repeats.

TRANSFER_REPEAT_AREA_SOURCE 

Source repeats.

◆ e_transfer_size

Transfer data size.

Enumerator
TRANSFER_SIZE_1_BYTE 

1-byte transfer.

TRANSFER_SIZE_2_BYTE 

2-byte transfer.

TRANSFER_SIZE_4_BYTE 

4-byte transfer.

Function Documentation

◆ dtc_renesas_rx_configuration()

int dtc_renesas_rx_configuration ( const struct device * dev,
uint8_t activation_irq,
transfer_info_t * p_info )

Configure the p_info state and write p_info to DTC vector table.

Parameters
devDTC device instance.
activation_irqactivation source.
p_infotransfer info.
Return values
0On success.
-EINVALif activation source is invalid.

◆ dtc_renesas_rx_disable_transfer()

int dtc_renesas_rx_disable_transfer ( uint8_t activation_irq)

Disable transfer in ICU on this activation source.

Parameters
activation_irqactivation source.
Return values
0On success.
-EINVALif activation source is invalid.

◆ dtc_renesas_rx_enable_transfer()

int dtc_renesas_rx_enable_transfer ( uint8_t activation_irq)

Enable transfer in ICU on this activation source.

Parameters
activation_irqactivation source.
Return values
0On success.
-EINVALif activation source is invalid.

◆ dtc_renesas_rx_get_transfer_status()

void dtc_renesas_rx_get_transfer_status ( const struct device * dev,
struct dtc_transfer_status * status )

Get status transfer of DTC module and store it into status pointer.

Parameters
devDTC device instance.
statusDTC status.

◆ dtc_renesas_rx_info_get()

int dtc_renesas_rx_info_get ( const struct device * dev,
uint8_t activation_irq,
transfer_properties_t *const p_properties )

Get information about this transfer and store it into p_properties.

Parameters
devDTC device instance.
activation_irqActivation source IRQ number.
p_propertiesPointer to structure to receive driver-specific transfer properties.
Return values
0On success.
-EINVALIf activation source is invalid.

◆ dtc_renesas_rx_off()

int dtc_renesas_rx_off ( const struct device * dev)

Turn off module DTC.

Parameters
devDTC device instance.
Return values
0On success.

◆ dtc_renesas_rx_on()

int dtc_renesas_rx_on ( const struct device * dev)

Turn on module DTC.

Parameters
devDTC device instance.
Return values
0On success.

◆ dtc_renesas_rx_reset_transfer()

int dtc_renesas_rx_reset_transfer ( const struct device * dev,
uint8_t activation_irq,
void const * p_src,
void * p_dest,
uint16_t const num_transfers )

Reset transfer on this activation source.

Parameters
devDTC device instance.
activation_irqActivation source IRQ number.
p_srcPointer to the source address for the transfer.
p_destPointer to the destination address for the transfer.
num_transfersNumber of data units to transfer.
Return values
0On success.
-EINVALIf activation source is invalid.

◆ dtc_renesas_rx_start_transfer()

int dtc_renesas_rx_start_transfer ( const struct device * dev,
uint8_t activation_irq )

Start transfers on this activation source.

Parameters
devDTC device instance.
activation_irqactivation source.
Return values
0On success.
-EINVALif activation source is invalid.
-EACCESif this activation source in dtc vector table is not configured.

◆ dtc_renesas_rx_stop_transfer()

int dtc_renesas_rx_stop_transfer ( const struct device * dev,
uint8_t activation_irq )

Stop transfers on this activation source.

Parameters
devDTC device instance.
activation_irqactivation source.
Return values
0On success.
-EINVALif activation source is invalid.
-EACCESif this activation source in dtc vector table is not configured.

◆ is_valid_activation_irq()

ALWAYS_INLINE bool is_valid_activation_irq ( uint8_t activation_irq)
static

< Number of DTC vector entries.