LCD pins remapped

This commit is contained in:
Andre Bernet
2014-04-29 16:47:12 +02:00
parent 7fc1372f8f
commit bdf4e6d0d1
3 changed files with 43 additions and 22 deletions
+10 -10
View File
@@ -19,20 +19,20 @@ extern "C" {
#define __no_operation __NOP #define __no_operation __NOP
#define LCD_NCS_HIGH() GPIO_LCD->BSRRL = PIN_LCD_NCS #define LCD_NCS_HIGH() GPIO_LCD_NCS->BSRRL = PIN_LCD_NCS
#define LCD_NCS_LOW() GPIO_LCD->BSRRH = PIN_LCD_NCS #define LCD_NCS_LOW() GPIO_LCD_NCS->BSRRH = PIN_LCD_NCS
#define LCD_A0_HIGH() GPIO_LCD->BSRRL = PIN_LCD_A0 #define LCD_A0_HIGH() GPIO_LCD_SPI->BSRRL = PIN_LCD_A0
#define LCD_A0_LOW() GPIO_LCD->BSRRH = PIN_LCD_A0 #define LCD_A0_LOW() GPIO_LCD_SPI->BSRRH = PIN_LCD_A0
#define LCD_RST_HIGH() GPIO_LCD->BSRRL = PIN_LCD_RST #define LCD_RST_HIGH() GPIO_LCD_RST->BSRRL = PIN_LCD_RST
#define LCD_RST_LOW() GPIO_LCD->BSRRH = PIN_LCD_RST #define LCD_RST_LOW() GPIO_LCD_RST->BSRRH = PIN_LCD_RST
#define LCD_CLK_HIGH() GPIO_LCD->BSRRL = PIN_LCD_CLK #define LCD_CLK_HIGH() GPIO_LCD_SPI->BSRRL = PIN_LCD_CLK
#define LCD_CLK_LOW() GPIO_LCD->BSRRH = PIN_LCD_CLK #define LCD_CLK_LOW() GPIO_LCD_SPI->BSRRH = PIN_LCD_CLK
#define LCD_MOSI_HIGH() GPIO_LCD->BSRRL = PIN_LCD_MOSI #define LCD_MOSI_HIGH() GPIO_LCD_SPI->BSRRL = PIN_LCD_MOSI
#define LCD_MOSI_LOW() GPIO_LCD->BSRRH = PIN_LCD_MOSI #define LCD_MOSI_LOW() GPIO_LCD_SPI->BSRRH = PIN_LCD_MOSI
void AspiCmd(u8 Command_Byte); void AspiCmd(u8 Command_Byte);
void AspiData(u8 Para_data); void AspiData(u8 Para_data);
+22 -8
View File
@@ -225,14 +225,28 @@
#define GPIOBL GPIOB #define GPIOBL GPIOB
#define GPIO_PinSource_BL GPIO_PinSource8 #define GPIO_PinSource_BL GPIO_PinSource8
// LCD GPIOD 10-14 // LCD
#define RCC_AHB1Periph_LCD RCC_AHB1Periph_GPIOD #if defined(REVPLUS)
#define GPIO_LCD GPIOD #define RCC_AHB1Periph_LCD RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD
#define PIN_LCD_MOSI GPIO_Pin_10 //PD.10 #define GPIO_LCD_SPI GPIOC
#define PIN_LCD_CLK GPIO_Pin_11 //PD.11 #define GPIO_LCD_NCS GPIOA
#define PIN_LCD_NCS GPIO_Pin_14 //PD.14 #define GPIO_LCD_RST GPIOD
#define PIN_LCD_A0 GPIO_Pin_13 //PD.13 #define PIN_LCD_MOSI GPIO_Pin_12 //PC.12
#define PIN_LCD_RST GPIO_Pin_12 //pd12 test //RESET occurs when powered up,but should delay before initialize #define PIN_LCD_CLK GPIO_Pin_10 //PC.10
#define PIN_LCD_NCS GPIO_Pin_15 //PA.15
#define PIN_LCD_A0 GPIO_Pin_11 //PC.11
#define PIN_LCD_RST GPIO_Pin_12 //PD.12
#else
#define RCC_AHB1Periph_LCD RCC_AHB1Periph_GPIOD
#define GPIO_LCD_SPI GPIOD
#define GPIO_LCD_NCS GPIOD
#define GPIO_LCD_RST GPIOD
#define PIN_LCD_MOSI GPIO_Pin_10 //PD.10
#define PIN_LCD_CLK GPIO_Pin_11 //PD.11
#define PIN_LCD_NCS GPIO_Pin_14 //PD.14
#define PIN_LCD_A0 GPIO_Pin_13 //PD.13
#define PIN_LCD_RST GPIO_Pin_12 //PD.12
#endif
// Audio - I2S3 // Audio - I2S3
#define CODEC_I2S SPI3 #define CODEC_I2S SPI3
+10 -3
View File
@@ -171,16 +171,23 @@ static void LCD_Hardware_Init()
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIO_LCD, &GPIO_InitStructure); GPIO_Init(GPIO_LCD_SPI, &GPIO_InitStructure);
LCD_NCS_HIGH(); LCD_NCS_HIGH();
/*!< Configure lcd NCS pin in output pushpull mode ,PULLUP *************/ /*!< Configure lcd NCS pin in output pushpull mode ,PULLUP *************/
GPIO_InitStructure.GPIO_Pin = PIN_LCD_NCS |PIN_LCD_RST; GPIO_InitStructure.GPIO_Pin = PIN_LCD_NCS;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIO_LCD_NCS, &GPIO_InitStructure);
GPIO_Init(GPIO_LCD, &GPIO_InitStructure); /*!< Configure lcd RST pin in output pushpull mode ,PULLUP *************/
GPIO_InitStructure.GPIO_Pin = PIN_LCD_RST;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIO_LCD_RST, &GPIO_InitStructure);
} }
//275us //275us