![]() |
Documentation
For Arduino users
|
#include <NexTimer.h>
Inherits NexTouch.
Public Member Functions | |
| NexTimer (uint8_t pid, uint8_t cid, const char *name) | |
| Constructor. More... | |
| void | attachTimer (NexTouchEventCb timer, void *ptr=NULL) |
| Attach an callback function of timer respond event. More... | |
| void | detachTimer (void) |
| Detach an callback function. More... | |
| bool | getCycle (uint32_t *number) |
| Get the value of timer cycle val. More... | |
| bool | setCycle (uint32_t number) |
| Set the value of timer cycle val. More... | |
| bool | enable (void) |
| contorl timer enable. More... | |
| bool | disable (void) |
| contorl timer disable. More... | |
| uint32_t | Get_cycle_tim (uint32_t *number) |
| Get tim attribute of component. More... | |
| bool | Set_cycle_tim (uint32_t number) |
| Set tim attribute of component. More... | |
Public Member Functions inherited from NexTouch | |
| NexTouch (uint8_t pid, uint8_t cid, const char *name) | |
| Constructor. More... | |
| void | attachPush (NexTouchEventCb push, void *ptr=NULL) |
| Attach an callback function of push touch event. More... | |
| void | detachPush (void) |
| Detach an callback function. More... | |
| void | attachPop (NexTouchEventCb pop, void *ptr=NULL) |
| Attach an callback function of pop touch event. More... | |
| void | detachPop (void) |
| Detach an callback function. More... | |
Public Member Functions inherited from NexObject | |
| NexObject (uint8_t pid, uint8_t cid, const char *name) | |
| Constructor. More... | |
| void | printObjInfo (void) |
| Print current object'address, page id, component id and name. More... | |
NexTimer component.
Commonly, you want to do something after set timer cycle and enable it,and the cycle value must be greater than 50
Definition at line 34 of file NexTimer.h.
| NexTimer::NexTimer | ( | uint8_t | pid, |
| uint8_t | cid, | ||
| const char * | name | ||
| ) |
Constructor.
| pid | - page id. |
| cid | - component id. |
| name | - pointer to an unique name in range of all components. |
Definition at line 18 of file NexTimer.cpp.
| void NexTimer::attachTimer | ( | NexTouchEventCb | timer, |
| void * | ptr = NULL |
||
| ) |
Attach an callback function of timer respond event.
| timer | - callback called with ptr when a timer respond event occurs. |
| ptr | - parameter passed into push[default:NULL]. |
Definition at line 23 of file NexTimer.cpp.
| void NexTimer::detachTimer | ( | void | ) |
| bool NexTimer::disable | ( | void | ) |
contorl timer disable.
| true | - success. |
| false | - failed. |
Definition at line 73 of file NexTimer.cpp.
| bool NexTimer::enable | ( | void | ) |
contorl timer enable.
| true | - success. |
| false | - failed. |
Definition at line 60 of file NexTimer.cpp.
| uint32_t NexTimer::Get_cycle_tim | ( | uint32_t * | number | ) |
Get tim attribute of component.
| number | - buffer storing data retur |
Definition at line 86 of file NexTimer.cpp.
| bool NexTimer::getCycle | ( | uint32_t * | number | ) |
Get the value of timer cycle val.
| number | - an output parameter to save the value of timer cycle. |
| true | - success. |
| false | - failed. |
Definition at line 33 of file NexTimer.cpp.
| bool NexTimer::Set_cycle_tim | ( | uint32_t | number | ) |
Set tim attribute of component.
| number | - To set up the data |
Definition at line 95 of file NexTimer.cpp.
| bool NexTimer::setCycle | ( | uint32_t | number | ) |
Set the value of timer cycle val.
| number | - the value of timer cycle. |
| true | - success. |
| false | - failed. |
Definition at line 42 of file NexTimer.cpp.