Fixes for RPI

This commit is contained in:
Larry Bank
2024-11-02 16:47:09 +00:00
parent 6df1be6fa3
commit 96d516cb7c
3 changed files with 20 additions and 5 deletions
+9
View File
@@ -0,0 +1,9 @@
The default Raspberry Pi Linux installation is missing a few tools that are required to build this library. Execute the following in a terminal command line:
>sudo apt install libgpiod-dev
The SPI bus access is off by default, so to enable it, type the following:
>sudo raspi-config
Select option 3 (Interface Options), then option I4 (SPI). Choose yes, then
finish.
+8 -4
View File
@@ -5,7 +5,8 @@
// Copyright (c) 2024 BitBank Software, Inc.
//
#include "../../../src/bb_epaper.h"
BBEPAPER bbep(EPD213_104x212); // InkyPHAT 2.13"
//BBEPAPER bbep(EPD213_104x212); // InkyPHAT 2.13"
BBEPAPER bbep(EPD295_128x296);
// BCM GPIO numbers
#define PIN_DC 22
#define PIN_RST 27
@@ -14,12 +15,15 @@ BBEPAPER bbep(EPD213_104x212); // InkyPHAT 2.13"
#define SPI_BUS 0
int main(int argc, const char * argv[]) {
bbep.initIO(PIN_DC, PIN_RST, PIN_BUSY, PIN_CS, SPI_BUS, 4000000);
bbep.fillRect(0,0,104,212, BBEP_WHITE);
// bbep.allocBuffer();
bbep.fillScreen(BBEP_WHITE);
bbep.setRotation(90);
bbep.setFont(FONT_12x16);
bbep.setTextColor(BBEP_BLACK, BBEP_WHITE);
bbep.setFont(FONT_16x16);
bbep.setTextColor(BBEP_BLACK);
bbep.drawString("Hello World!", 0, 0);
// bbep.writePlane();
bbep.refresh(REFRESH_FULL);
bbep.sleep(DEEP_SLEEP);
+3 -1
View File
@@ -34,7 +34,9 @@
#ifndef CONSUMER
#define CONSUMER "Consumer"
#endif
#define pgm_read_byte(a) *(uint8_t *)a
#define pgm_read_byte(a) (*(uint8_t *)a)
#define pgm_read_word(a) (*(uint16_t *)a)
#define pgm_read_dword(a) (*(uint32_t *)a)
#define memcpy_P memcpy
struct gpiod_chip *chip = NULL;
struct gpiod_line *lines[64];