Nextion User Manual
For Arduino developers
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__ */
void detachPop(void)
Detach an callback function.
Definition: NexTouch.cpp:45
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Attach an callback function of pop touch event.
Definition: NexTouch.cpp:39
void(* NexTouchEventCb)(void *ptr)
Type of callback funciton when an touch event occurs.
Definition: NexTouch.h:45
void detachPush(void)
Detach an callback function.
Definition: NexTouch.cpp:33
NexTouch(uint8_t pid, uint8_t cid, const char *name)
Constructor.
Definition: NexTouch.cpp:18
Root class of all Nextion components.
Definition: NexObject.h:32
The definition of class NexObject.
Father class of the components with touch events.
Definition: NexTouch.h:53
Options for user can be found here.
void attachPush(NexTouchEventCb push, void *ptr=NULL)
Attach an callback function of push touch event.
Definition: NexTouch.cpp:27