#ifndef __SN32F780_SPI_LCD_H
#define __SN32F780_SPI_LCD_H

/*_____ I N C L U D E S ____________________________________________________*/
#include <stdint.h>

/*_____ D E F I N I T I O N S ______________________________________________*/

#define __LCD_SET_RST_OUTPUT_LOW  	SN_GPIO2->MODE_b.MODE1 = 1; __LCD_SET_RST_LOW
#define __LCD_SET_RST_LOW  					SN_GPIO2->DATA_b.DATA1 = 0;
#define __LCD_SET_RST_HIGH  				SN_GPIO2->DATA_b.DATA1 = 1;
#define __LCD_SET_DC_OUTPUT_LOW  		SN_GPIO2->MODE_b.MODE2 = 1; __LCD_SET_DC_LOW
#define __LCD_SET_DC_LOW  					SN_GPIO2->DATA_b.DATA2 = 0;
#define __LCD_SET_DC_HIGH  					SN_GPIO2->DATA_b.DATA2 = 1;

#define LCD_X_SIZE_V		240
#define LCD_Y_SIZE_V		320

#define LCD_X_SIZE_H		320
#define LCD_Y_SIZE_H	  240

//Color
#define WHITE        0xFFFF
#define BLACK        0x0000	  
#define BLUE         0x001F  
#define BRED         0XF81F
#define GRED 			   0XFFE0
#define GBLUE			   0X07FF
#define RED          0xF800
#define MAGENTA      0xF81F
#define GREEN        0x07E0
#define CYAN         0x7FFF
#define YELLOW       0xFFE0
#define BROWN 			 0XBC40 
#define BRRED 			 0XFC07 
#define GRAY  			 0X8430 


/*_____ D E C L A R A T I O N S ____________________________________________*/
void LCD_Init_ILI9341(uint8_t bHorizontal, uint8_t bVertical);
void LCD_Clear(uint16_t hwColor);
void SPI_LCDWrite_CMD(uint8_t bCMD);
void SPI_LCDWrite_DATA(uint8_t bData);

#endif	/*__SN32F780_SPI_LCD_H*/
