NexTouch.h
Go to the documentation of this file.
#ifndef __NEXTOUCH_H__
#define __NEXTOUCH_H__
#include <Arduino.h>
#include "NexConfig.h"
#include "NexObject.h"
#define NEX_EVENT_PUSH (0x01)
#define NEX_EVENT_POP (0x00)
typedef void (*NexTouchEventCb)(void *ptr);
class NexTouch: public NexObject
{
public: /* static methods */
static void iterate(NexTouch **list, uint8_t pid, uint8_t cid, int32_t event);
public: /* methods */
NexTouch(uint8_t pid, uint8_t cid, const char *name);
void attachPush(NexTouchEventCb push, void *ptr = NULL);
void detachPush(void);
void attachPop(NexTouchEventCb pop, void *ptr = NULL);
void detachPop(void);
private: /* methods */
void push(void);
void pop(void);
private: /* data */
NexTouchEventCb __cb_push;
void *__cbpush_ptr;
NexTouchEventCb __cb_pop;
void *__cbpop_ptr;
};
#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