Subversion Repositories HomeAutomation

Rev

Rev 1584 | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. #ifndef SNS_NMEA
  2. #define SNS_NMEA
  3.  
  4. /*-----------------------------------------------------------------------------
  5.  * Includes
  6.  *---------------------------------------------------------------------------*/
  7. /* system files */
  8. #include <avr/io.h>
  9. #include <avr/interrupt.h>
  10. #include <stdio.h>
  11. /* lib files */
  12. #include <config.h>
  13. #include <bios.h>
  14. #include <drivers/can/stdcan.h>
  15. #include <drivers/timer/timer.h>
  16.  
  17. #ifndef TRIMBLE_LASSEN_LP
  18. #define TRIMBLE_LASSEN_LP 0
  19. #endif
  20.  
  21. #if TRIMBLE_LASSEN_LP == 1
  22. #define LAT_LENGTH 9
  23. #define LON_LENGTH 10
  24. #define TSIP_AT_STARTUP
  25. #else // Default
  26. #define LAT_LENGTH 10
  27. #define LON_LENGTH 11
  28. #endif
  29.  
  30. void sns_nmea_Init(void);
  31. void sns_nmea_Process(void);
  32. void sns_nmea_HandleMessage(StdCan_Msg_t *rxMsg);
  33. void sns_nmea_List(uint8_t ModuleSequenceNumber);
  34.  
  35. struct {
  36.     uint8_t time_h, time_m, time_s;
  37.     uint8_t lat_deg, lon_deg; //Följer inte auml:s enhetsstandard
  38.     uint8_t lat_min, lon_min;
  39.     uint8_t lat_sec_h, lat_sec_l, lon_sec_h, lon_sec_l; //Last bit contains cardinal direction
  40.    
  41.     uint8_t fixtype; //1=no fix, 2=2D, 3=3D
  42.     uint8_t fixvalid; //From GGA, 0 or 1
  43.     uint8_t usedsat;
  44.  
  45.     uint8_t speed;
  46.     uint8_t cmg_h, cmg_l;
  47.     uint8_t date_y, date_m, date_d;
  48.  
  49.     uint32_t unixtimestamp;
  50. } NMEA_data;
  51.  
  52. #endif // SNS_NMEA
  53.