SmartWheels self-driving race car. Designed for NXP Cup. Uses FRDM-KL25Z, area-scan camera, and simple image processing to detect and navigate any NXP spec track.

Dependencies:   TSI USBDevice mbed-dev

Fork of SmartWheels by haofan Zheng

Revision:
97:0ed9ede9a995
Parent:
96:ec89c4d1383d
diff -r ec89c4d1383d -r 0ed9ede9a995 Hardwares/ArduUTFT.cpp
--- a/Hardwares/ArduUTFT.cpp	Wed Apr 19 19:43:15 2017 +0000
+++ b/Hardwares/ArduUTFT.cpp	Wed Apr 19 21:17:40 2017 +0000
@@ -31,7 +31,7 @@
 static DigitalOut utft_cs(PIN_AUC_CS, 1);
 static DigitalOut utft_sd_cs(PIN_AUC_SD_CS, 1);
 
-inline void ardu_cam_spi_write_8(int address, int value)
+inline void ardu_utft_spi_write_8(int address, int value)
 {
     utft_cs = 0;
     g_spi_port.write(address | 0x80);
@@ -39,7 +39,7 @@
     utft_cs = 1;
 }
 
-inline uint8_t ardu_cam_spi_read_8(int address)
+inline uint8_t ardu_utft_spi_read_8(int address)
 {
     utft_cs = 0;
     g_spi_port.write(address & 0x7F);
@@ -83,11 +83,11 @@
 
 void ardu_utft_init()
 {
-    uint8_t VerNum = ardu_cam_spi_read_8(ARDUCHIP_VER_UTFT);
-    VerNum = ardu_cam_spi_read_8(ARDUCHIP_VER_UTFT);
+    uint8_t VerNum = ardu_utft_spi_read_8(ARDUCHIP_VER_UTFT);
+    VerNum = ardu_utft_spi_read_8(ARDUCHIP_VER_UTFT);
     
-    ardu_cam_spi_write_8(ARDUCHIP_TEST1_UTFT, ARDUCHIP_TEST_MSG_UTFT);
-    uint8_t testV = ardu_cam_spi_read_8(ARDUCHIP_TEST1_UTFT);
+    ardu_utft_spi_write_8(ARDUCHIP_TEST1_UTFT, ARDUCHIP_TEST_MSG_UTFT);
+    uint8_t testV = ardu_utft_spi_read_8(ARDUCHIP_TEST1_UTFT);
     if(VerNum != ARDUCHIP_VER_NUM_UTFT || testV != ARDUCHIP_TEST_MSG_UTFT)
     {
         
@@ -148,7 +148,7 @@
 
 void ardu_cam_set_mode(uint8_t mode)
 {
-    ardu_cam_spi_write_8(ARDUCHIP_MODE, MCU2LCD_MODE);
+    ardu_utft_spi_write_8(ARDUCHIP_MODE, MCU2LCD_MODE);
 }
 
 void ardu_utft_clr_scr()
@@ -325,6 +325,11 @@
         ardu_utft_print_char(*st++, x - (i * (font_x_size)), y);
 }
 
+uint8_t ardu_utft_get_ver_num()
+{
+    return ardu_utft_spi_read_8(ARDUCHIP_VER_UTFT);
+}
+
 #ifdef __cplusplus
 }
 #endif
\ No newline at end of file