cpu_ltdc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Inria
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
21 #include <stdint.h>
22 
23 #include "periph/cpu_gpio.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
32 typedef struct {
33  gpio_t pin;
35 } ltdc_gpio_t;
36 
40 typedef struct {
41  uint8_t bus;
42  uint32_t rcc_mask;
47  ltdc_gpio_t r_pin[8];
48  ltdc_gpio_t g_pin[8];
49  ltdc_gpio_t b_pin[8];
50  uint8_t hsync;
51  uint8_t vsync;
52  uint8_t hbp;
53  uint8_t hfp;
54  uint8_t vbp;
55  uint8_t vfp;
56 } ltdc_conf_t;
57 
61 void ltdc_init(void);
62 
66 void ltdc_clear(void);
67 
77 void ltdc_map(uint16_t x1, uint16_t x2, uint16_t y1, uint16_t y2, const uint16_t *color);
78 
88 void ltdc_fill(uint16_t x1, uint16_t x2, uint16_t y1, uint16_t y2, const uint16_t color);
89 
90 #ifdef __cplusplus
91 }
92 #endif
93 
GPIO CPU definitions for the STM32 family.
void ltdc_clear(void)
Clear the LTDC display.
void ltdc_init(void)
Initialize the LTDC (LCD-TFT Display Controller) peripheral.
void ltdc_map(uint16_t x1, uint16_t x2, uint16_t y1, uint16_t y2, const uint16_t *color)
Map a buffer of RGB565 (16bit depth) colors to the display.
void ltdc_fill(uint16_t x1, uint16_t x2, uint16_t y1, uint16_t y2, const uint16_t color)
Fill a region of the display with the same color.
gpio_af_t
Override alternative GPIO mode options.
Definition: periph_cpu.h:165
LTDC Peripheral configuration.
Definition: cpu_ltdc.h:40
ltdc_gpio_t vsync_pin
Vertical synchronization pin.
Definition: cpu_ltdc.h:46
uint8_t hsync
Horizontal synchronization.
Definition: cpu_ltdc.h:50
ltdc_gpio_t hsync_pin
Horizontal synchronization pin.
Definition: cpu_ltdc.h:45
uint8_t hbp
Horizontal back porch.
Definition: cpu_ltdc.h:52
uint8_t vbp
Vertical back porch.
Definition: cpu_ltdc.h:54
uint32_t rcc_mask
bit in clock enable register
Definition: cpu_ltdc.h:42
ltdc_gpio_t de_pin
Data enable pin.
Definition: cpu_ltdc.h:44
uint8_t bus
APB bus.
Definition: cpu_ltdc.h:41
uint8_t vsync
Vertical synchronization.
Definition: cpu_ltdc.h:51
uint8_t hfp
Horizontal front porch.
Definition: cpu_ltdc.h:53
ltdc_gpio_t clk_pin
CLK pin.
Definition: cpu_ltdc.h:43
uint8_t vfp
Vertical front porch.
Definition: cpu_ltdc.h:55
LTDC GPIO configuration.
Definition: cpu_ltdc.h:32
gpio_t pin
GPIO pin.
Definition: cpu_ltdc.h:33
gpio_af_t af
Alternate function.
Definition: cpu_ltdc.h:34