TLMoto / Nextion

Dependents:   Display

Revision:
1:e4163fd9aa4c
Parent:
0:67bae57e0b73
--- a/NexConfig.h	Wed Apr 15 17:02:54 2020 +0000
+++ b/NexConfig.h	Mon May 04 17:52:49 2020 +0000
@@ -1,54 +1,15 @@
-/**
- * @file NexConfig.h
- *
- * Options for user can be found here. 
- *
- * @author  Wu Pengfei (email:<pengfei.wu@itead.cc>)
- * @date    2015/8/13
- * @copyright 
- * Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- */
+
 #ifndef __NEXCONFIG_H__
 #define __NEXCONFIG_H__
-
-/**
- * @addtogroup Configuration 
- * @{ 
- */
-
-/** 
- * Define DEBUG_SERIAL_ENABLE to enable debug serial. 
- * Comment it to disable debug serial. 
- */
-#define DEBUG_SERIAL_ENABLE
-
-/**
- * Define dbSerial for the output of debug messages. 
- */
-#define dbSerial Serial
+#include "Serial.h"
+#include "mbed.h"
 
-/**
- * Define nexSerial for communicate with Nextion touch panel. 
- */
-#define nexSerial Serial2
-
+#define nexSerial_init(b)        Serial_Init(b)
+#define nexSerial_available()    Serial_Available()
+#define nexSerial_read()         Serial_Read()
+#define nexSerial_write(d)       Serial_Write(d)
+#define nexSerial_print(p)       Serial_Print(p) 
+#define nexSerial_readBytes(b,l) Serial_ReadBytes(b, l)
+#define nexDelay(d)              wait_ms(d)
 
-#ifdef DEBUG_SERIAL_ENABLE
-#define dbSerialPrint(a)    dbSerial.print(a)
-#define dbSerialPrintln(a)  dbSerial.println(a)
-#define dbSerialBegin(a)    dbSerial.begin(a)
-#else
-#define dbSerialPrint(a)    do{}while(0)
-#define dbSerialPrintln(a)  do{}while(0)
-#define dbSerialBegin(a)    do{}while(0)
-#endif
-
-/**
- * @}
- */
-
-#endif /* #ifndef __NEXCONFIG_H__ */
\ No newline at end of file
+#endif /* #ifndef __NEXCONFIG_H__ */