| Documentation For Arduino users

- Main Page
- Related Pages
- Modules
- Classes
- Files
- Examples

- File List
- File Members

NexTouch.h
Go to the documentation of this file.
1
17 #ifndef __NEXTOUCH_H__
18 #define __NEXTOUCH_H__
19
20 #include <Arduino.h>
21 #include "NexConfig.h"
22 #include "NexObject.h"
23
32 #define NEX_EVENT_PUSH (0x01)
33
37 #define NEX_EVENT_POP (0x00)
38
45 typedef void (*NexTouchEventCb)(void *ptr);
46
53 class NexTouch: public NexObject
54 {
55 public: /* static methods */
56 static void iterate(NexTouch **list, uint8_t pid, uint8_t cid, int32_t event);
57
58 public: /* methods */
59
63 NexTouch(uint8_t pid, uint8_t cid, const char *name);
64
74 void attachPush(NexTouchEventCb push, void *ptr = NULL);
75
81 void detachPush(void);
82
92 void attachPop(NexTouchEventCb pop, void *ptr = NULL);
93
99 void detachPop(void);
100
101 private: /* methods */
102 void push(void);
103 void pop(void);
104
105 private: /* data */
106 NexTouchEventCb __cb_push;
107 void *__cbpush_ptr;
108 NexTouchEventCb __cb_pop;
109 void *__cbpop_ptr;
110 };
111
116 #endif /* #ifndef __NEXTOUCH_H__ */
NexTouch::detachPop
void detachPop(void)
Detach an callback function.
Definition: NexTouch.cpp:45
NexTouch::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Attach an callback function of pop touch event.
Definition: NexTouch.cpp:39
NexTouchEventCb
void(* NexTouchEventCb)(void *ptr)
Type of callback funciton when an touch event occurs.
Definition: NexTouch.h:45
NexTouch::detachPush
void detachPush(void)
Detach an callback function.
Definition: NexTouch.cpp:33
NexTouch::NexTouch
NexTouch(uint8_t pid, uint8_t cid, const char *name)
Constructor.
Definition: NexTouch.cpp:18
NexObject
Root class of all Nextion components.
Definition: NexObject.h:32
NexObject.h
The definition of class NexObject.
NexTouch
Father class of the components with touch events.
Definition: NexTouch.h:53
NexConfig.h
Options for user can be found here.
NexTouch::attachPush
void attachPush(NexTouchEventCb push, void *ptr=NULL)
Attach an callback function of push touch event.
Definition: NexTouch.cpp:27