From a41db06404670b18c7a0809009d611a4bc807e90 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Sun, 25 Oct 2026 09:23:27 +0100 Subject: Initial commit, firmware skeleton --- firmware/src/display.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 firmware/src/display.hpp (limited to 'firmware/src/display.hpp') diff --git a/firmware/src/display.hpp b/firmware/src/display.hpp new file mode 100644 index 0000000..e2dabf2 --- /dev/null +++ b/firmware/src/display.hpp @@ -0,0 +1,22 @@ +#include "hardware/i2c.h" + +namespace display +{ + +// I2C0 on GPIO8 (SDA) and GPIO9 (SCL) running at 400KHz +constexpr auto I2C_PORT = i2c0; +constexpr unsigned I2C_SDA = 8; +constexpr unsigned I2C_SCL = 9; + +void +init() +{ + i2c_init(I2C_PORT, 400*1000); + + gpio_set_function(I2C_SDA, GPIO_FUNC_I2C); + gpio_set_function(I2C_SCL, GPIO_FUNC_I2C); + gpio_pull_up(I2C_SDA); + gpio_pull_up(I2C_SCL); +} + +} -- cgit v1.2.3