Value:\
SVCI(svci_num, uint32_t, name ## _svci_async_init, name ## _svci_async_t *, p_async); \
static name ## _svci_async_t name ## _svci_async_def = {0}; \
\
static __INLINE uint32_t name ## _init (void) \
{ \
return name ## _svci_async_init(&name ## _svci_async_def); \
} \
\
static __INLINE uint32_t name(param_type * p_param) \
{ \
return name ## _svci_async_def.async_func(p_param, &name ## _svci_async_def.state); \
} \
\
static __INLINE uint32_t name ## _on_sys_evt(uint32_t sys_evt) \
{ \
return name ## _svci_async_def.sys_evt_handler(sys_evt, &name ## _svci_async_def.state); \
} \
\
static __INLINE uint32_t name ## _is_initialized(void) \
{ \
return (name ## _svci_async_def.async_func != NULL && \
name ## _svci_async_def.sys_evt_handler != NULL ); \
}
Macro for defining a named SVCI async interface.
The async interface provides a method to call into an external application through the SVCI interface without relying on allocated or reserved memory inside the external application.
Running this macro creates a defintion of the structure that holds the information about the async function, the event handler, and the state.
Running this macro also defines convenience functions to the SVCI interface.
The available functions are: -NAME_init - Function to call to set up the async SVCI interface. -NAME - Function to call the async SVCI interface. -NAME_on_sys_event - Function to report sys events to the async SVCI interface. -NAME_is_initialized - Function to check if the async SVCI interface is initialized and ready to use.
- Note
- Invoking this macro is only possible in a source file as the macro creates a static variable for the async interface as well as static functions to call into the async interface.
- Parameters
-
[in] | svci_num | SVC indirect number. |
[in] | name | Name of the async function. |
[in] | param_type | Type of the param used for the async interface. |
- Return values
-
Instance | of the async SVCI interface and convenience functions for using it. |