diff --git a/Makefile b/Makefile index 7d192f3..f7db7d1 100644 --- a/Makefile +++ b/Makefile @@ -146,12 +146,15 @@ $(PREFIX)/bin/scrot: sh -c 'cd $(PREFIX)/src/scrot && ./autogen.sh && ./configure MAKE=$(MAKE) PREFIX=$(PREFIX)' $(MAKE) -C $(PREFIX)/src/scrot install +# I tried final_official_2.50 but it wouldn't build +# (ld: error: duplicate symbol: comDat) # depends on # apk:sudo $(PREFIX)/src/wiringpi: git clone https://github.com/WiringPi/WiringPi.git $(PREFIX)/src/wiringpi - git -C $(PREFIX)/src/wiringpi checkout final_official_2.50 - sed -i .tmp -e /^sudo/d $(PREFIX)/src/wiringpi/build + git -C $(PREFIX)/src/wiringpi checkout 2.61-1 + sed -i .old -e /^sudo/d $(PREFIX)/src/wiringpi/build + sed -i .old -e s/root\.root/root\:root/ $(PREFIX)/src/wiringpi/gpio sh -c 'cd $(PREFIX)/src/wiringpi; sudo=sudo ./build' $(PREFIX)/bin/xdo: diff --git a/ht16k33/Makefile b/ht16k33/Makefile new file mode 100644 index 0000000..6341795 --- /dev/null +++ b/ht16k33/Makefile @@ -0,0 +1,3 @@ +CFLAGS += -I/usr/local/include -L/usr/local/lib +ht16k33: ht16k33.c + $(CC) $(CFLAGS) -lwiringPi -o ht16k33 ht16k33.c diff --git a/ht16k33/README.txt b/ht16k33/README.txt new file mode 100644 index 0000000..499dbf0 --- /dev/null +++ b/ht16k33/README.txt @@ -0,0 +1,2 @@ +This program depends on WiringPi. Build instructions can be found in the +Makefile in the root of this project. diff --git a/ht16k33/ht16k33.c b/ht16k33/ht16k33.c new file mode 100644 index 0000000..a2ac1c7 --- /dev/null +++ b/ht16k33/ht16k33.c @@ -0,0 +1,14 @@ +#include +#include +#include "ht16k33.h" + +/* https://cdn-shop.adafruit.com/datasheets/ht16K33v110.pdf */ + +#define ADDRESS 0x70 + +int main(int argc, char *argv[]){ + int fd; + + fd = wiringPiI2CSetup(ADDRESS); + close(fd); +} diff --git a/ht16k33/ht16k33.h b/ht16k33/ht16k33.h new file mode 100644 index 0000000..4c7c81a --- /dev/null +++ b/ht16k33/ht16k33.h @@ -0,0 +1,11 @@ +/* Definitions were determined by reading Adafruit code and the datasheet. */ + +#define HT16K33_SYSTEM_CMD 0x20 /* 0b0010???x */ +#define HT16K33_SYSTEM_ON 0x01 /* 0b00000001 */ +#define HT16K33_SYSTEM_OFF 0x00 /* 0b00000000 */ + +/* `0xE0 | n`, where 0 <= n <= 15 and the display dims to (n+1)/16 duty */ +#define HT16K33_CMD_BRIGHTNESS 0xE0 /* 0b1110xxxx */ + +#define HT16K33_BLINK_CMD 0x80 /* 0b1000?xxx */ +#define HT16K33_BLINK_DISPLAYON 0x01 /* 0b1000???x */