cst816s_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Koen Zandberg
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 
22 #include "board.h"
23 #include "cst816s.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
33 /* I2C configuration */
34 #ifndef CST816S_PARAM_I2C_DEV
35 #define CST816S_PARAM_I2C_DEV I2C_DEV(0)
36 #endif
37 
38 #ifndef CST816S_PARAM_I2C_ADDR
39 #define CST816S_PARAM_I2C_ADDR (0x15)
40 #endif
41 
42 #ifndef CST816S_PARAM_IRQ
43 #define CST816S_PARAM_IRQ GPIO_PIN(0, 28)
44 #endif
45 
46 #ifndef CST816S_PARAM_IRQ_FLANK
47 #define CST816S_PARAM_IRQ_FLANK GPIO_FALLING
48 #endif
49 
50 #ifndef CST816S_PARAM_RESET
51 #define CST816S_PARAM_RESET GPIO_PIN(0, 10)
52 #endif
53 
54 #define CST816S_PARAMS \
55  { \
56  .i2c_dev = CST816S_PARAM_I2C_DEV, \
57  .i2c_addr = CST816S_PARAM_I2C_ADDR, \
58  .irq = CST816S_PARAM_IRQ, \
59  .irq_flank = CST816S_PARAM_IRQ_FLANK, \
60  .reset = CST816S_PARAM_RESET, \
61  }
68 {
69  CST816S_PARAMS
70 };
71 
75 #define CST816S_NUMOF ARRAY_SIZE(cst816s_params)
76 
80 #ifndef CST816S_PARAM_SCREEN_IDS
81 #define CST816S_PARAM_SCREEN_IDS 0
82 #endif
83 
87 static const uint8_t cst816s_screen_ids[] =
88 {
90 };
91 
92 #ifdef __cplusplus
93 }
94 #endif
95 
Device driver interface for the CST816S touch screen.
#define CST816S_PARAM_SCREEN_IDS
Default screen identifiers.
static const cst816s_params_t cst816s_params[]
Configure CST816S.
static const uint8_t cst816s_screen_ids[]
Configure screen identifiers.
cst816s driver struct
Definition: cst816s.h:102