ili9341_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Koen Zandberg <koen@bergzand.net>
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 
19 #ifndef ILI9341_PARAMS_H
20 #define ILI9341_PARAMS_H
21 
22 #include "board.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /* Default parameters for ILI9341 display */
33 #ifndef ILI9341_PARAM_SPI
34 #define ILI9341_PARAM_SPI SPI_DEV(0)
35 #endif
36 #ifndef ILI9341_PARAM_SPI_CLK
37 #define ILI9341_PARAM_SPI_CLK SPI_CLK_5MHZ
38 #endif
39 #ifndef ILI9341_PARAM_CS
40 #define ILI9341_PARAM_CS GPIO_PIN(2, 2)
41 #endif
42 #ifndef ILI9341_PARAM_DCX
43 #define ILI9341_PARAM_DCX GPIO_PIN(3, 13)
44 #endif
45 #ifndef ILI9341_PARAM_RST
46 #define ILI9341_PARAM_RST GPIO_UNDEF
47 #endif
48 #ifndef ILI9341_PARAM_SPI_MODE
49 #define ILI9341_PARAM_SPI_MODE SPI_MODE_0
50 #endif
51 #ifndef ILI9341_PARAM_RGB
52 #define ILI9341_PARAM_RGB 0
53 #endif
54 #ifndef ILI9341_PARAM_INVERTED
55 #define ILI9341_PARAM_INVERTED 0
56 #endif
57 
58 #ifndef ILI9341_PARAM_NUM_LINES
59 #define ILI9341_PARAM_NUM_LINES 320U
60 #endif
61 
62 #ifndef ILI9341_PARAMS
63 #define ILI9341_PARAMS { .spi = ILI9341_PARAM_SPI, \
64  .spi_clk = ILI9341_PARAM_SPI_CLK, \
65  .spi_mode = ILI9341_PARAM_SPI_MODE, \
66  .cs_pin = ILI9341_PARAM_CS, \
67  .dcx_pin = ILI9341_PARAM_DCX, \
68  .rst_pin = ILI9341_PARAM_RST, \
69  .rgb = ILI9341_PARAM_RGB, \
70  .inverted = ILI9341_PARAM_INVERTED, \
71  .lines = ILI9341_PARAM_NUM_LINES, \
72  }
73 #endif
74 
80 {
81  ILI9341_PARAMS,
82 };
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif /* ILI9341_PARAMS_H */
ili9341_params_t
Device initialization parameters.
Definition: ili9341.h:93
ili9341_params
static const ili9341_params_t ili9341_params[]
Configure ILI9341.
Definition: ili9341_params.h:79