RA Flexible Software Package Documentation  Release v5.7.0

 
DOC Interface

Detailed Description

Interface for the Data Operation Circuit.

Defines the API and data structures for the DOC implementation of the Data Operation Circuit (DOC) interface.

Summary

This module implements the DOC_API using the Data Operation Circuit (DOC).

Data Structures

struct  doc_callback_args_t
 
struct  doc_cfg_t
 
struct  doc_api_t
 
struct  doc_instance_t
 

Typedefs

typedef void doc_ctrl_t
 

Enumerations

enum  doc_event_t
 
enum  doc_bit_width_t
 

Data Structure Documentation

◆ doc_callback_args_t

struct doc_callback_args_t

Callback function parameter data.

Data Fields
void const * p_context Set in doc_api_t::open function in doc_cfg_t.

Placeholder for user data.

◆ doc_cfg_t

struct doc_cfg_t

User configuration structure, used in the open function.

Data Fields

doc_event_t event
 Select enumerated value from doc_event_t.
 
doc_bit_width_t bit_width
 The bit width of operations.
 
uint32_t doc_data
 
uint32_t doc_data_extra
 
uint8_t ipl
 DOC interrupt priority.
 
IRQn_Type irq
 Interrupt number assigned to this instance.
 
void(* p_callback )(doc_callback_args_t *p_args)
 
void const * p_context
 

Field Documentation

◆ doc_data

uint32_t doc_cfg_t::doc_data

Initial/Reference data for addition, subtraction, and comparison operations.

  • In Addition and Subtraction mode, this value sets the initial value of the operations.
  • In Comparison match, mismatch, lower, and upper modes, this value is compared with data that is written.
  • In Comparison inside window and outside window modes, this value is used as the lower bound for comparisons.

◆ doc_data_extra

uint32_t doc_cfg_t::doc_data_extra

Additional reference data for use in Window Comparison operations.

  • In Comparison inside window and outside window modes, this value is used as the upper bound for comparisons.

◆ p_callback

void(* doc_cfg_t::p_callback) (doc_callback_args_t *p_args)

Callback provided when a DOC ISR occurs.

◆ p_context

void const* doc_cfg_t::p_context

Placeholder for user data. Passed to the user callback in doc_callback_args_t.

◆ doc_api_t

struct doc_api_t

Data Operation Circuit (DOC) API structure. DOC functions implemented at the HAL layer will follow this API.

Data Fields

fsp_err_t(* open )(doc_ctrl_t *const p_ctrl, doc_cfg_t const *const p_cfg)
 
fsp_err_t(* close )(doc_ctrl_t *const p_ctrl)
 
fsp_err_t(* read )(doc_ctrl_t *const p_ctrl, uint32_t *p_result)
 
fsp_err_t(* write )(doc_ctrl_t *const p_ctrl, uint32_t data)
 
fsp_err_t(* callbackSet )(doc_ctrl_t *const p_ctrl, void(*p_callback)(doc_callback_args_t *), void const *const p_context, doc_callback_args_t *const p_callback_memory)
 

Field Documentation

◆ open

fsp_err_t(* doc_api_t::open) (doc_ctrl_t *const p_ctrl, doc_cfg_t const *const p_cfg)

Initial configuration.

Parameters
[in]p_ctrlPointer to control block. Must be declared by user. Elements set here.
[in]p_cfgPointer to configuration structure. All elements of this structure must be set by user.

◆ close

fsp_err_t(* doc_api_t::close) (doc_ctrl_t *const p_ctrl)

Allow the driver to be reconfigured. Will reduce power consumption.

Parameters
[in]p_ctrlControl block set in doc_api_t::open call.

◆ read

fsp_err_t(* doc_api_t::read) (doc_ctrl_t *const p_ctrl, uint32_t *p_result)

Gets the result of addition/subtraction operations and stores it in the provided pointer p_result.

Parameters
[in]p_ctrlControl block set in doc_api_t::open call.
[in]p_resultThe result of the DOC operation.

◆ write

fsp_err_t(* doc_api_t::write) (doc_ctrl_t *const p_ctrl, uint32_t data)

Write to the DODIR register.

Parameters
[in]p_ctrlControl block set in doc_api_t::open call.
[in]datadata to be written to DOC DODIR register.

◆ callbackSet

fsp_err_t(* doc_api_t::callbackSet) (doc_ctrl_t *const p_ctrl, void(*p_callback)(doc_callback_args_t *), void const *const p_context, doc_callback_args_t *const p_callback_memory)

Specify callback function and optional context pointer and working memory pointer.

Parameters
[in]p_ctrlPointer to the DOC control block.
[in]p_callbackCallback function
[in]p_contextPointer to send to callback function
[in]p_working_memoryPointer to volatile memory where callback structure can be allocated. Callback arguments allocated here are only valid during the callback.

◆ doc_instance_t

struct doc_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
doc_ctrl_t * p_ctrl Pointer to the control structure for this instance.
doc_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
doc_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ doc_ctrl_t

typedef void doc_ctrl_t

DOC control block. Allocate an instance specific control block to pass into the DOC API calls.

Enumeration Type Documentation

◆ doc_event_t

Event that can trigger a callback function.

Enumerator
DOC_EVENT_COMPARISON_MISMATCH 

The data is not equal to the reference data setting.

DOC_EVENT_ADDITION 

Addition resulted in a value greater than the max for the configured bit width.

DOC_EVENT_SUBTRACTION 

Subtraction resulted in a value less than 0.

DOC_EVENT_COMPARISON_MATCH 

The data is equal to the reference data settting.

DOC_EVENT_COMPARISON_LOWER 

The data is less than the reference data setting.

DOC_EVENT_COMPARISON_UPPER 

The data is greater than the reference data setting.

DOC_EVENT_COMPARISON_INSIDE_WINDOW 

The data is between the two reference data settings.

DOC_EVENT_COMPARISON_OUTSIDE_WINDOW 

The data is outside the two reference data setttings.

◆ doc_bit_width_t

The bit width used during operations.

Enumerator
DOC_BIT_WIDTH_16 

Operations are 16-bit.

DOC_BIT_WIDTH_32 

Operations are 32-bit.