![]() |
RA Flexible Software Package Documentation
Release v6.2.0
|
|
Interface for CEC peripheral.
The CEC interface provides common APIs for CEC HAL drivers and supports the following features:
Data Structures | |
| struct | cec_callback_args_t |
| struct | cec_cfg_t |
| struct | cec_api_t |
| struct | cec_instance_t |
Typedefs | |
| typedef void | cec_ctrl_t |
Enumerations | |
| enum | cec_addr_t |
| enum | cec_clock_source_t |
| enum | cec_state_t |
| enum | cec_error_t |
| enum | cec_event_t |
| union cec_message_t |
CEC message
| Data Fields | ||
|---|---|---|
| struct cec_message_t | __unnamed__ | |
| uint8_t | raw_data[CEC_DATA_BUFFER_LENGTH+2 *sizeof(uint8_t)] | Contiguous raw data. |
| struct cec_callback_args_t |
CEC callback parameter definition
| Data Fields | ||
|---|---|---|
| cec_event_t | event | Event code. |
| void * | p_context | Context provided to user during callback. |
| bool | addr_match | Local addresss matches message destination. |
| uint8_t | data_byte | Received data byte (INTDA) |
| cec_status_t | status | CEC Module status data. |
| cec_error_t | errors | Error code bitfield. |
| struct cec_cfg_t |
CEC Configuration
Data Fields | |
| cec_timing_t const * | bit_timing_cfg |
| CEC Bit Timing Configuration. | |
| uint16_t | rx_data_sample_time |
| Receive Data Sample Time Setting. | |
| uint16_t | rx_data_bit_reference_width |
| Receive Data Bit Reference Width. | |
| void(* | p_callback )(cec_callback_args_t *p_args) |
| Pointer to callback function. | |
| void * | p_context |
| User defined callback context. | |
| uint8_t | ipl |
| Error/Data/Message interrupt priority level. | |
| IRQn_Type | error_irq |
| Error IRQ number. | |
| IRQn_Type | data_irq |
| Data IRQ number. | |
| IRQn_Type | msg_irq |
| Communication Complete IRQ number. | |
| void * | p_extend |
| Pointer to extended configuration structure. | |
| struct cec_api_t |
Shared Interface definition for CEC
Data Fields | |
| fsp_err_t(* | open )(cec_ctrl_t *const p_ctrl, cec_cfg_t const *const p_cfg) |
| fsp_err_t(* | mediaInit )(cec_ctrl_t *const p_ctrl, cec_addr_t local_address) |
| fsp_err_t(* | write )(cec_ctrl_t *const p_ctrl, cec_message_t const *const p_message, uint32_t message_size) |
| fsp_err_t(* | close )(cec_ctrl_t *const p_ctrl) |
| fsp_err_t(* | statusGet )(cec_ctrl_t *const p_ctrl, cec_status_t *const p_status) |
| fsp_err_t(* | callbackSet )(cec_ctrl_t *const p_ctrl, void(*p_callback)(cec_callback_args_t *), void *const p_context, cec_callback_args_t *const p_callback_memory) |
| fsp_err_t(* cec_api_t::open) (cec_ctrl_t *const p_ctrl, cec_cfg_t const *const p_cfg) |
Open function for CEC device
| [in,out] | p_ctrl | Pointer to the CEC control block. Must be declared by user. Value set here. |
| [in] | p_cfg | Pointer to CEC configuration structure. All elements of this structure must be set by user. |
| fsp_err_t(* cec_api_t::mediaInit) (cec_ctrl_t *const p_ctrl, cec_addr_t local_address) |
Initializes the CEC device. May be called any time after the CEC module has been opened. This API blocks until the device initialization procedure is complete.
| [in] | p_ctrl | Pointer to CEC instance control block. |
| [out] | local_address | Desired Logical address for local device. |
| fsp_err_t(* cec_api_t::write) (cec_ctrl_t *const p_ctrl, cec_message_t const *const p_message, uint32_t message_size) |
Write function for CEC device
| [in] | p_ctrl | Pointer to CEC instance control block |
| [in] | p_message | Message data |
| [in] | message_size | Total size of entire message |
| fsp_err_t(* cec_api_t::close) (cec_ctrl_t *const p_ctrl) |
Close function for CEC device
| [in] | p_ctrl | Pointer to CEC instance control block |
| [out] | p_message | Message data |
| fsp_err_t(* cec_api_t::statusGet) (cec_ctrl_t *const p_ctrl, cec_status_t *const p_status) |
Get CEC channel info.
| [in] | p_ctrl | Pointer to CEC instance control block |
| [out] | p_status | Memory address to return channel specific data to. |
| fsp_err_t(* cec_api_t::callbackSet) (cec_ctrl_t *const p_ctrl, void(*p_callback)(cec_callback_args_t *), void *const p_context, cec_callback_args_t *const p_callback_memory) |
Specify callback function, optional context pointer and working memory pointer.
| [in] | p_ctrl | Control block set in cec_api_t::open call. |
| [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 cec be allocated. Callback arguments allocated here are only valid during the callback. |
| struct cec_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
| Data Fields | ||
|---|---|---|
| cec_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
| cec_cfg_t const * | p_cfg | Pointer to the configuration structure for this instance. |
| cec_api_t const * | p_api | Pointer to the API structure for this instance. |
| typedef void cec_ctrl_t |
CEC control block. Allocate an instance specific control block to pass into the CEC API calls.
| enum cec_addr_t |
CEC Addresses
| enum cec_clock_source_t |
CEC Source Clock
| enum cec_state_t |
CEC State
| enum cec_error_t |
CEC Error Code
| enum cec_event_t |