X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Fplatforms%2Fzigduino.h;h=b1231cfc1a21696f4a15bacab265b897625160d4;hp=cc56739d76e301fdc3bc7257c076a73ac1727830;hb=f4a366d95f96109559f0903611d7103c50cde3f7;hpb=05e744a159e6c7b808b12e53b5ac231a8045bd8b diff --git a/firmware/platforms/zigduino.h b/firmware/platforms/zigduino.h index cc56739..b1231cf 100644 --- a/firmware/platforms/zigduino.h +++ b/firmware/platforms/zigduino.h @@ -1,11 +1,10 @@ -/*! \file donbfet.h - \author Don A. Bailey - \brief Port descriptions for the DonbFET platform. +/*! \file zigduino.h + \author bx, forked from donbfet.h by Don A. Bailey + \brief Port descriptions for the Zigduino platform. */ /* NB: define default CPU frequency */ -//XXX #define F_CPU 8000000UL -#define F_CPU 20000000UL +#define F_CPU 16000000UL #include #include @@ -22,8 +21,6 @@ #include #include -/* all AVR SRAM starts after I/O mapped memory and registers */ -#define RAMSTART 0x100 #ifndef PB0 # define PB0 PORTB0 @@ -50,7 +47,8 @@ //LED on P1.0 #define PLEDOUT PORTB #define PLEDDIR DDRB -#define PLEDPIN PB0 +#define PLEDPIN PINB1 +//#define LEDPIN PINB //Use P3 instead of P5 for target I/O on chips without P5. #ifdef msp430f2274 @@ -67,10 +65,10 @@ #else # if (platform == zigduino) -# define SPIOUT PORTA -# define SPIDIR DDRA -# define SPIIN PINA -//# define SPIREN P5REN +# define SPIOUT PORTE +# define SPIDIR DDRE +# define SPIIN PINE +# define SPIPIN PINE0 # endif #endif @@ -97,14 +95,13 @@ // network byte order converters #define htons(x) ((((uint16_t)(x) & 0xFF00) >> 8) | \ - (((uint16_t)(x) & 0x00FF) << 8)) + (((uint16_t)(x) & 0x00FF) << 8)) #define htonl(x) ((((uint32_t)(x) & 0xFF000000) >> 24) | \ - (((uint32_t)(x) & 0x00FF0000) >> 8) | \ - (((uint32_t)(x) & 0x0000FF00) << 8) | \ - (((uint32_t)(x) & 0x000000FF) << 24)) + (((uint32_t)(x) & 0x00FF0000) >> 8) | \ + (((uint32_t)(x) & 0x0000FF00) << 8) | \ + (((uint32_t)(x) & 0x000000FF) << 24)) #define ntohs htons #define ntohl htonl - +#define INITCHIP zigduino_init(); extern uint8_t zigduino_get_byte(uint16_t); -