2 \author bx, forked from donbfet.h by Don A. Bailey
3 \brief Port descriptions for the Zigduino platform.
6 /* NB: define default CPU frequency */
7 #define F_CPU 16000000UL
12 #include <avr/sleep.h>
13 #include <avr/interrupt.h>
14 #include <avr/pgmspace.h>
15 #include <util/delay.h>
53 //Use P3 instead of P5 for target I/O on chips without P5.
55 //#warning "No P5, using P3 instead. Will break 2618 and 1612 support."
67 # if (platform == zigduino)
75 //This is how things used to work, don't do it anymore.
77 //#define P5REN somedamnedextern
80 #if (platform == zigduino)
81 # define SETSS PORTA|=SS;
82 # define CLRSS PORTA&=~SS;
83 # define DIRSS DDRA|=SS;
85 //No longer works for Hope badge.
86 # define SETSS P5OUT|=BIT0
87 # define CLRSS P5OUT&=~BIT0
88 # define DIRSS P5DIR|=BIT0;
91 //Used for the Nordic port, !RST pin on regular GoodFET.
92 #define SETCE P2OUT|=BIT6
93 #define CLRCE P2OUT&=~BIT6
94 #define DIRCE P2DIR|=BIT6
96 // network byte order converters
97 #define htons(x) ((((uint16_t)(x) & 0xFF00) >> 8) | \
98 (((uint16_t)(x) & 0x00FF) << 8))
99 #define htonl(x) ((((uint32_t)(x) & 0xFF000000) >> 24) | \
100 (((uint32_t)(x) & 0x00FF0000) >> 8) | \
101 (((uint32_t)(x) & 0x0000FF00) << 8) | \
102 (((uint32_t)(x) & 0x000000FF) << 24))
106 #define INITCHIP zigduino_init();
107 extern uint8_t zigduino_get_byte(uint16_t);