mikroSDK Reference Manual
lv_msg.h
Go to the documentation of this file.
1
6#ifndef LV_MSG_H
7#define LV_MSG_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/*********************
14 * INCLUDES
15 *********************/
17#if LV_USE_MSG
18
19/*********************
20 * DEFINES
21 *********************/
22
23/**********************
24 * TYPEDEFS
25 **********************/
26
27typedef struct {
28 uint32_t id; /*Identifier of the message*/
29 void * user_data; /*Set the the user_data set in `lv_msg_subscribe`*/
30 void * _priv_data; /*Used internally*/
31 const void * payload; /*Pointer to the data of the message*/
32} lv_msg_t;
33
34typedef void (*lv_msg_subscribe_cb_t)(void * s, lv_msg_t * msg);
35
36typedef void (*lv_msg_request_cb_t)(void * r, uint32_t msg_id);
37
38/**********************
39 * GLOBAL PROTOTYPES
40 **********************/
41
45void lv_msg_init(void);
46
54void * lv_msg_subsribe(uint32_t msg_id, lv_msg_subscribe_cb_t cb, void * user_data);
55
64void * lv_msg_subsribe_obj(uint32_t msg_id, lv_obj_t * obj, void * user_data);
65
71void lv_msg_unsubscribe(void * s);
72
78void lv_msg_send(uint32_t msg_id, const void * payload);
79
85uint32_t lv_msg_get_id(lv_msg_t * m);
86
92const void * lv_msg_get_payload(lv_msg_t * m);
93
99void * lv_msg_get_user_data(lv_msg_t * m);
100
106lv_msg_t * lv_event_get_msg(lv_event_t * e);
107
108/*Fix typo*/
109static inline void * lv_msg_subscribe(uint32_t msg_id, lv_msg_subscribe_cb_t cb, void * user_data)
110{
111 return lv_msg_subsribe(msg_id, cb, user_data);
112}
113
114static inline void * lv_msg_subscribe_obj(uint32_t msg_id, lv_obj_t * obj, void * user_data)
115{
116 return lv_msg_subsribe_obj(msg_id, obj, user_data);
117}
118
119/**********************
120 * GLOBAL VARIABLES
121 **********************/
122
123extern lv_event_code_t LV_EVENT_MSG_RECEIVED;
124
125/**********************
126 * MACROS
127 **********************/
128
129#endif /*LV_USE_MSG*/
130
131#ifdef __cplusplus
132} /*extern "C"*/
133#endif
134
135#endif /*LV_MSG_H*/
lv_event_code_t
Definition lv_event.h:32
Definition lv_event.h:94
Definition lv_obj.h:174