3 \brief Port descriptions for the DonbFET platform.
6 /* NB: define default CPU frequency */
7 //XXX #define F_CPU 8000000UL
8 #define F_CPU 20000000UL
13 #include <avr/sleep.h>
14 #include <avr/interrupt.h>
15 #include <avr/pgmspace.h>
16 #include <util/delay.h>
25 /* all AVR SRAM starts after I/O mapped memory and registers */
26 #define RAMSTART 0x100
55 //Use P3 instead of P5 for target I/O on chips without P5.
57 //#warning "No P5, using P3 instead. Will break 2618 and 1612 support."
69 # if (platform == donbfet)
73 //# define SPIREN P5REN
77 //This is how things used to work, don't do it anymore.
79 //#define P5REN somedamnedextern
82 #if (platform == donbfet)
83 # define SETSS PORTA|=SS;
84 # define CLRSS PORTA&=~SS;
85 # define DIRSS DDRA|=SS;
87 //No longer works for Hope badge.
88 # define SETSS P5OUT|=BIT0
89 # define CLRSS P5OUT&=~BIT0
90 # define DIRSS P5DIR|=BIT0;
93 //Used for the Nordic port, !RST pin on regular GoodFET.
94 #define SETCE P2OUT|=BIT6
95 #define CLRCE P2OUT&=~BIT6
96 #define DIRCE P2DIR|=BIT6
98 // network byte order converters
99 #define htons(x) ((((uint16_t)(x) & 0xFF00) >> 8) | \
100 (((uint16_t)(x) & 0x00FF) << 8))
101 #define htonl(x) ((((uint32_t)(x) & 0xFF000000) >> 24) | \
102 (((uint32_t)(x) & 0x00FF0000) >> 8) | \
103 (((uint32_t)(x) & 0x0000FF00) << 8) | \
104 (((uint32_t)(x) & 0x000000FF) << 24))
109 extern uint8_t donbfet_get_byte(uint16_t);