1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-09-29 14:11:58 +03:00
ben-wpan/atusb/fw2/io.h
Werner Almesberger 259400fdb8 atusb/fw2: firmware for the AVR-based atusb (in progress)
- ./: basic framework to build a firmware that can enumerate
- usb/patches/: patches to make FreakUSB 0.7 compile cleanly and to make
  it work in our context
2011-02-08 19:32:15 -03:00

40 lines
828 B
C

#ifndef IO_H
#define IO_H
#define LED_PORT B
#define LED_BIT 6
#define nRST_RF_PORT C
#define nRST_RF_BIT 7
#define SLP_TR_PORT B
#define SLP_TR_BIT 4
#define SCLK_PORT D
#define SCLK_BIT 5
#define MOSI_PORT D
#define MOSI_BIT 3
#define MISO_PORT D
#define MISO_BIT 2
#define nSS_PORT D
#define nSS_BIT 1
#define IRQ_RF_PORT D
#define IRQ_RF_BIT 0
#define SET_2(p, b) PORT##p |= 1 << (b)
#define CLR_2(p, b) PORT##p &= ~(1 << (b))
#define IN_2(p, b) DDR##p &= ~(1 << (b))
#define OUT_2(p, b) DDR##p |= 1 << (b)
#define SET_1(p, b) SET_2(p, b)
#define CLR_1(p, b) CLR_2(p, b)
#define IN_1(p, b) IN_2(p, b)
#define OUT_1(p, b) OUT_2(p, b)
#define SET(n) SET_1(n##_PORT, n##_BIT)
#define CLR(n) CLR_1(n##_PORT, n##_BIT)
#define IN(n) IN_1(n##_PORT, n##_BIT)
#define OUT(n) OUT_1(n##_PORT, n##_BIT)
#endif /* !IO_H */