/* * lcd.c * * Copyright (c) 2024 Thomas Buck (thomas@xythobuz.de) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * See . */ #include #include #include #include "pico/stdlib.h" #include "hardware/i2c.h" #include "ssd1306.h" #include "lcd.h" static ssd1306_t disp; void lcd_init(void) { i2c_init(i2c1, 400000); gpio_set_function(0, GPIO_FUNC_I2C); gpio_set_function(1, GPIO_FUNC_I2C); gpio_pull_up(0); gpio_pull_up(1); disp.external_vcc = false; ssd1306_init(&disp, 128, 64, 0x3C, i2c1); }