VSF Documented
Macros | Functions
exti_common.c File Reference
#include "hal/driver/driver.h"

Macros

#define VSF_EXTI_CFG_FUNCTION_RENAME   DISABLED
 

Functions

vsf_err_t vsf_exti_config_channels (vsf_exti_t *exti_ptr, vsf_exti_channel_mask_t channel_mask, vsf_exti_channel_cfg_t *cfg_ptr)
 Configure one or more channels of the exti instance.
 
vsf_err_t vsf_exti_init (vsf_exti_t *exti_ptr)
 Initialize a EXTI instance.
 
void vsf_exti_fini (vsf_exti_t *exti_ptr)
 Finalize a EXTI instance.
 
vsf_exti_status_t vsf_exti_status (vsf_exti_t *exti_ptr)
 Get the status of EXTI instance.
 
vsf_exti_capability_t vsf_exti_capability (vsf_exti_t *exti_ptr)
 Get the capability of exti instance.
 
vsf_err_t vsf_exti_trigger (vsf_exti_t *exti_ptr, vsf_exti_channel_mask_t channel_mask)
 Trigger EXTI channels.
 
vsf_err_t vsf_exti_irq_enable (vsf_exti_t *exti_ptr, vsf_exti_channel_mask_t channel_mask)
 Enable interrupt of one or more channels.
 
vsf_err_t vsf_exti_irq_disable (vsf_exti_t *exti_ptr, vsf_exti_channel_mask_t channel_mask)
 Disable interrupt of one or more channels.
 
vsf_exti_channel_mask_t vsf_exti_irq_clear (vsf_exti_t *exti_ptr, vsf_exti_channel_mask_t channel_mask)
 Clear interrupt flags of EXTI instance and return previous state.
 
vsf_err_t vsf_exti_ctrl (vsf_exti_t *exti_ptr, vsf_exti_ctrl_t ctrl, void *param)
 

Macro Definition Documentation

◆ VSF_EXTI_CFG_FUNCTION_RENAME

#define VSF_EXTI_CFG_FUNCTION_RENAME   DISABLED

Function Documentation

◆ vsf_exti_config_channels()

vsf_err_t vsf_exti_config_channels ( vsf_exti_t exti_ptr,
vsf_exti_channel_mask_t  channel_mask,
vsf_exti_channel_cfg_t cfg_ptr 
)

Configure one or more channels of the exti instance.

Parameters
[in]exti_ptra pointer to structure vsf_exti_t
[in]channel_maskchannel mask, each channel corresponds to one bit, the value of this bit 1 means the configuration will be applied to the corresponding channel
[in]cfg_ptra pointer to structure vsf_exti_channel_cfg_t
Returns
vsf_err_t: VSF_ERR_NONE if EXTI Configuration Successful, or a negative error code

◆ vsf_exti_init()

vsf_err_t vsf_exti_init ( vsf_exti_t exti_ptr)

Initialize a EXTI instance.

Parameters
[in]exti_ptra pointer to structure vsf_exti_t
Returns
vsf_err_t: VSF_ERR_NONE if initialization successful, otherwise returns error code
Note
It is not necessary to call vsf_exti_fini() to deinitialization. vsf_exti_init() should be called before any other EXTI API except vsf_exti_capability().

◆ vsf_exti_fini()

void vsf_exti_fini ( vsf_exti_t exti_ptr)

Finalize a EXTI instance.

Parameters
[in]exti_ptra pointer to structure vsf_exti_t
Returns
none

◆ vsf_exti_status()

vsf_exti_status_t vsf_exti_status ( vsf_exti_t exti_ptr)

Get the status of EXTI instance.

Parameters
[in]exti_ptra pointer to structure vsf_exti_t
Returns
vsf_exti_status_t: all status of current EXTI

◆ vsf_exti_capability()

vsf_exti_capability_t vsf_exti_capability ( vsf_exti_t exti_ptr)

Get the capability of exti instance.

Parameters
[in]exti_ptrpointer to the structure vsf_exti_t, refer to vsf_exti_t
Returns
vsf_exti_capability_t: all capabilities of current EXTI vsf_exti_capability_t

◆ vsf_exti_trigger()

vsf_err_t vsf_exti_trigger ( vsf_exti_t exti_ptr,
vsf_exti_channel_mask_t  channel_mask 
)

Trigger EXTI channels.

Parameters
[in]exti_ptra pointer to structure vsf_exti_t
[in]channel_maskchannel mask, each channel corresponds to one bit, the value of this bit 1 means the configuration will be applied to the corresponding channel
Returns
vsf_err_t: VSF_ERR_NONE if required channels Triggered, or a negative error code

◆ vsf_exti_irq_enable()

vsf_err_t vsf_exti_irq_enable ( vsf_exti_t exti_ptr,
vsf_exti_channel_mask_t  channel_mask 
)

Enable interrupt of one or more channels.

Parameters
[in]exti_ptra pointer to structure vsf_exti_t
[in]channel_maskchannel mask, each channel corresponds to one bit, 1 means the corresponding channel needs to be enabled, 0 means the corresponding channel does not need to be enabled
Returns
vsf_err_t: VSF_ERR_NONE if successful, or a negative error code
Note
For some devices, the interrupt priority may be shared between channels on the exti.
All pending interrupts should be cleared before interrupts are enabled.

◆ vsf_exti_irq_disable()

vsf_err_t vsf_exti_irq_disable ( vsf_exti_t exti_ptr,
vsf_exti_channel_mask_t  channel_mask 
)

Disable interrupt of one or more channels.

Parameters
[in]exti_ptra pointer to structure vsf_exti_t
[in]channel_maskchannel mask, each channel corresponds to one bit, 1 means the corresponding channel needs to be disabled, 0 means the corresponding channel does not need to be disabled
Returns
vsf_err_t: VSF_ERR_NONE if successful, or a negative error code
Note
For some devices, the interrupt settings may be shared between channels on the exti.

◆ vsf_exti_irq_clear()

vsf_exti_channel_mask_t vsf_exti_irq_clear ( vsf_exti_t exti_ptr,
vsf_exti_channel_mask_t  channel_mask 
)

Clear interrupt flags of EXTI instance and return previous state.

Parameters
[in]exti_ptra pointer to structure vsf_exti_t
[in]channel_maskone or more values of enum vsf_exti_channel_mask_t to clear
Returns
vsf_exti_channel_mask_t: the channel mask state before clearing (0 if no flags were set)
Note
This function attempts to clear the specified interrupt flags if they are set, and returns the state of those flags before clearing. This is useful for polling operations and determining if interrupts occurred. Note that if interrupts are enabled and an interrupt handler is active, the interrupt handler may clear the interrupt flags automatically. In such cases, this function will return 0 even if interrupts occurred.

◆ vsf_exti_ctrl()

vsf_err_t vsf_exti_ctrl ( vsf_exti_t exti_ptr,
vsf_exti_ctrl_t  ctrl,
void *  param 
)
Generated from commit: vsfteam/vsf@b2e9e8a