Loading...
Searching...
No Matches
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
19#ifndef STMPE811_PARAMS_H
20#define STMPE811_PARAMS_H
21
22#include "kernel_defines.h"
23#include "board.h"
24#include "stmpe811.h"
25#include "stmpe811_constants.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
37#if IS_USED(MODULE_STMPE811_SPI)
38/* SPI configuration */
39#ifndef STMPE811_PARAM_SPI_DEV
40#define STMPE811_PARAM_SPI_DEV SPI_DEV(0)
41#endif
42#ifndef STMPE811_PARAM_CLK
43#define STMPE811_PARAM_CLK SPI_CLK_1MHZ
44#endif
45#ifndef STMPE811_PARAM_CS
46#define STMPE811_PARAM_CS GPIO_PIN(0, 0)
47#endif
48#else
49/* I2C configuration */
50#ifndef STMPE811_PARAM_I2C_DEV
51#define STMPE811_PARAM_I2C_DEV I2C_DEV(0)
52#endif
53#ifndef STMPE811_PARAM_ADDR
54#define STMPE811_PARAM_ADDR (STMPE811_I2C_ADDR_DEFAULT)
55#endif
56#endif
57
58#ifndef STMPE811_PARAM_INT_PIN
59#define STMPE811_PARAM_INT_PIN GPIO_PIN(0, 15)
60#endif
61#ifndef STMPE811_PARAM_XMAX
62#define STMPE811_PARAM_XMAX (320U)
63#endif
64#ifndef STMPE811_PARAM_YMAX
65#define STMPE811_PARAM_YMAX (240U)
66#endif
67#ifndef STMPE811_PARAM_XYCONV
68#define STMPE811_PARAM_XYCONV (STMPE811_MIRROR_X | STMPE811_MIRROR_Y | STMPE811_SWAP_XY)
69#endif
70
71#ifndef STMPE811_PARAMS
72#if IS_USED(MODULE_STMPE811_SPI)
73#define STMPE811_PARAMS { .spi = STMPE811_PARAM_SPI_DEV, \
74 .clk = STMPE811_PARAM_CLK, \
75 .cs = STMPE811_PARAM_CS, \
76 .int_pin = STMPE811_PARAM_INT_PIN, \
77 .xmax = STMPE811_PARAM_XMAX, \
78 .ymax = STMPE811_PARAM_YMAX, \
79 .xyconv = STMPE811_PARAM_XYCONV, \
80 }
81#else
82#define STMPE811_PARAMS { .i2c = STMPE811_PARAM_I2C_DEV, \
83 .addr = STMPE811_PARAM_ADDR, \
84 .int_pin = STMPE811_PARAM_INT_PIN, \
85 .xmax = STMPE811_PARAM_XMAX, \
86 .ymax = STMPE811_PARAM_YMAX, \
87 .xyconv = STMPE811_PARAM_XYCONV, \
88 }
89#endif
90#endif
97{
98 STMPE811_PARAMS
99};
100
104#ifndef STMPE811_PARAM_SCREEN_IDS
105#define STMPE811_PARAM_SCREEN_IDS 0
106#endif
107
111static const uint8_t stmpe811_screen_ids[] =
112{
114};
115
116#ifdef __cplusplus
117}
118#endif
119
120#endif /* STMPE811_PARAMS_H */
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:90