diff options
author | Robert Pelnar <robert.pelnar@seznam.cz> | 2017-08-17 16:23:34 +0300 |
---|---|---|
committer | Robert Pelnar <robert.pelnar@seznam.cz> | 2017-08-17 16:23:34 +0300 |
commit | 683784c4c7d92f352c65b53e750b48fb50d2354b (patch) | |
tree | 0545097a1aa6bd19850b09158ba716f0f98e59a3 /Firmware/uni_avr_rpi.h | |
parent | a7477673de5ee67b09d04a8c81129ebd5345ebb7 (diff) |
PAT9125 I2C, hardware SG homing
separate pin configuration file for each board
changed board codes:
RAMBO =100, MiniRambo1.0 =200, MiniRambo1.3 = 203, Einy03 =303, Einy04 =304
Diffstat (limited to 'Firmware/uni_avr_rpi.h')
-rw-r--r-- | Firmware/uni_avr_rpi.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Firmware/uni_avr_rpi.h b/Firmware/uni_avr_rpi.h new file mode 100644 index 000000000..6a7200c31 --- /dev/null +++ b/Firmware/uni_avr_rpi.h @@ -0,0 +1,31 @@ +// unification for AVR and RPI +#define __AVR + +#ifdef __AVR + //#include "Arduino.h" + #include "Marlin.h" + #define GPIO_INP(gpio) pinMode(gpio, INPUT) + #define GPIO_OUT(gpio) pinMode(gpio, OUTPUT) + #define GPIO_SET(gpio) digitalWrite(gpio, HIGH) + #define GPIO_CLR(gpio) digitalWrite(gpio, LOW) + #define GPIO_GET(gpio) (digitalRead(gpio) != LOW) + #define DELAY(delay) delayMicroseconds(delay) + #define PRINT MYSERIAL.print +#endif //RC522_AVR + +#ifdef __RPI + #include <bcm2835.h> + #define GPIO_INP(gpio) bcm2835_gpio_fsel(gpio, BCM2835_GPIO_FSEL_INPT) + #define GPIO_OUT(gpio) bcm2835_gpio_fsel(gpio, BCM2835_GPIO_FSEL_OUTP) + #define GPIO_SET(gpio) bcm2835_gpio_write(gpio, HIGH) + #define GPIO_CLR(gpio) bcm2835_gpio_write(gpio, LOW) + #define GPIO_GET(gpio) (bcm2835_gpio_lev(gpio) != LOW) + #include <unistd.h> + #define DELAY(delay) usleep(delay) + #define PRINT(p) print(p) + #define DEC 10 + #define HEX 16 + void print(const char* pc) { printf("%s", pc); } + void print(int v) { printf("%d", v); } + void print(float v) { printf("%f", v); } +#endif //RC522_RPI |