Synergy Software Package User's Manual

RTOS-integrated external IRQ Framework. More...

Data Structures

struct  sf_external_irq_instance_ctrl_t
 

Functions

ssp_err_t SF_EXTERNAL_IRQ_Open (sf_external_irq_ctrl_t *const p_api_ctrl, sf_external_irq_cfg_t const *const p_cfg)
 Configure external IRQ and optionally enable external IRQ callbacks. Implements sf_external_irq_api_t::open. More...
 
ssp_err_t SF_EXTERNAL_IRQ_Wait (sf_external_irq_ctrl_t *const p_api_ctrl, ULONG const timeout)
 Get semaphore with specified timeout for external interrupt to expire. Implements sf_external_irq_api_t::wait. More...
 
ssp_err_t SF_EXTERNAL_IRQ_VersionGet (ssp_version_t *const p_version)
 Get version and store it in provided pointer p_version. Implements sf_external_irq_api_t::versionGet. More...
 
ssp_err_t SF_EXTERNAL_IRQ_Close (sf_external_irq_ctrl_t *const p_api_ctrl)
 Close channel at HAL layer and delete the semaphore . Implements sf_external_irq_api_t::close. More...
 

Detailed Description

RTOS-integrated external IRQ Framework.

Summary

This module is a ThreadX-aware external IRQ Framework for external inputs such as switches or other binary signals.

Function Documentation

◆ SF_EXTERNAL_IRQ_Close()

ssp_err_t SF_EXTERNAL_IRQ_Close ( sf_external_irq_ctrl_t *const  p_api_ctrl)

Close channel at HAL layer and delete the semaphore . Implements sf_external_irq_api_t::close.

Return values
SSP_SUCCESSSuccessful close.
SSP_ERR_ASSERTIONThe parameter ctrl is NULL.
SSP_ERR_NOT_OPENThe channel is not opened.
SSP_ERR_UNSUPPORTEDUnsupported operation.
Returns
See Common Error Codes or HAL driver for other possible return codes or causes. This function calls:

Close low level driver

Clear information from control block so other functions know this instance is closed

Delete the semaphore used

◆ SF_EXTERNAL_IRQ_Open()

ssp_err_t SF_EXTERNAL_IRQ_Open ( sf_external_irq_ctrl_t *const  p_api_ctrl,
sf_external_irq_cfg_t const *const  p_cfg 
)

Configure external IRQ and optionally enable external IRQ callbacks. Implements sf_external_irq_api_t::open.

The SF_EXTERNAL_IRQ_Open() function creates semaphore for the external IRQ channel used, then calls the HAL driver open function. After successful initialization, the external IRQ is ready for use.

Return values
SSP_SUCCESSInitialization was successful and external interrupt has started.
SSP_ERR_ASSERTIONOne of the following parameters may be NULL: p_ctrl, p_api, or p_cfg, p_api, or p_api->open. See HAL driver for other possible causes.
SSP_ERR_IN_USEThis channel is already open.
SSP_ERR_INTERNALAn internal ThreadX error has occurred.
Returns
See Common Error Codes or HAL driver for other possible return codes or causes. This function calls:
Note
This function is reentrant for any channel.

Save driver structure for use in other framework layer functions

Create semaphore for use with wait function

Prepare configuration for lower layer

Open lower layer

If low level initialization failed, delete the semaphore and exit the function with the error code

Delete the semaphore.

log the error and return the error

Mark control block open so other tasks know it is valid

◆ SF_EXTERNAL_IRQ_VersionGet()

ssp_err_t SF_EXTERNAL_IRQ_VersionGet ( ssp_version_t *const  p_version)

Get version and store it in provided pointer p_version. Implements sf_external_irq_api_t::versionGet.

Return values
SSP_SUCCESSVersion returned successfully.
SSP_ERR_ASSERTIONParameter p_version was null.

◆ SF_EXTERNAL_IRQ_Wait()

ssp_err_t SF_EXTERNAL_IRQ_Wait ( sf_external_irq_ctrl_t *const  p_api_ctrl,
ULONG const  timeout 
)

Get semaphore with specified timeout for external interrupt to expire. Implements sf_external_irq_api_t::wait.

Return values
SSP_SUCCESSExternal interrupt stopped successfully.
SSP_ERR_NOT_OPENDriver control block not valid. Call SF_EXTERNAL_IRQ_Open to configure.
SSP_ERR_TIMEOUTTime out happens while waiting a semaphore.
SSP_ERR_WAIT_ABORTEDSuspension was aborted by another thread.
Returns
See Common Error Codes or HAL driver for other possible return codes or causes.

Wait for semaphore post from ISR