Commit 5ff03cd2 authored by Bodmer's avatar Bodmer

Support STM32F1xx

STM32F1xx processors do not have MODER direction configuration.
parent 1bd0b96c
...@@ -129,13 +129,21 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len){ ...@@ -129,13 +129,21 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len){
void TFT_eSPI::busDir(uint32_t mask, uint8_t mode) void TFT_eSPI::busDir(uint32_t mask, uint8_t mode)
{ {
#ifdef STM_PORTA_DATA_BUS #ifdef STM_PORTA_DATA_BUS
if (mode == OUTPUT) GPIOA->MODER = (GPIOA->MODER & 0xFFFF0000) | 0x00005555; #if defined (STM32F1xx)
else GPIOA->MODER &= 0xFFFF0000; if (mode == OUTPUT) GPIOA->CRL = 0x33333333;
else GPIOA->CRL = 0x88888888;
#else
if (mode == OUTPUT) GPIOA->MODER = (GPIOA->MODER & 0xFFFF0000) | 0x00005555;
else GPIOA->MODER &= 0xFFFF0000;
#endif
#elif STM_PORTB_DATA_BUS #elif STM_PORTB_DATA_BUS
if (mode == OUTPUT) GPIOB->MODER = (GPIOB->MODER & 0xFFFF0000) | 0x00005555; #if defined (STM32F1xx)
else GPIOB->MODER &= 0xFFFF0000; if (mode == OUTPUT) GPIOB->CRL = 0x33333333;
else GPIOB->CRL = 0x88888888;
#else
if (mode == OUTPUT) GPIOB->MODER = (GPIOB->MODER & 0xFFFF0000) | 0x00005555;
else GPIOB->MODER &= 0xFFFF0000;
#endif
#else #else
if (mode == OUTPUT) { if (mode == OUTPUT) {
LL_GPIO_SetPinMode(D0_PIN_PORT, D0_PIN_MASK, LL_GPIO_MODE_OUTPUT); LL_GPIO_SetPinMode(D0_PIN_PORT, D0_PIN_MASK, LL_GPIO_MODE_OUTPUT);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment