5#define __VSF_HEADER_ONLY_SHOW_ARCH_INFO__
7#undef __VSF_HEADER_ONLY_SHOW_ARCH_INFO__
9#define __VSF_HAL_SHOW_VENDOR_INFO__
14#if __IS_COMPILER_IAR__
16# pragma diag_suppress=pe111
19#if !defined(__VSF_HAL_SWI_NUM)
21# define __VSF_DEV_SWI_NUM VSF_DEV_SWI_NUM
22#elif __VSF_HAL_SWI_NUM > VSF_ARCH_SWI_NUM
23# if (__VSF_HAL_SWI_NUM - VSF_ARCH_SWI_NUM) > VSF_DEV_SWI_NUM
24# define MFUNC_IN_U8_DEC_VALUE (VSF_DEV_SWI_NUM)
26# define MFUNC_IN_U8_DEC_VALUE (__VSF_HAL_SWI_NUM - VSF_ARCH_SWI_NUM)
29# define __VSF_DEV_SWI_NUM MFUNC_OUT_DEC_STR
31# define __VSF_DEV_SWI_NUM 0
34#define __MCU_SWI(__N, __VALUE) \
35 VSF_CAL_ROOT VSF_CAL_ISR(SWI##__N##_IRQHandler) \
37 if (__mcu_common.swi[__N].handler != NULL) { \
38 __mcu_common.swi[__N].handler(__mcu_common.swi[__N].param); \
45#if __VSF_DEV_SWI_NUM > 0
50struct __mcu_common_t {
56typedef struct __mcu_common_t __mcu_common_t;
62#if __VSF_DEV_SWI_NUM > 0
63static __mcu_common_t __mcu_common;
68#if defined(WEAK_VSF_USR_SWI_INIT_EXTERN) \
69 && defined(WEAK_VSF_USR_SWI_INIT)
70WEAK_VSF_USR_SWI_INIT_EXTERN
73#if defined(WEAK_VSF_USR_SWI_TRIGGER_EXTERN) \
74 && defined(WEAK_VSF_USR_SWI_TRIGGER)
75WEAK_VSF_USR_SWI_TRIGGER_EXTERN
81#if __VSF_DEV_SWI_NUM > 0
90 if (handler !=
NULL) {
91 __mcu_common.swi[idx].handler = handler;
92 __mcu_common.swi[idx].param = param;
94 NVIC_SetPriority(__mcu_soft_irq[idx], priority);
95 NVIC_EnableIRQ(__mcu_soft_irq[idx]);
97 NVIC_DisableIRQ(__mcu_soft_irq[idx]);
105static VSF_CAL_ALWAYS_INLINE
void __vsf_drv_swi_trigger(
uint_fast8_t idx)
108 NVIC_SetPendingIRQ(__mcu_soft_irq[idx]);
115#if __VSF_HAL_SWI_NUM > 0 || !defined(__VSF_HAL_SWI_NUM)
126#if __VSF_HAL_SWI_NUM > VSF_ARCH_SWI_NUM || !defined(__VSF_HAL_SWI_NUM)
127# if __VSF_DEV_SWI_NUM > 0
129 __vsf_drv_swi_trigger(idx);
135# if (__VSF_HAL_SWI_NUM > VSF_ARCH_SWI_NUM + __VSF_DEV_SWI_NUM) \
136 || !defined(__VSF_HAL_SWI_NUM)
137# ifndef WEAK_VSF_USR_SWI_TRIGGER
140 WEAK_VSF_USR_SWI_TRIGGER(idx);
165#if __VSF_HAL_SWI_NUM > VSF_ARCH_SWI_NUM || !defined(__VSF_HAL_SWI_NUM)
166# if __VSF_DEV_SWI_NUM > 0
168 return __vsf_drv_swi_init(idx, priority, handler, param);
173# if (__VSF_HAL_SWI_NUM > VSF_ARCH_SWI_NUM + __VSF_DEV_SWI_NUM) \
174 || !defined(__VSF_HAL_SWI_NUM)
175# ifndef WEAK_VSF_USR_SWI_INIT
178 return WEAK_VSF_USR_SWI_INIT(idx, priority, handler, param);
vsf_err_t
Definition __type.h:42
@ VSF_ERR_NONE
none error
Definition __type.h:44
@ VSF_ERR_FAIL
failed
Definition __type.h:51
void vsf_usr_swi_trigger(uint_fast8_t idx)
Definition __common.c:119
vsf_err_t vsf_usr_swi_init(uint_fast8_t idx, vsf_arch_prio_t priority, vsf_swi_handler_t *handler, void *param)
Definition __common.c:147
#define __VSF_DEV_SWI_NUM
when there is no defined __VSF_HAL_SWI_NUM, use the maximum available value
Definition __common.c:25
vsf_arch_prio_t
Definition cortex_a_generic.h:88
#define VSF_DEV_SWI_LIST
Definition device.h:40
#define NULL
Definition lvgl.h:26
unsigned char uint_fast8_t
Definition stdint.h:23
void vsf_drv_usr_swi_trigger(uint_fast8_t idx)
Definition vsf_arch_abstraction.c:462
vsf_err_t vsf_drv_usr_swi_init(uint_fast8_t idx, vsf_arch_prio_t priority, vsf_swi_handler_t *handler, void *param)
Definition vsf_arch_abstraction.c:496
#define VSF_DEV_SWI_NUM
Definition vsf_arch_abstraction.h:125
vsf_irq_handler_t vsf_swi_handler_t
Definition vsf_arch_abstraction.h:51
#define VSF_HAL_ASSERT(__CON)
all hal modules use this configuration file
Definition vsf_hal_cfg.h:36
#define VSF_MREPEAT(__COUNT, __MACRO, __PARAM)
Definition vsf_repeat_macro.h:51