stmpe811_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 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 "kernel_defines.h"
22 #include "board.h"
23 #include "stmpe811.h"
24 #include "stmpe811_constants.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
36 #if IS_USED(MODULE_STMPE811_SPI)
37 /* SPI configuration */
38 #ifndef STMPE811_PARAM_SPI_DEV
39 #define STMPE811_PARAM_SPI_DEV SPI_DEV(0)
40 #endif
41 #ifndef STMPE811_PARAM_CLK
42 #define STMPE811_PARAM_CLK SPI_CLK_1MHZ
43 #endif
44 #ifndef STMPE811_PARAM_CS
45 #define STMPE811_PARAM_CS GPIO_PIN(0, 0)
46 #endif
47 #else
48 /* I2C configuration */
49 #ifndef STMPE811_PARAM_I2C_DEV
50 #define STMPE811_PARAM_I2C_DEV I2C_DEV(0)
51 #endif
52 #ifndef STMPE811_PARAM_ADDR
53 #define STMPE811_PARAM_ADDR (STMPE811_I2C_ADDR_DEFAULT)
54 #endif
55 #endif
56 
57 #ifndef STMPE811_PARAM_INT_PIN
58 #define STMPE811_PARAM_INT_PIN GPIO_PIN(0, 15)
59 #endif
60 #ifndef STMPE811_PARAM_XMAX
61 #define STMPE811_PARAM_XMAX (320U)
62 #endif
63 #ifndef STMPE811_PARAM_YMAX
64 #define STMPE811_PARAM_YMAX (240U)
65 #endif
66 #ifndef STMPE811_PARAM_XYCONV
67 #define STMPE811_PARAM_XYCONV (STMPE811_MIRROR_X | STMPE811_MIRROR_Y | STMPE811_SWAP_XY)
68 #endif
69 
70 #ifndef STMPE811_PARAMS
71 #if IS_USED(MODULE_STMPE811_SPI)
72 #define STMPE811_PARAMS { .spi = STMPE811_PARAM_SPI_DEV, \
73  .clk = STMPE811_PARAM_CLK, \
74  .cs = STMPE811_PARAM_CS, \
75  .int_pin = STMPE811_PARAM_INT_PIN, \
76  .xmax = STMPE811_PARAM_XMAX, \
77  .ymax = STMPE811_PARAM_YMAX, \
78  .xyconv = STMPE811_PARAM_XYCONV, \
79  }
80 #else
81 #define STMPE811_PARAMS { .i2c = STMPE811_PARAM_I2C_DEV, \
82  .addr = STMPE811_PARAM_ADDR, \
83  .int_pin = STMPE811_PARAM_INT_PIN, \
84  .xmax = STMPE811_PARAM_XMAX, \
85  .ymax = STMPE811_PARAM_YMAX, \
86  .xyconv = STMPE811_PARAM_XYCONV, \
87  }
88 #endif
89 #endif
96 {
97  STMPE811_PARAMS
98 };
99 
103 #ifndef STMPE811_PARAM_SCREEN_IDS
104 #define STMPE811_PARAM_SCREEN_IDS 0
105 #endif
106 
110 static const uint8_t stmpe811_screen_ids[] =
111 {
113 };
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
Common macros and compiler attributes/pragmas configuration.
Constants for STMPE811.
static const uint8_t stmpe811_screen_ids[]
Configure screen identifiers.
#define STMPE811_PARAM_SCREEN_IDS
Default screen identifiers.
static const stmpe811_params_t stmpe811_params[]
Configure STMPE811.
Device initialization parameters.
Definition: stmpe811.h:89