mirror of
https://github.com/usetrmnl/bb_epaper.git
synced 2026-04-29 13:43:26 -07:00
Fixes for RPI
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user