te_structs.h
164 lines
| 4.4 KiB
| text/x-c
|
CLexer
|
r132 | /* | ||
* te_defs.h | ||||
* | ||||
* Created on: Nov 4, 2014 | ||||
* Author: Alan Aguilar Sologuren | ||||
*/ | ||||
#ifndef UTILS_TE_STRUCTS_H_ | ||||
#define UTILS_TE_STRUCTS_H_ | ||||
|
r176 | #include <stdint.h> | ||
|
r197 | #include "fixpoint.h" | ||
|
r203 | #include "Arduino.h" | ||
|
r132 | |||
|
r176 | /*mascaras disponibles para GPS 15xL*/ | ||
#define GPNON 0x0000 /**< Unknown packet type. */ | ||||
#define GPGGA 0x0001 /**< GGA - Essential fix data which provide 3D location and accuracy data. */ | ||||
#define GPGSA 0x0002 /**< GSA - GPS receiver operating mode, SVs used for navigation, and DOP values. */ | ||||
#define GPGSV 0x0004 /**< GSV - Number of SVs in view, PRN numbers, elevation, azimuth & SNR values. */ | ||||
#define GPRMC 0x0008 /**< RMC - Recommended Minimum Specific GPS/TRANSIT Data. */ | ||||
#define GPVTG 0x0010 /**< VTG - Actual track made good and speed over ground. */ | ||||
#define GPALM 0x0020 | ||||
#define GPGLL 0x0040 | ||||
#define PGRMI 0x0080 | ||||
#define PGRMC 0x0100 | ||||
#define PGRMC1 0x0200 | ||||
#define PGRMO 0x0400 | ||||
|
r132 | /////////////////////////////////////////////////////////////////////////////// | ||
// ESTRUCTURAS PARA MODULO DE CONTROL DE RECEPTOR GNSS (GPS-15xL) | ||||
/////////////////////////////////////////////////////////////////////////////// | ||||
/*! | ||||
* | ||||
*/ | ||||
|
r203 | typedef struct gnss_config_struct_ { | ||
uint8_t baudrate; /*!< baudrate of uart port of gnss receptor */ | ||||
uint16_t nmea_mask; /*!< mask to indicate witch nmea frame will be actived */ | ||||
fix32 lat; | ||||
fix32 lon; | ||||
gnss_config_struct_() : | ||||
baudrate(9600), nmea_mask(GPNON) { | ||||
} | ||||
} gnss_config_struct; | ||||
|
r132 | |||
/*! | ||||
* \struct gnss_precise_time | ||||
* \brief Estructura de tiempo de GNSS para almacenar tiempo preciso. | ||||
* Almacena tiempo con resolucion de microsegundos. | ||||
*/ | ||||
|
r203 | typedef struct gnss_precise_time_ { | ||
int year; /*!< year of gnss data */ | ||||
int day; /*!< day of month */ | ||||
|
r197 | int month; /*!< month */ | ||
|
r203 | int doy; /*!< day of year of gnss data */ | ||
int hour; /*!< hour of gnss data */ | ||||
int minu; /*!< minute of gnss data */ | ||||
int sec; /*!< seconds of gnss data */ | ||||
int usec; /*!< microseconds of gnss data */ | ||||
gnss_precise_time_() : | ||||
year(0), day(0), month(0), doy(0), hour(0), minu(0), sec(0), usec(0) { | ||||
} | ||||
} gnss_precise_time; | ||||
|
r132 | |||
/////////////////////////////////////////////////////////////////////////////// | ||||
// ESTRUCTURAS PARA EL MODULO DE CONTROL DEL GENERADOR DE CLOCK | ||||
/////////////////////////////////////////////////////////////////////////////// | ||||
/*! | ||||
* | ||||
*/ | ||||
|
r203 | typedef struct clock_config_struct_ { | ||
|
r132 | |||
|
r203 | } clock_config_struct; | ||
|
r132 | |||
/*! | ||||
* | ||||
*/ | ||||
|
r203 | typedef struct clock_state_struct_ { | ||
|
r132 | |||
|
r203 | } clock_state_struct; | ||
|
r132 | |||
/////////////////////////////////////////////////////////////////////////////// | ||||
// ESTRUCTURAS PARA MODULO DE CONTROL DE RTC | ||||
/////////////////////////////////////////////////////////////////////////////// | ||||
/*! | ||||
* \struct ds1308_ctl_byte | ||||
* \brief Estructura para almacenar informacion de configuracion para | ||||
* el registro con direccion DS1308_CTL_ADD (0x07) del DS1308. | ||||
*/ | ||||
typedef struct ds1308_ctl_byte_ { | ||||
|
r203 | uint8_t rs0 :1; | ||
uint8_t rs1 :1; | ||||
uint8_t bbclk :1; | ||||
uint8_t los :1; | ||||
uint8_t sqwe :1; | ||||
uint8_t osf :1; | ||||
uint8_t eclk :1; | ||||
uint8_t out :1; | ||||
ds1308_ctl_byte_() : | ||||
rs0(0), rs1(0), bbclk(0), los(0), sqwe(0), osf(0), eclk(1), out(0) { | ||||
} | ||||
} ds1308_ctl_byte; | ||||
|
r132 | |||
/*! | ||||
* \struct ds1308_clock_halt | ||||
* \brief Estructura para configurar el arranque o parada de funciones | ||||
* timekeeping del DS1308 | ||||
*/ | ||||
typedef struct ds1308_clock_halt_ { | ||||
|
r203 | uint8_t dummy_dont_use :7; | ||
uint8_t ch :1; | ||||
ds1308_clock_halt_() : | ||||
dummy_dont_use(0), ch(0) { | ||||
} | ||||
} ds1308_clock_halt; | ||||
|
r132 | |||
/*! | ||||
* \struct rtc_config_struct | ||||
* \brief Almacena toda la informmacion necesaria para configurar el IC | ||||
* DS1308. | ||||
*/ | ||||
|
r203 | typedef struct rtc_config_struct_ { | ||
ds1308_clock_halt clk_halt; | ||||
ds1308_ctl_byte ctl_byte; | ||||
} rtc_config_struct; | ||||
|
r132 | |||
/////////////////////////////////////////////////////////////////////////////// | ||||
// | ||||
/////////////////////////////////////////////////////////////////////////////// | ||||
/*! | ||||
* | ||||
*/ | ||||
|
r203 | typedef struct te_status_struct_ { | ||
|
r132 | |||
|
r203 | } te_status_struct; | ||
|
r132 | |||
/*! | ||||
* | ||||
*/ | ||||
|
r203 | typedef struct te_time_pkg_ { | ||
|
r132 | gnss_precise_time time; /*!< Tiempo de adquisicion de un PPS de GNSS | ||
|
r203 | especifico */ | ||
uint16_t pps_serial; /*!< Numero serial de un PPS desde que la linea de | ||||
enganche GNSS (LOCK) fue activada (max 1800) */ | ||||
bool is_gnss_time; /*!< true si el tiempo dado proviene del un | ||||
receptor GNSS */ | ||||
gnss_precise_time * pnext; /*!< Apunta al siguiente paquete de tiempo */ | ||||
|
r132 | gnss_precise_time * previous; /*!< Apunta al paquete de tempo anterior. */ | ||
|
r203 | te_time_pkg_() : | ||
pps_serial(0), is_gnss_time(false), pnext(0), previous(0) { | ||||
} | ||||
} te_time_pkg; | ||||
|
r132 | |||
/*! | ||||
* | ||||
*/ | ||||
|
r203 | typedef struct te_command_struct_ { | ||
|
r132 | |||
|
r203 | } te_command_struct; | ||
|
r132 | |||
#endif /* UTILS_TE_STRUCTS_H_ */ | ||||