code:i2c_ubx
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
code:i2c_ubx [2009/05/14 23:46] – created laurenceb | code:i2c_ubx [2009/05/27 21:30] (current) – keeping it clean :P laurenceb | ||
---|---|---|---|
Line 54: | Line 54: | ||
u08 a; | u08 a; | ||
TOGGLE_PIN; | TOGGLE_PIN; | ||
- | printf(" | + | printf(" |
wdt_enable(WDTO_500MS); | wdt_enable(WDTO_500MS); | ||
for(;;) | for(;;) | ||
Line 189: | Line 189: | ||
} | } | ||
</ | </ | ||
+ | ===== header ===== | ||
+ | <code c> | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | typedef unsigned char u08; | ||
+ | typedef unsigned int u16; | ||
+ | typedef unsigned long u32; | ||
+ | typedef signed long s32; | ||
+ | typedef struct | ||
+ | { | ||
+ | u32 time; | ||
+ | s32 vnorth; | ||
+ | s32 veast; | ||
+ | s32 vdown; | ||
+ | s32 longitude; | ||
+ | s32 latitude; | ||
+ | s32 altitude; | ||
+ | u08 packetflag; | ||
+ | u08 status; | ||
+ | u08 nosats; | ||
+ | } ubx_gps_type; | ||
+ | #define UBLOX 0x90 | ||
+ | #define UBLOX_WRITE UBLOX | ||
+ | #define UBLOX_READ UBLOX|0x01 | ||
+ | #define REQUIRED_DATA 0x07 | ||
+ | #define DATA_LENGHT 130 | ||
+ | #define LLH_DATA 0x02 | ||
+ | #define VELNED_DATA 0x12 | ||
+ | #define SOL_DATA 0x06 | ||
+ | #define NAV_CLASS 0x01 | ||
+ | #define SATS_POS 5 | ||
+ | #define SOL_POS 42 | ||
+ | #define POS_OFFSET 40 | ||
+ | #define POS_START 12 | ||
+ | #define POS_END 25 | ||
+ | #define VEL_OFFSET 36 | ||
+ | #define VEL_START 20 | ||
+ | #define VEL_END 37 | ||
+ | #define SYNC_1 0xB5 | ||
+ | #define SYNC_2 0x62 | ||
+ | |||
+ | #define BAUDRATE 19200UL | ||
+ | //#define BAUDDIV 32 | ||
+ | #define BAUDDIV | ||
+ | #define TOGGLE_PIN PIND=0x20 // | ||
+ | |||
+ | </ | ||
+ |
code/i2c_ubx.1242344760.txt.gz · Last modified: 2009/05/14 23:46 by laurenceb