test

Dependencies:   FatFileSystem TextLCD mbed

Committer:
y_notsu
Date:
Tue Sep 18 07:24:22 2012 +0000
Revision:
0:2c37ad282618
test

Who changed what in which revision?

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