diff --git a/src/energenie/drv/build_rpi b/src/energenie/drv/build_rpi index dd89023..a796686 100755 --- a/src/energenie/drv/build_rpi +++ b/src/energenie/drv/build_rpi @@ -3,26 +3,27 @@ # build file for Raspberry Pi use # build gpio_test -gcc gpio_test.c gpio_rpi.c +gcc gpio_test.c gpio_rpi.c delay_posix.c mv a.out gpio_test chmod u+x gpio_test # build spis_test (soft SPI tester) -gcc spi_test.c spis_rpi.c gpio_rpi.c -mv a.out spis_test -chmod u+x spis_test +##gcc spi_test.c spis_rpi.c gpio_rpi.c +##mv a.out spis_test +##chmod u+x spis_test + # build spih_test (hard SPI tester) -gcc spi_test.c spih_rpi.c gpio_rpi.c -mv a.out spih_test -chmod u+x spish_test +##gcc spi_test.c spih_rpi.c gpio_rpi.c +##mv a.out spih_test +##chmod u+x spish_test # build hrf69_test -## gcc hrf69_test.c hrf69.c spis_rpi.c gpio_rpi.c -## mv a.out hrf69_test -## chmod u+x hrf69_test +##gcc hrfm69_test.c hrfm69.c spis_rpi.c gpio_rpi.c delay_posix.c +##mv a.out hrfm69_test +##chmod u+x hrfm69_test # build radio_test @@ -32,9 +33,9 @@ # build spi .so library on Raspberry Pi -gcc -Wall -shared -o spi_rpi.so -fPIC spis_rpi.c gpio_rpi.c +##gcc -Wall -shared -o spi_rpi.so -fPIC spis_rpi.c gpio_rpi.c # nm -D spi_rpi.so -cp spi_rpi.so .. +##cp spi_rpi.so .. # radio spi .so library on Raspberry Pi ## gcc -Wall -shared -o radio_rpi.so -fPIC radio.c hrf69.c spis_rpi.c gpio_rpi.c diff --git a/src/energenie/drv/delay_posix.c b/src/energenie/drv/delay_posix.c index 3604557..6f5bd4b 100644 --- a/src/energenie/drv/delay_posix.c +++ b/src/energenie/drv/delay_posix.c @@ -3,7 +3,7 @@ * Delay routines for posix compliant standard libraries (not Arduino) */ -//#include +#include #include #include "system.h" diff --git a/src/energenie/drv/gpio_rpi.c b/src/energenie/drv/gpio_rpi.c index 07348d5..8896682 100644 --- a/src/energenie/drv/gpio_rpi.c +++ b/src/energenie/drv/gpio_rpi.c @@ -101,13 +101,13 @@ } -void gpio_setin(int g) +void gpio_setin(uint8_t g) { INP_GPIO(g); } -void gpio_setout(int g) +void gpio_setout(uint8_t g) { /* always INP_GPIO before OUT_GPIO */ //INP_GPIO(g); #### this causes glitching @@ -115,19 +115,19 @@ } -void gpio_high(int g) +void gpio_high(uint8_t g) { GPIO_HIGH(g); } -void gpio_low(int g) +void gpio_low(uint8_t g) { GPIO_LOW(g); } -void gpio_write(int g, int v) +void gpio_write(uint8_t g, uint8_t v) { if (v != 0) { @@ -140,7 +140,7 @@ } -int gpio_read(int g) +uint8_t gpio_read(uint8_t g) { return GPIO_READ(g); } diff --git a/src/energenie/drv/gpio_test.c b/src/energenie/drv/gpio_test.c index 1736bb8..bc27569 100644 --- a/src/energenie/drv/gpio_test.c +++ b/src/energenie/drv/gpio_test.c @@ -1,5 +1,5 @@ /* gpio_test.c 30/07/2015 D.J.Whale - * Simple test that GPIO 2/3 work + * Simple test that two GPIO pins work */ #include @@ -14,8 +14,8 @@ * different platforms will have different available GPIO numbers */ -#define GPIO_A 2 -#define GPIO_B 3 +#define GPIO_A 22 +#define GPIO_B 27 int main(void) {