Без опису
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * lcd.c
  3. *
  4. * Copyright (c) 2024 Thomas Buck (thomas@xythobuz.de)
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * See <http://www.gnu.org/licenses/>.
  17. */
  18. #include <stdio.h>
  19. #include <stdint.h>
  20. #include <string.h>
  21. #include "pico/stdlib.h"
  22. #include "hardware/i2c.h"
  23. #include "ssd1306.h"
  24. #include "lcd.h"
  25. static ssd1306_t disp;
  26. void lcd_init(void) {
  27. i2c_init(i2c1, 400000);
  28. gpio_set_function(0, GPIO_FUNC_I2C);
  29. gpio_set_function(1, GPIO_FUNC_I2C);
  30. gpio_pull_up(0);
  31. gpio_pull_up(1);
  32. disp.external_vcc = false;
  33. ssd1306_init(&disp, 128, 64, 0x3C, i2c1);
  34. }