This program is for mbed-Geiger counter system. It use OLED module, GPS module (with RTC), TextLCD, SD FileSystem and some Interrupt pin.

Dependencies:   TextLCD mbed

Committer:
y_notsu
Date:
Sat Jul 02 22:05:27 2011 +0000
Revision:
0:97f8ed953c0d
rev.0.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
y_notsu 0:97f8ed953c0d 1 //=========================================================
y_notsu 0:97f8ed953c0d 2 // LPC1114 Project
y_notsu 0:97f8ed953c0d 3 //=========================================================
y_notsu 0:97f8ed953c0d 4 // File Name : gpsrtc.h
y_notsu 0:97f8ed953c0d 5 // Function : GPS&RTC Control Header
y_notsu 0:97f8ed953c0d 6 //---------------------------------------------------------
y_notsu 0:97f8ed953c0d 7 // Rev.01 2010.08.29 Munetomo Maruyama
y_notsu 0:97f8ed953c0d 8 //---------------------------------------------------------
y_notsu 0:97f8ed953c0d 9 // Copyright (C) 2010-2011 Munetomo Maruyama
y_notsu 0:97f8ed953c0d 10 //=========================================================
y_notsu 0:97f8ed953c0d 11 // ---- License Information -------------------------------
y_notsu 0:97f8ed953c0d 12 // Anyone can FREELY use this code fully or partially
y_notsu 0:97f8ed953c0d 13 // under conditions shown below.
y_notsu 0:97f8ed953c0d 14 // 1. You may use this code only for individual purpose,
y_notsu 0:97f8ed953c0d 15 // and educational purpose.
y_notsu 0:97f8ed953c0d 16 // Do not use this code for business even if partially.
y_notsu 0:97f8ed953c0d 17 // 2. You should use this code under the GNU GPL.
y_notsu 0:97f8ed953c0d 18 // 3. You should remain this header text in your codes
y_notsu 0:97f8ed953c0d 19 // including Copyright credit and License Information.
y_notsu 0:97f8ed953c0d 20 // 4. Your codes should inherit this license information.
y_notsu 0:97f8ed953c0d 21 //=========================================================
y_notsu 0:97f8ed953c0d 22 // ---- Patent Notice -------------------------------------
y_notsu 0:97f8ed953c0d 23 // I have not cared whether this system (hw + sw) causes
y_notsu 0:97f8ed953c0d 24 // infringement on the patent, copyright, trademark,
y_notsu 0:97f8ed953c0d 25 // or trade secret rights of others. You have all
y_notsu 0:97f8ed953c0d 26 // responsibilities for determining if your designs
y_notsu 0:97f8ed953c0d 27 // and products infringe on the intellectual property
y_notsu 0:97f8ed953c0d 28 // rights of others, when you use technical information
y_notsu 0:97f8ed953c0d 29 // included in this system for your business.
y_notsu 0:97f8ed953c0d 30 //=========================================================
y_notsu 0:97f8ed953c0d 31 // ---- Disclaimers ---------------------------------------
y_notsu 0:97f8ed953c0d 32 // The function and reliability of this system are not
y_notsu 0:97f8ed953c0d 33 // guaranteed. They may cause any damages to loss of
y_notsu 0:97f8ed953c0d 34 // properties, data, money, profits, life, or business.
y_notsu 0:97f8ed953c0d 35 // By adopting this system even partially, you assume
y_notsu 0:97f8ed953c0d 36 // all responsibility for its use.
y_notsu 0:97f8ed953c0d 37 //=========================================================
y_notsu 0:97f8ed953c0d 38
y_notsu 0:97f8ed953c0d 39 #ifndef __GPSRTC_H__
y_notsu 0:97f8ed953c0d 40 #define __GPSRTC_H__
y_notsu 0:97f8ed953c0d 41
y_notsu 0:97f8ed953c0d 42 //#include <type.h>
y_notsu 0:97f8ed953c0d 43
y_notsu 0:97f8ed953c0d 44 //=============
y_notsu 0:97f8ed953c0d 45 // GPSRTC Data
y_notsu 0:97f8ed953c0d 46 //=============
y_notsu 0:97f8ed953c0d 47 typedef struct
y_notsu 0:97f8ed953c0d 48 {
y_notsu 0:97f8ed953c0d 49 unsigned char bGPS_UTC_hour; // UTC hour
y_notsu 0:97f8ed953c0d 50 unsigned char bGPS_UTC_min; // UTC minute
y_notsu 0:97f8ed953c0d 51 unsigned char bGPS_UTC_sec; // UTC second
y_notsu 0:97f8ed953c0d 52 unsigned char cGPS_LAT; // Latitude N or S
y_notsu 0:97f8ed953c0d 53 unsigned char bGPS_LAT_deg; // Latitude degree
y_notsu 0:97f8ed953c0d 54 unsigned char bGPS_LAT_min; // Latitude minute
y_notsu 0:97f8ed953c0d 55 unsigned char bGPS_LAT_sec; // Latitude second
y_notsu 0:97f8ed953c0d 56 unsigned char cGPS_LNG; // Longitude E or W
y_notsu 0:97f8ed953c0d 57 unsigned char bGPS_LNG_deg; // Longitude degree
y_notsu 0:97f8ed953c0d 58 unsigned char bGPS_LNG_min; // Longitude minute
y_notsu 0:97f8ed953c0d 59 unsigned char bGPS_LNG_sec; // Longitude second
y_notsu 0:97f8ed953c0d 60 unsigned char cGPS_Quality; // GPS Quality (0:Invalid, 1: SPS, 2:D-GPS)
y_notsu 0:97f8ed953c0d 61 unsigned char bGPS_Sat; // Satellite Count
y_notsu 0:97f8ed953c0d 62 unsigned char bGPS_HDOP_I; // Horizontal Dilution of Precision, Integer
y_notsu 0:97f8ed953c0d 63 unsigned char bGPS_HDOP_D; // Horizontal Dilution of Precision, Decimal
y_notsu 0:97f8ed953c0d 64 signed int wGPS_ASL_m; // Altitude above Sea Level in meter
y_notsu 0:97f8ed953c0d 65 signed int wGPS_GEO_m; // Geoid Separation in meter
y_notsu 0:97f8ed953c0d 66 //
y_notsu 0:97f8ed953c0d 67 unsigned char bRTC_year; // RTC year
y_notsu 0:97f8ed953c0d 68 unsigned char bRTC_mon; // RTC month
y_notsu 0:97f8ed953c0d 69 unsigned char bRTC_day; // RTC day
y_notsu 0:97f8ed953c0d 70 unsigned char bRTC_week; // RTC week
y_notsu 0:97f8ed953c0d 71 unsigned char bRTC_hour; // RTC hour
y_notsu 0:97f8ed953c0d 72 unsigned char bRTC_min; // RTC minute
y_notsu 0:97f8ed953c0d 73 unsigned char bRTC_sec; // RTC second
y_notsu 0:97f8ed953c0d 74 } sGPSRTC;
y_notsu 0:97f8ed953c0d 75
y_notsu 0:97f8ed953c0d 76 //===================
y_notsu 0:97f8ed953c0d 77 // Define Weekdays
y_notsu 0:97f8ed953c0d 78 //===================
y_notsu 0:97f8ed953c0d 79 enum WEEK {SUN = 0, MON, TUE, WED, THU, FRI, SAT};
y_notsu 0:97f8ed953c0d 80
y_notsu 0:97f8ed953c0d 81 //=============
y_notsu 0:97f8ed953c0d 82 // Prototypes
y_notsu 0:97f8ed953c0d 83 //=============
y_notsu 0:97f8ed953c0d 84 unsigned char* Get_Number_from_GPS(unsigned char *pStr,
y_notsu 0:97f8ed953c0d 85 signed int *pInteger, signed int *pIntrnd, signed int *pDecimal, unsigned int *pDeclen);
y_notsu 0:97f8ed953c0d 86 void Get_GPGGA_Data(sGPSRTC *pG);
y_notsu 0:97f8ed953c0d 87 //
y_notsu 0:97f8ed953c0d 88 void Init_RTC(unsigned int do_adj, unsigned char year, unsigned char month, unsigned char day,
y_notsu 0:97f8ed953c0d 89 unsigned char week, unsigned char hour, unsigned char minute, unsigned char second);
y_notsu 0:97f8ed953c0d 90 void Get_RTC_Data(sGPSRTC *psGPSRTC);
y_notsu 0:97f8ed953c0d 91 unsigned char *Get_Week_String(unsigned int week);
y_notsu 0:97f8ed953c0d 92 //
y_notsu 0:97f8ed953c0d 93 void RTC_Write_Reg(unsigned int addr, unsigned int data);
y_notsu 0:97f8ed953c0d 94 unsigned int RTC_Read_Reg(unsigned int addr);
y_notsu 0:97f8ed953c0d 95 unsigned char BCD_INT(unsigned char num);
y_notsu 0:97f8ed953c0d 96 signed int power(signed int x, signed int n);
y_notsu 0:97f8ed953c0d 97 unsigned char INT_BCD(unsigned char bcd);
y_notsu 0:97f8ed953c0d 98
y_notsu 0:97f8ed953c0d 99 #endif // __GPSRTC_H__
y_notsu 0:97f8ed953c0d 100
y_notsu 0:97f8ed953c0d 101 //=========================================================
y_notsu 0:97f8ed953c0d 102 // End of Program
y_notsu 0:97f8ed953c0d 103 //=========================================================