HPM SDK
HPMicro Software Development Kit
hpm_ipc_event_mgr.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef HPM_IPC_EVENT_MGR_H
9 #define HPM_IPC_EVENT_MGR_H
10 
11 #ifdef __cplusplus
12 
13 extern "C" {
14 #endif
15 
22 typedef void (*ipc_event_callback_t)(uint16_t event_data, void *context);
23 
27 typedef struct {
29  void *callback_data;
30 } ipc_event_t;
31 
35 typedef enum {
40 
44 void ipc_init(void);
45 
51 void ipc_enable_event_interrupt(uint32_t priority);
52 
57 
68 hpm_stat_t ipc_register_event(ipc_event_type_t type, ipc_event_callback_t callback, void *callback_data);
69 
79 hpm_stat_t ipc_tigger_event(ipc_event_type_t type, uint16_t event_data);
80 
88 void ipc_event_handler(uint32_t data);
89 
90 #ifdef __cplusplus
91 }
92 #endif
93 
94 #endif /* HPM_IPC_EVENT_MGR_H */
uint32_t hpm_stat_t
Definition: hpm_common.h:123
void ipc_enable_event_interrupt(uint32_t priority)
Enbale IPC event interrupt.
Definition: hpm_ipc_event_mgr.c:40
void ipc_event_handler(uint32_t data)
event handler
Definition: hpm_ipc_event_mgr.c:81
void(* ipc_event_callback_t)(uint16_t event_data, void *context)
Type definition of event callback function pointer.
Definition: hpm_ipc_event_mgr.h:22
hpm_stat_t ipc_tigger_event(ipc_event_type_t type, uint16_t event_data)
Trigger IPC event.
Definition: hpm_ipc_event_mgr.c:65
ipc_event_type_t
Type definition of event types.
Definition: hpm_ipc_event_mgr.h:35
@ ipc_remote_start_event
Definition: hpm_ipc_event_mgr.h:36
@ ipc_event_table_len
Definition: hpm_ipc_event_mgr.h:38
@ ipc_remote_rpmsg_event
Definition: hpm_ipc_event_mgr.h:37
hpm_stat_t ipc_register_event(ipc_event_type_t type, ipc_event_callback_t callback, void *callback_data)
Register IPC event.
Definition: hpm_ipc_event_mgr.c:50
void ipc_init(void)
IPC Init.
Definition: hpm_ipc_event_mgr.c:35
void ipc_disable_event_interrupt(void)
Disbale IPC event interrupt.
Definition: hpm_ipc_event_mgr.c:45
Type definition of structure with event handler and data.
Definition: hpm_ipc_event_mgr.h:27
void * callback_data
Definition: hpm_ipc_event_mgr.h:29
ipc_event_callback_t callback
Definition: hpm_ipc_event_mgr.h:28