Skip to content

Commit a5f7625

Browse files
authored
Merge pull request #424 from dynfer/chibios-21.11.x
stm32H7 compatibility and fixes to header
2 parents 7853c52 + ecb3452 commit a5f7625

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

os/hal/ports/STM32/LLD/LTDCv1/hal_stm32_ltdc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ void ltdcInit(void) {
233233
rccResetLTDC();
234234

235235
/* Enable the LTDC clock.*/
236-
#if defined(STM32H743xx)
237-
RCC->D1CFGR = (RCC->D1CFGR & ~(0x3U << 16U)) | (2 << 16);
238-
#else
236+
#if defined(STM32H7)
237+
RCC->APB3ENR |= RCC_APB3ENR_LTDCEN; /* Enable LTDC clock. */
238+
#else defined(STM32F4)
239239
RCC->DCKCFGR = (RCC->DCKCFGR & ~RCC_DCKCFGR_PLLSAIDIVR) | (2 << 16); /* /8 */
240240
#endif
241241
rccEnableLTDC(false);
@@ -769,7 +769,7 @@ bool ltdcIsDitheringEnabledI(LTDCDriver *ltdcp) {
769769
osalDbgCheck(ltdcp == &LTDCD1);
770770
(void)ltdcp;
771771

772-
#if defined(STM32H743xx)
772+
#if defined(STM32H7)
773773
return (LTDC->GCR & LTDC_GCR_DEN) != 0;
774774
#else
775775
return (LTDC->GCR & LTDC_GCR_DTEN) != 0;
@@ -809,7 +809,7 @@ void ltdcEnableDitheringI(LTDCDriver *ltdcp) {
809809
osalDbgCheckClassI();
810810
osalDbgCheck(ltdcp == &LTDCD1);
811811
(void)ltdcp;
812-
#if defined(STM32H743xx)
812+
#if defined(STM32H7)
813813
LTDC->GCR |= LTDC_GCR_DEN;
814814
#else
815815
LTDC->GCR |= LTDC_GCR_DTEN;
@@ -847,7 +847,7 @@ void ltdcDisableDitheringI(LTDCDriver *ltdcp) {
847847
osalDbgCheck(ltdcp == &LTDCD1);
848848
(void)ltdcp;
849849

850-
#if defined(STM32H743xx)
850+
#if defined(STM32H7)
851851
LTDC->GCR &= ~LTDC_GCR_DEN;
852852
#else
853853
LTDC->GCR &= ~LTDC_GCR_DTEN;

os/hal/ports/STM32/LLD/LTDCv1/hal_stm32_ltdc.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#ifndef HAL_STM32_LTDC_H_
2626
#define HAL_STM32_LTDC_H_
2727

28+
#include "hal.h"
29+
2830
/**
2931
* @brief Using the LTDC driver.
3032
*/
@@ -285,7 +287,6 @@ typedef struct ltdc_window_t ltdc_window_t;
285287
typedef struct ltdc_frame_t ltdc_frame_t;
286288
typedef struct ltdc_laycfg_t ltdc_laycfg_t;
287289
typedef struct LTDCConfig LTDCConfig;
288-
typedef enum ltdc_state_t ltdc_state_t;
289290
typedef struct LTDCDriver LTDCDriver;
290291

291292
/**
@@ -457,7 +458,7 @@ typedef struct LTDCConfig {
457458
/**
458459
* @brief LTDC driver state.
459460
*/
460-
typedef enum ltdc_state_t {
461+
typedef enum {
461462
LTDC_UNINIT = (0), /**< Not initialized.*/
462463
LTDC_STOP = (1), /**< Stopped.*/
463464
LTDC_READY = (2), /**< Ready.*/

0 commit comments

Comments
 (0)