u8g2_display_params.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2025 HAW Hamburg
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
22 #include "board.h"
23 #include "u8g2_display.h"
24 
25 #include "periph/i2c.h"
26 #include "periph/spi.h"
27 #include "periph/gpio.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
43 #ifndef U8G2_DISPLAY_PARAM_DEV
44 # define U8G2_DISPLAY_PARAM_DEV I2C_DEV(0)
45 #endif
46 
51 #ifndef U8G2_DISPLAY_PARAM_I2C_ADDR
52 # define U8G2_DISPLAY_PARAM_I2C_ADDR (0x3c)
53 #endif
54 
59 #ifndef U8G2_DISPLAY_PARAM_PIN_CS
60 # define U8G2_DISPLAY_PARAM_PIN_CS GPIO_UNDEF
61 #endif
62 
67 #ifndef U8G2_DISPLAY_PARAM_PIN_DC
68 # define U8G2_DISPLAY_PARAM_PIN_DC GPIO_UNDEF
69 #endif
70 
75 #ifndef U8G2_DISPLAY_PARAM_PIN_RESET
76 # define U8G2_DISPLAY_PARAM_PIN_RESET GPIO_UNDEF
77 #endif
78 
84 #ifndef U8G2_DISPLAY_PARAM_INIT_FUNCTION
85 # define U8G2_DISPLAY_PARAM_INIT_FUNCTION u8g2_Setup_ssd1306_i2c_128x64_noname_f
86 #endif
87 
91 #ifndef U8G2_DISPLAY_PARAMS
92 # define U8G2_DISPLAY_PARAMS \
93  { \
94  .init_function = U8G2_DISPLAY_PARAM_INIT_FUNCTION, \
95  .peripheral_configuration = { \
96  .device_index = U8G2_DISPLAY_PARAM_DEV, \
97  .pin_cs = U8G2_DISPLAY_PARAM_PIN_CS, \
98  .pin_dc = U8G2_DISPLAY_PARAM_PIN_DC, \
99  .pin_reset = U8G2_DISPLAY_PARAM_PIN_RESET, \
100  }, \
101  .i2c_address = U8G2_DISPLAY_PARAM_I2C_ADDR, \
102  }
103 #endif
110 {
112 };
113 
117 #ifndef U8G2_DISPLAY_PARAM_SCREEN_IDS
118 # define U8G2_DISPLAY_PARAM_SCREEN_IDS 0
119 #endif
120 
124 static const uint8_t u8g2_display_screen_ids[] =
125 {
127 };
128 
129 #ifdef __cplusplus
130 }
131 #endif
132 
Low-level GPIO peripheral driver interface definitions.
static const uint8_t u8g2_display_screen_ids[]
Configure screen identifiers.
static const u8g2_display_params_t u8g2_display_params[]
Configuration struct.
#define U8G2_DISPLAY_PARAMS
Default configuration struct.
#define U8G2_DISPLAY_PARAM_SCREEN_IDS
Default screen identifiers.
Low-level I2C peripheral driver interface definition.
Low-level SPI peripheral driver interface definition.
U8G2 display initialization parameters.
Definition: u8g2_display.h:44