|
VSF Documented
|
Go to the source code of this file.
Data Structures | |
| struct | vsf_exti_channel_cfg_t |
| struct | vsf_exti_status_t |
| Predefined VSF EXTI status that can be reimplemented in specific hal drivers. More... | |
| struct | vsf_exti_capability_t |
| struct | vsf_exti_op_t |
| struct | vsf_exti_t |
Macros | |
| #define | VSF_EXTI_CFG_MULTI_CLASS ENABLED |
| Enable multi-class support by default for maximum availability. | |
| #define | VSF_EXTI_CFG_PREFIX vsf |
| Define EXTI hardware mask if count is defined. | |
| #define | VSF_EXTI_CFG_REIMPLEMENT_TYPE_MODE DISABLED |
| Enable option to reimplement mode type in specific hardware drivers. | |
| #define | VSF_EXTI_CFG_FUNCTION_RENAME ENABLED |
| Enable function rename feature. | |
| #define | VSF_EXTI_CFG_REIMPLEMENT_TYPE_CFG DISABLED |
| #define | VSF_EXTI_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED |
| #define | VSF_EXTI_CFG_INHERIT_HAL_CAPABILITY ENABLED |
| #define | VSF_EXTI_APIS(__prefix_name) |
| #define | vsf_exti_channel_mask_t vsf_exti_channel_mask_t |
| #define | VSF_EXTI_MODE_LOW_LEVEL VSF_EXTI_MODE_LOW_LEVEL |
| #define | VSF_EXTI_MODE_HIGH_LEVEL VSF_EXTI_MODE_HIGH_LEVEL |
Typedefs | |
| typedef uint32_t | vsf_exti_channel_mask_t |
| typedef enum vsf_exti_mode_t | vsf_exti_mode_t |
| Predefined VSF EXTI modes that can be reimplemented in specific hal drivers. | |
| typedef struct vsf_exti_t | vsf_exti_t |
| Pre-declaration of EXTI structures. | |
| typedef void | vsf_exti_isr_handler_t(void *target_ptr, vsf_exti_t *exti_ptr, vsf_exti_channel_mask_t channel_mask) |
| External interrupt callback function for exti. | |
| typedef struct vsf_exti_channel_cfg_t | vsf_exti_channel_cfg_t |
| typedef struct vsf_exti_status_t | vsf_exti_status_t |
| Predefined VSF EXTI status that can be reimplemented in specific hal drivers. | |
| typedef struct vsf_exti_capability_t | vsf_exti_capability_t |
| typedef struct vsf_exti_op_t | vsf_exti_op_t |
Enumerations | |
| enum | vsf_exti_mode_t { VSF_EXTI_MODE_NONE = (0 << 0) , VSF_EXTI_MODE_RISING = (3 << 0) , VSF_EXTI_MODE_FALLING = (4 << 0) , VSF_EXTI_MODE_EDGE_RISING_FALLING = VSF_EXTI_MODE_RISING | VSF_EXTI_MODE_FALLING , VSF_EXTI_MODE_LOW_LEVEL = (1 << 0) , VSF_EXTI_MODE_LOW_LEVEL = (1 << 0) , VSF_EXTI_MODE_HIGH_LEVEL = (2 << 0) , VSF_EXTI_MODE_HIGH_LEVEL = (2 << 0) } |
| Predefined VSF EXTI modes that can be reimplemented in specific hal drivers. More... | |
| enum | { VSF_EXTI_MODE_MASK } |
Functions | |
| 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_err_t | vsf_exti_trigger (vsf_exti_t *exti_ptr, vsf_exti_channel_mask_t channel_mask) |
| Trigger EXTI channels. | |
| vsf_exti_status_t | vsf_exti_status (vsf_exti_t *exti_ptr) |
| Get the status of EXTI instance. | |
| 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_exti_capability_t | vsf_exti_capability (vsf_exti_t *exti_ptr) |
| Get the capability of exti instance. | |
| 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. | |
| #define VSF_EXTI_CFG_MULTI_CLASS ENABLED |
Enable multi-class support by default for maximum availability.
| #define VSF_EXTI_CFG_PREFIX vsf |
Define EXTI hardware mask if count is defined.
Define EXTI hardware count if mask is defined.
Define EXTI channel mask if count is defined.
Define EXTI channel count if mask is defined.
VSF_EXTI_CFG_PREFIX is used to set the actual API call when calling the vsf_exti_*(). For example, if you configure VSF_EXTI_CFG_PREFIX to be vsf_hw, then call vsf_exti_enable(), which is actually vsf_hw_exti_enable()
If we want the call to vsf_exti_enable in xxxx.c to actually call vsf_example_exti_enable, then it can be configured in front of the .c:
| #define VSF_EXTI_CFG_REIMPLEMENT_TYPE_MODE DISABLED |
Enable option to reimplement mode type in specific hardware drivers.
| #define VSF_EXTI_CFG_FUNCTION_RENAME ENABLED |
Enable function rename feature.
| #define VSF_EXTI_CFG_REIMPLEMENT_TYPE_CFG DISABLED |
Redefine struct vsf_exti_channel_cfg_t. The vsf_exti_isr_handler_t type also needs to be redefined For compatibility, members should not be deleted when struct vsf_exti_channel_cfg_t redefining.
| #define VSF_EXTI_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED |
Redefine struct vsf_exti_capability_t. For compatibility, members should not be deleted when struct vsf_exti_capability_t redefining.
| #define VSF_EXTI_CFG_INHERIT_HAL_CAPABILITY ENABLED |
| #define VSF_EXTI_APIS | ( | __prefix_name | ) |
| #define VSF_EXTI_MODE_LOW_LEVEL VSF_EXTI_MODE_LOW_LEVEL |
| #define VSF_EXTI_MODE_HIGH_LEVEL VSF_EXTI_MODE_HIGH_LEVEL |
| typedef uint32_t vsf_exti_channel_mask_t |
| typedef enum vsf_exti_mode_t vsf_exti_mode_t |
Predefined VSF EXTI modes that can be reimplemented in specific hal drivers.
Even if the hardware doesn't support these features, these modes must be implemented: If the IO supports more modes, We can implement it in the hardware driver. If we add a new mode in the hardware driver, then we also need to define the macro VSF_EXTI_MODE_MASK, whose value is the OR of the value of all modes.
Optional features require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can switch to different modes at runtime.
| typedef struct vsf_exti_t vsf_exti_t |
Pre-declaration of EXTI structures.
| typedef void vsf_exti_isr_handler_t(void *target_ptr, vsf_exti_t *exti_ptr, vsf_exti_channel_mask_t channel_mask) |
External interrupt callback function for exti.
| typedef struct vsf_exti_channel_cfg_t vsf_exti_channel_cfg_t |
| typedef struct vsf_exti_status_t vsf_exti_status_t |
Predefined VSF EXTI status that can be reimplemented in specific hal drivers.
| typedef struct vsf_exti_capability_t vsf_exti_capability_t |
| typedef struct vsf_exti_op_t vsf_exti_op_t |
| enum vsf_exti_mode_t |
Predefined VSF EXTI modes that can be reimplemented in specific hal drivers.
Even if the hardware doesn't support these features, these modes must be implemented: If the IO supports more modes, We can implement it in the hardware driver. If we add a new mode in the hardware driver, then we also need to define the macro VSF_EXTI_MODE_MASK, whose value is the OR of the value of all modes.
Optional features require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can switch to different modes at runtime.
|
extern |
Initialize a EXTI instance.
| [in] | exti_ptr | a pointer to structure vsf_exti_t |
|
extern |
|
extern |
Trigger EXTI channels.
| [in] | exti_ptr | a pointer to structure vsf_exti_t |
| [in] | channel_mask | channel mask, each channel corresponds to one bit, the value of this bit 1 means the configuration will be applied to the corresponding channel |
|
extern |
Get the status of EXTI instance.
| [in] | exti_ptr | a pointer to structure vsf_exti_t |
|
extern |
Configure one or more channels of the exti instance.
| [in] | exti_ptr | a pointer to structure vsf_exti_t |
| [in] | channel_mask | channel 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_ptr | a pointer to structure vsf_exti_channel_cfg_t |
|
extern |
Get the capability of exti instance.
| [in] | exti_ptr | pointer to the structure vsf_exti_t, refer to vsf_exti_t |
|
extern |
Enable interrupt of one or more channels.
| [in] | exti_ptr | a pointer to structure vsf_exti_t |
| [in] | channel_mask | channel 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 |
|
extern |
Disable interrupt of one or more channels.
| [in] | exti_ptr | a pointer to structure vsf_exti_t |
| [in] | channel_mask | channel 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 |