All Classes Files Functions Typedefs Groups Pages
NexTimer Class Reference
Nextion Component

`#include <NexTimer.h>`

Inheritance diagram for NexTimer:

## Public Member Functions

| NexTimer (uint8_t pid, uint8_t cid, const char *name)
void | attachTimer (NexTouchEventCb timer, void *ptr=NULL)
void | detachTimer (void)
bool | getCycle (uint32_t *number)
bool | setCycle (uint32_t number)
bool | enable (void)
bool | disable (void)
uint32_t | Get_cycle_tim (uint32_t *number)
bool | Set_cycle_tim (uint32_t number)
Public Member Functions inherited from NexTouch
| 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)
Public Member Functions inherited from NexObject
| NexObject (uint8_t pid, uint8_t cid, const char *name)
void | printObjInfo (void)

## Additional Inherited Members

Static Public Member Functions inherited from NexTouch
static void | iterate (NexTouch **list, uint8_t pid, uint8_t cid, int32_t event)
Protected Member Functions inherited from NexObject
uint8_t | getObjPid (void)
uint8_t | getObjCid (void)
const char * | getObjName (void)

## Detailed Description

NexTimer component.

Commonly, you want to do something after set timer cycle and enable it,and the cycle value must be greater than 50

## Constructor & Destructor Documentation

NexTimer::NexTimer | ( | uint8_t | pid,
|  | uint8_t | cid,
|  | const char * | name
| ) |  |

Constructor.

Parameters

  pid | - page id.
  cid | - component id.
  name | - pointer to an unique name in range of all components.

## Member Function Documentation

void NexTimer::attachTimer | ( | NexTouchEventCb | timer,
|  | void * | ptr = `NULL`
| ) |  |

Attach an callback function of timer respond event.

Parameters

  timer | - callback called with ptr when a timer respond event occurs.
  ptr | - parameter passed into push[default:NULL].

Returns
  none.

Note
  If calling this method multiply, the last call is valid.

void NexTimer::detachTimer | ( | void |  | ) |

Detach an callback function.

Returns
  none.

bool NexTimer::disable | ( | void |  | ) |

contorl timer disable.

Return values

  true | - success.
  false | - failed.

bool NexTimer::enable | ( | void |  | ) |

contorl timer enable.

Return values

  true | - success.
  false | - failed.

uint32_t NexTimer::Get_cycle_tim | ( | uint32_t * | number | ) |

Get tim attribute of component

Parameters

  number | - buffer storing data retur

Returns
  the length of the data

bool NexTimer::getCycle | ( | uint32_t * | number | ) |

Get the value of timer cycle val.

Parameters

  number | - an output parameter to save the value of timer cycle.

Return values

  true | - success.
  false | - failed.

bool NexTimer::Set_cycle_tim | ( | uint32_t | number | ) |

Set tim attribute of component

Parameters

  number | - To set up the data

Returns
  true if success, false for failure

bool NexTimer::setCycle | ( | uint32_t | number | ) |

Set the value of timer cycle val.

Parameters

  number | - the value of timer cycle.

Return values

  true | - success.
  false | - failed.

Warning
  the cycle value must be greater than 50.

The documentation for this class was generated from the following files:

- NexTimer.h
- NexTimer.cpp