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
Hardwares/ArduUTFT.h@42:c4e1606087ff, 2017-03-24 (annotated)
- Committer:
- hazheng
- Date:
- Fri Mar 24 15:44:08 2017 +0000
- Revision:
- 42:c4e1606087ff
- Parent:
- 41:7b21c5e3599e
- Child:
- 44:15de535c4005
Added more functions to TFT screen.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hazheng | 40:be98219930e4 | 1 | #pragma once |
hazheng | 40:be98219930e4 | 2 | #ifndef ARDU_UTFT_H |
hazheng | 40:be98219930e4 | 3 | #define ARDU_UTFT_H |
hazheng | 40:be98219930e4 | 4 | |
hazheng | 40:be98219930e4 | 5 | #include <mbed.h> |
hazheng | 40:be98219930e4 | 6 | #include "PinAssignment.h" |
hazheng | 40:be98219930e4 | 7 | |
hazheng | 40:be98219930e4 | 8 | #define ARDUCHIP_MODE 0x02 //Mode register |
hazheng | 40:be98219930e4 | 9 | //#define MCU2LCD_MODE 0x00 |
hazheng | 40:be98219930e4 | 10 | //#define CAM2LCD_MODE 0x01 |
hazheng | 40:be98219930e4 | 11 | #define MCU2LCD_MODE 0x01 |
hazheng | 40:be98219930e4 | 12 | #define CAM2LCD_MODE 0x02 |
hazheng | 40:be98219930e4 | 13 | //#define LCD2MCU_MODE 0x04 |
hazheng | 40:be98219930e4 | 14 | |
hazheng | 40:be98219930e4 | 15 | #define ARDUCHIP_TEST1_UTFT 0x00 //TEST register |
hazheng | 40:be98219930e4 | 16 | #define ARDUCHIP_TEST_MSG_UTFT 0x72 |
hazheng | 40:be98219930e4 | 17 | |
hazheng | 40:be98219930e4 | 18 | #define ARDUCHIP_VER_NUM_UTFT 0x61 |
hazheng | 42:c4e1606087ff | 19 | |
hazheng | 42:c4e1606087ff | 20 | |
hazheng | 42:c4e1606087ff | 21 | #define UTFT_DISP_X_SIZE 239 |
hazheng | 42:c4e1606087ff | 22 | #define UTFT_DISP_Y_SIZE 319 |
hazheng | 42:c4e1606087ff | 23 | |
hazheng | 42:c4e1606087ff | 24 | #define UTFT_LEFT 0 |
hazheng | 42:c4e1606087ff | 25 | #define UTFT_RIGHT 9999 |
hazheng | 42:c4e1606087ff | 26 | #define UTFT_CENTER 9998 |
hazheng | 40:be98219930e4 | 27 | |
hazheng | 40:be98219930e4 | 28 | void ardu_utft_init(); //We only use LANDSCAPE orientation! |
hazheng | 40:be98219930e4 | 29 | |
hazheng | 40:be98219930e4 | 30 | void ardu_cam_set_mode(uint8_t mode); |
hazheng | 40:be98219930e4 | 31 | |
hazheng | 41:7b21c5e3599e | 32 | void ardu_utft_write_DATA(uint8_t VH, uint8_t VL); |
hazheng | 41:7b21c5e3599e | 33 | |
hazheng | 40:be98219930e4 | 34 | void ardu_utft_clr_scr(); |
hazheng | 40:be98219930e4 | 35 | |
hazheng | 40:be98219930e4 | 36 | void ardu_utft_set_xy(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); |
hazheng | 40:be98219930e4 | 37 | |
hazheng | 40:be98219930e4 | 38 | void ardu_utft_reset_xy(); |
hazheng | 40:be98219930e4 | 39 | |
hazheng | 40:be98219930e4 | 40 | void ardu_utft_set_color(uint8_t r, uint8_t g, uint8_t b); |
hazheng | 40:be98219930e4 | 41 | |
hazheng | 40:be98219930e4 | 42 | void ardu_utft_draw_rect(int x1, int y1, int x2, int y2); |
hazheng | 40:be98219930e4 | 43 | |
hazheng | 40:be98219930e4 | 44 | void ardu_utft_draw_hline(int x, int y, int l); |
hazheng | 40:be98219930e4 | 45 | |
hazheng | 40:be98219930e4 | 46 | void ardu_utft_draw_vline(int x, int y, int l); |
hazheng | 40:be98219930e4 | 47 | |
hazheng | 42:c4e1606087ff | 48 | void ardu_utft_draw_pixel(int x, int y); |
hazheng | 42:c4e1606087ff | 49 | |
hazheng | 42:c4e1606087ff | 50 | void ardu_utft_fill_rect(int x1, int y1, int x2, int y2); |
hazheng | 42:c4e1606087ff | 51 | |
hazheng | 42:c4e1606087ff | 52 | void ardu_utft_set_font(uint8_t * font); |
hazheng | 42:c4e1606087ff | 53 | |
hazheng | 42:c4e1606087ff | 54 | void ardu_utft_print_char(char c, int x, int y); |
hazheng | 42:c4e1606087ff | 55 | |
hazheng | 42:c4e1606087ff | 56 | void ardu_utft_print(char * st, int x, int y); |
hazheng | 40:be98219930e4 | 57 | |
hazheng | 40:be98219930e4 | 58 | #endif //ARDU_UTFT_H |