qp_ili9486.h (2419B)
1 // Copyright 2021 Nick Brassel (@tzarc) 2 // SPDX-License-Identifier: GPL-2.0-or-later 3 4 #pragma once 5 6 #include "gpio.h" 7 #include "qp_internal.h" 8 9 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 10 // Quantum Painter ILI9486 configurables (add to your keyboard's config.h) 11 12 #ifndef ILI9486_NUM_DEVICES 13 /** 14 * @def This controls the maximum number of ILI9486 devices that Quantum Painter can communicate with at any one time. 15 * Increasing this number allows for multiple displays to be used. 16 */ 17 # define ILI9486_NUM_DEVICES 1 18 #endif 19 20 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 21 // Quantum Painter ILI9486 device factories 22 23 #ifdef QUANTUM_PAINTER_ILI9486_SPI_ENABLE 24 /** 25 * Factory method for an ILI9486 SPI LCD device. 26 * 27 * @param panel_width[in] the width of the display panel 28 * @param panel_height[in] the height of the display panel 29 * @param chip_select_pin[in] the GPIO pin used for SPI chip select 30 * @param dc_pin[in] the GPIO pin used for D/C control 31 * @param reset_pin[in] the GPIO pin used for RST 32 * @param spi_divisor[in] the SPI divisor to use when communicating with the display 33 * @param spi_mode[in] the SPI mode to use when communicating with the display 34 * @return the device handle used with all drawing routines in Quantum Painter 35 */ 36 painter_device_t qp_ili9486_make_spi_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); 37 38 /** 39 * Factory method for an ILI9486 SPI LCD device. 40 * 41 * @param panel_width[in] the width of the display panel 42 * @param panel_height[in] the height of the display panel 43 * @param chip_select_pin[in] the GPIO pin used for SPI chip select 44 * @param dc_pin[in] the GPIO pin used for D/C control 45 * @param reset_pin[in] the GPIO pin used for RST 46 * @param spi_divisor[in] the SPI divisor to use when communicating with the display 47 * @param spi_mode[in] the SPI mode to use when communicating with the display 48 * @return the device handle used with all drawing routines in Quantum Painter 49 */ 50 painter_device_t qp_ili9486_make_spi_waveshare_device(uint16_t panel_width, uint16_t panel_height, pin_t chip_select_pin, pin_t dc_pin, pin_t reset_pin, uint16_t spi_divisor, int spi_mode); 51 52 #endif // QUANTUM_PAINTER_ILI9486_SPI_ENABLE