Skip to content

Commit 4ca5031

Browse files
author
shennongmin
committed
Update doc.
Signed-off-by: shennongmin <[email protected]>
1 parent 1b8b1d8 commit 4ca5031

File tree

153 files changed

+1083
-1430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+1083
-1430
lines changed

NexButton.cpp

-20
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,11 @@
1515

1616
#include "NexButton.h"
1717

18-
/**
19-
* Constructor,inherited NexTouch's constructor function.
20-
*
21-
*/
2218
NexButton::NexButton(uint8_t pid, uint8_t cid, const char *name)
2319
:NexTouch(pid, cid, name)
2420
{
2521
}
2622

27-
/**
28-
* Get text value from button component.
29-
*
30-
* @param buffer - text buffer.
31-
* @param len - text buffer length.
32-
*
33-
* @return the text buffer length
34-
*/
3523
uint16_t NexButton::getText(char *buffer, uint16_t len)
3624
{
3725
String cmd;
@@ -42,14 +30,6 @@ uint16_t NexButton::getText(char *buffer, uint16_t len)
4230
return recvRetString(buffer,len);
4331
}
4432

45-
/**
46-
* Set text value of button component.
47-
*
48-
* @param buffer - text buffer.
49-
*
50-
* @retval true - success.
51-
* @retval false - failed.
52-
*/
5333
bool NexButton::setText(const char *buffer)
5434
{
5535
String cmd;

NexButton.h

+19-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@
2121
#include "NexHardware.h"
2222

2323
/**
24-
* NexButton,subclass of NexTouch,provides simple methods to control button component.
24+
* NexButton component.
2525
*
26+
* Commonly, you want to do something after push and pop it. It is recommanded that only
27+
* call @ref NexTouch::attachPop to satisfy your purpose.
28+
*
29+
* @warning Please do not call @ref NexTouch::attachPush on this component, even though you can.
2630
*/
2731
class NexButton: public NexTouch
2832
{
@@ -33,7 +37,21 @@ class NexButton: public NexTouch
3337
*/
3438
NexButton(uint8_t pid, uint8_t cid, const char *name);
3539

40+
/**
41+
* Get text attribute of component.
42+
*
43+
* @param buffer - buffer storing text returned.
44+
* @param len - length of buffer.
45+
* @return The real length of text returned.
46+
*/
3647
uint16_t getText(char *buffer, uint16_t len);
48+
49+
/**
50+
* Set text attribute of component.
51+
*
52+
* @param buffer - text buffer terminated with '\0'.
53+
* @return true if success, false for failure.
54+
*/
3755
bool setText(const char *buffer);
3856
};
3957

NexCrop.cpp

-20
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,11 @@
1515

1616
#include "NexCrop.h"
1717

18-
/**
19-
* Constructor,inherited NexTouch's constructor function.
20-
*
21-
*/
2218
NexCrop::NexCrop(uint8_t pid, uint8_t cid, const char *name)
2319
:NexTouch(pid, cid, name)
2420
{
2521
}
2622

27-
/*
28-
* Get the number of picture.
29-
*
30-
* @param number - an output parameter to save the number of picture.
31-
*
32-
* @retval true - success.
33-
* @retval false - failed.
34-
*/
3523
bool NexCrop::getPic(uint32_t *number)
3624
{
3725
String cmd = String("get ");
@@ -41,14 +29,6 @@ bool NexCrop::getPic(uint32_t *number)
4129
return recvRetNumber(number);
4230
}
4331

44-
/*
45-
* Set the number of picture.
46-
*
47-
* @param number - the number of picture.
48-
*
49-
* @retval true - success.
50-
* @retval false - failed.
51-
*/
5232
bool NexCrop::setPic(uint32_t number)
5333
{
5434
char buf[10] = {0};

NexCrop.h

+19-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
#include "NexHardware.h"
2222

2323
/**
24-
* NexCrop,subclass of NexTouch,provides simple methods to control crop component.
25-
*
24+
* NexCrop component.
2625
*/
2726
class NexCrop: public NexTouch
2827
{
@@ -32,8 +31,25 @@ class NexCrop: public NexTouch
3231
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
3332
*/
3433
NexCrop(uint8_t pid, uint8_t cid, const char *name);
35-
34+
35+
/**
36+
* Get the number of picture.
37+
*
38+
* @param number - an output parameter to save the number of picture.
39+
*
40+
* @retval true - success.
41+
* @retval false - failed.
42+
*/
3643
bool getPic(uint32_t *number);
44+
45+
/**
46+
* Set the number of picture.
47+
*
48+
* @param number - the number of picture.
49+
*
50+
* @retval true - success.
51+
* @retval false - failed.
52+
*/
3753
bool setPic(uint32_t number);
3854
};
3955

NexGauge.cpp

-20
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,11 @@
1515

1616
#include "NexGauge.h"
1717

18-
/**
19-
* Constructor,inherited NexTouch's constructor function.
20-
*
21-
*/
2218
NexGauge::NexGauge(uint8_t pid, uint8_t cid, const char *name)
2319
:NexObject(pid, cid, name)
2420
{
2521
}
2622

27-
/**
28-
* Get the value of gauge.
29-
*
30-
* @param number - an output parameter to save gauge's value.
31-
*
32-
* @retval true - success.
33-
* @retval false - failed.
34-
*/
3523
bool NexGauge::getValue(uint32_t *number)
3624
{
3725
String cmd = String("get ");
@@ -41,14 +29,6 @@ bool NexGauge::getValue(uint32_t *number)
4129
return recvRetNumber(number);
4230
}
4331

44-
/**
45-
* Set the value of gauge.
46-
*
47-
* @param number - the value of gauge.
48-
*
49-
* @retval true - success.
50-
* @retval false - failed.
51-
*/
5232
bool NexGauge::setValue(uint32_t number)
5333
{
5434
char buf[10] = {0};

NexGauge.h

+19-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
#include "NexHardware.h"
2222

2323
/**
24-
* NexGauge,subclass of NexTouch,provides simple methods to control gauge component.
25-
*
24+
* NexGauge component.
2625
*/
2726
class NexGauge: public NexObject
2827
{
@@ -31,8 +30,25 @@ class NexGauge: public NexObject
3130
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
3231
*/
3332
NexGauge(uint8_t pid, uint8_t cid, const char *name);
34-
33+
34+
/**
35+
* Get the value of gauge.
36+
*
37+
* @param number - an output parameter to save gauge's value.
38+
*
39+
* @retval true - success.
40+
* @retval false - failed.
41+
*/
3542
bool getValue(uint32_t *number);
43+
44+
/**
45+
* Set the value of gauge.
46+
*
47+
* @param number - the value of gauge.
48+
*
49+
* @retval true - success.
50+
* @retval false - failed.
51+
*/
3652
bool setValue(uint32_t number);
3753
};
3854

NexHardware.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#define NEX_RET_INVALID_VARIABLE (0x1A)
3333
#define NEX_RET_INVALID_OPERATION (0x1B)
3434

35-
/**
35+
/*
3636
* Receive uint32_t data.
3737
*
3838
* @param number - save uint32_t data.
@@ -84,7 +84,7 @@ bool recvRetNumber(uint32_t *number, uint32_t timeout)
8484
}
8585

8686

87-
/**
87+
/*
8888
* Receive string data.
8989
*
9090
* @param buffer - save string data.
@@ -156,7 +156,7 @@ uint16_t recvRetString(char *buffer, uint16_t len, uint32_t timeout)
156156
return ret;
157157
}
158158

159-
/**
159+
/*
160160
* Send command to Nextion.
161161
*
162162
* @param cmd - the string of command.
@@ -175,7 +175,7 @@ void sendCommand(const char* cmd)
175175
}
176176

177177

178-
/**
178+
/*
179179
* Command is executed successfully.
180180
*
181181
* @param timeout - set timeout time.
@@ -232,7 +232,7 @@ bool nexInit(void)
232232
return ret1 && ret2;
233233
}
234234

235-
void nexLoop(NexTouch **nex_listen_list)
235+
void nexLoop(NexTouch *nex_listen_list[])
236236
{
237237
static uint8_t __buffer[10];
238238

NexHardware.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ bool nexInit(void);
4141
* @warning This function must be called repeatedly to response touch events
4242
* from Nextion touch panel. Actually, you should place it in your loop function.
4343
*/
44-
void nexLoop(NexTouch **nex_listen_list);
44+
void nexLoop(NexTouch *nex_listen_list[]);
4545

4646
/**
4747
* @}

NexHotspot.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515

1616
#include "NexHotspot.h"
1717

18-
/**
19-
* Constructor,inherited NexTouch's constructor function.
20-
*
21-
*/
2218
NexHotspot::NexHotspot(uint8_t pid, uint8_t cid, const char *name)
2319
:NexTouch(pid, cid, name)
2420
{

NexHotspot.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
#include "NexHardware.h"
2222

2323
/**
24-
* NexHotspot,subclass of NexTouch,provides simple methods to control hotspot component.
25-
*
24+
* NexHotspot component.
2625
*/
2726
class NexHotspot: public NexTouch
2827
{

NexPage.cpp

-10
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,11 @@
1515

1616
#include "NexPage.h"
1717

18-
/**
19-
* Constructor,inherited NexTouch's constructor function.
20-
*
21-
*/
2218
NexPage::NexPage(uint8_t pid, uint8_t cid, const char *name)
2319
:NexTouch(pid, cid, name)
2420
{
2521
}
2622

27-
/**
28-
* Change page.
29-
*
30-
* @retval true - success.
31-
* @retval false - failed.
32-
*/
3323
bool NexPage::show(void)
3424
{
3525
uint8_t buffer[4] = {0};

NexPage.h

+8-5
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
#include "NexHardware.h"
2222

2323
/**
24-
* NexPage,subclass of NexTouch,provides simple methods to control page component.
25-
*
26-
* Actually, Page is also a component which can contain other components such as
27-
* Button, Text, etc.
24+
* A special component , which can contain other components such as NexButton,
25+
* NexText and NexWaveform, etc.
2826
*/
2927
class NexPage: public NexTouch
3028
{
@@ -33,8 +31,13 @@ class NexPage: public NexTouch
3331
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
3432
*/
3533
NexPage(uint8_t pid, uint8_t cid, const char *name);
34+
35+
/**
36+
* Show itself.
37+
*
38+
* @return true if success, false for faileure.
39+
*/
3640
bool show(void);
3741
};
3842

39-
4043
#endif /* #ifndef __NEXPAGE_H__ */

NexPicture.cpp

-20
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,11 @@
1515

1616
#include "NexPicture.h"
1717

18-
/**
19-
* Constructor,inherited NexTouch's constructor function.
20-
*
21-
*/
2218
NexPicture::NexPicture(uint8_t pid, uint8_t cid, const char *name)
2319
:NexTouch(pid, cid, name)
2420
{
2521
}
2622

27-
/**
28-
* Get picture's number.
29-
*
30-
* @param number - an output parameter to save picture number.
31-
*
32-
* @retval true - success.
33-
* @retval false - failed.
34-
*/
3523
bool NexPicture::getPic(uint32_t *number)
3624
{
3725
String cmd = String("get ");
@@ -41,14 +29,6 @@ bool NexPicture::getPic(uint32_t *number)
4129
return recvRetNumber(number);
4230
}
4331

44-
/**
45-
* Set picture's number.
46-
*
47-
* @param number -the picture number.
48-
*
49-
* @retval true - success.
50-
* @retval false - failed.
51-
*/
5232
bool NexPicture::setPic(uint32_t number)
5333
{
5434
char buf[10] = {0};

0 commit comments

Comments
 (0)