mirror of
https://github.com/opentx/opentx.git
synced 2025-07-19 22:35:12 +03:00
[Taranis+] LCD driver now ok
This commit is contained in:
parent
3a7f122323
commit
aa733fa060
1 changed files with 7 additions and 9 deletions
|
@ -98,12 +98,12 @@ const uint8_t lcdPalette[4] = { 0, 0x03, 0x06, 0x0F };
|
||||||
|
|
||||||
#define LCD_WRITE_BIT(bit) \
|
#define LCD_WRITE_BIT(bit) \
|
||||||
if (bit) \
|
if (bit) \
|
||||||
GPIOD->BSRRL = PIN_LCD_MOSI; \
|
LCD_MOSI_HIGH(); \
|
||||||
else \
|
else \
|
||||||
GPIOD->BSRRH = PIN_LCD_MOSI; \
|
LCD_MOSI_LOW(); \
|
||||||
GPIOD->BSRRH = PIN_LCD_CLK; /* Clock low */ \
|
LCD_CLK_LOW(); \
|
||||||
__no_operation(); \
|
__no_operation(); \
|
||||||
GPIOD->BSRRL = PIN_LCD_CLK; /* Clock high */
|
LCD_CLK_HIGH();
|
||||||
|
|
||||||
void lcdRefresh()
|
void lcdRefresh()
|
||||||
{
|
{
|
||||||
|
@ -189,7 +189,9 @@ static void LCD_Hardware_Init()
|
||||||
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_SPI, &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;
|
GPIO_InitStructure.GPIO_Pin = PIN_LCD_NCS;
|
||||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||||
|
@ -200,10 +202,6 @@ static void LCD_Hardware_Init()
|
||||||
|
|
||||||
/*!< Configure lcd RST pin in output pushpull mode ,PULLUP *************/
|
/*!< Configure lcd RST pin in output pushpull mode ,PULLUP *************/
|
||||||
GPIO_InitStructure.GPIO_Pin = PIN_LCD_RST;
|
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);
|
GPIO_Init(GPIO_LCD_RST, &GPIO_InitStructure);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue