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

Hardwares/ArduUTFT.h

Committer:
hazheng
Date:
2017-03-24
Revision:
42:c4e1606087ff
Parent:
41:7b21c5e3599e
Child:
44:15de535c4005

File content as of revision 42:c4e1606087ff:

#pragma once
#ifndef ARDU_UTFT_H
#define ARDU_UTFT_H

#include <mbed.h>
#include "PinAssignment.h"

#define ARDUCHIP_MODE           0x02  //Mode register
//#define MCU2LCD_MODE            0x00
//#define CAM2LCD_MODE            0x01
#define MCU2LCD_MODE            0x01
#define CAM2LCD_MODE            0x02
//#define LCD2MCU_MODE            0x04

#define ARDUCHIP_TEST1_UTFT          0x00  //TEST register
#define ARDUCHIP_TEST_MSG_UTFT       0x72

#define ARDUCHIP_VER_NUM_UTFT        0x61


#define UTFT_DISP_X_SIZE  239
#define UTFT_DISP_Y_SIZE  319

#define UTFT_LEFT 0
#define UTFT_RIGHT 9999
#define UTFT_CENTER 9998
    
void ardu_utft_init(); //We only use LANDSCAPE orientation!

void ardu_cam_set_mode(uint8_t mode);

void ardu_utft_write_DATA(uint8_t VH, uint8_t VL);

void ardu_utft_clr_scr();

void ardu_utft_set_xy(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);

void ardu_utft_reset_xy();

void ardu_utft_set_color(uint8_t r, uint8_t g, uint8_t b);

void ardu_utft_draw_rect(int x1, int y1, int x2, int y2);

void ardu_utft_draw_hline(int x, int y, int l);

void ardu_utft_draw_vline(int x, int y, int l);

void ardu_utft_draw_pixel(int x, int y);

void ardu_utft_fill_rect(int x1, int y1, int x2, int y2);

void ardu_utft_set_font(uint8_t * font);

void ardu_utft_print_char(char c, int x, int y);

void ardu_utft_print(char * st, int x, int y);

#endif //ARDU_UTFT_H