|
|
/*
|
|
|
* te_defs.h
|
|
|
*
|
|
|
* Created on: Nov 4, 2014
|
|
|
* Author: Alan Aguilar Sologuren
|
|
|
*/
|
|
|
|
|
|
#ifndef UTILS_TE_STRUCTS_H_
|
|
|
#define UTILS_TE_STRUCTS_H_
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
// ESTRUCTURAS PARA MODULO DE CONTROL DE RECEPTOR GNSS (GPS-15xL)
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
/*!
|
|
|
*
|
|
|
*/
|
|
|
typedef struct gnss_config_struct_{
|
|
|
|
|
|
}gnss_config_struct;
|
|
|
|
|
|
/*!
|
|
|
* \struct gnss_precise_time
|
|
|
* \brief Estructura de tiempo de GNSS para almacenar tiempo preciso.
|
|
|
* Almacena tiempo con resolucion de microsegundos.
|
|
|
*/
|
|
|
typedef struct gnss_precise_time_{
|
|
|
int year; /*!< Ahno de la data adquirida */
|
|
|
int doy; /*!< Dia del ahno de la data adqirida */
|
|
|
int hour; /*!< Hora de la data adquirida */
|
|
|
int minu; /*!< Minutos de la data adquirida */
|
|
|
int sec; /*!< Segundos de la data adquirida */
|
|
|
int usec; /*!< Microsegndos de la data adquirida */
|
|
|
gnss_precise_time_(): year(0), doy(0), hour(0), minu(0), sec(0), usec(0){}
|
|
|
}gnss_precise_time;
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
// ESTRUCTURAS PARA EL MODULO DE CONTROL DEL GENERADOR DE CLOCK
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
/*!
|
|
|
*
|
|
|
*/
|
|
|
typedef struct clock_config_struct_{
|
|
|
|
|
|
}clock_config_struct;
|
|
|
|
|
|
/*!
|
|
|
*
|
|
|
*/
|
|
|
typedef struct clock_state_struct_{
|
|
|
|
|
|
}clock_state_struct;
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
// 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_ {
|
|
|
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;
|
|
|
|
|
|
/*!
|
|
|
* \struct ds1308_clock_halt
|
|
|
* \brief Estructura para configurar el arranque o parada de funciones
|
|
|
* timekeeping del DS1308
|
|
|
*/
|
|
|
typedef struct ds1308_clock_halt_ {
|
|
|
uint8_t dummy_dont_use:7;
|
|
|
uint8_t ch:1;
|
|
|
ds1308_clock_halt_(): dummy_dont_use(0), ch(0){}
|
|
|
}ds1308_clock_halt;
|
|
|
|
|
|
/*!
|
|
|
* \struct rtc_config_struct
|
|
|
* \brief Almacena toda la informmacion necesaria para configurar el IC
|
|
|
* DS1308.
|
|
|
*/
|
|
|
typedef struct rtc_config_struct_{
|
|
|
ds1308_clock_halt clk_halt;
|
|
|
ds1308_ctl_byte ctl_byte;
|
|
|
}rtc_config_struct;
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
//
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
/*!
|
|
|
*
|
|
|
*/
|
|
|
typedef struct te_status_struct_{
|
|
|
|
|
|
}te_status_struct;
|
|
|
|
|
|
/*!
|
|
|
*
|
|
|
*/
|
|
|
typedef struct te_time_pkg_{
|
|
|
gnss_precise_time time; /*!< Tiempo de adquisicion de un PPS de GNSS
|
|
|
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 */
|
|
|
gnss_precise_time * previous; /*!< Apunta al paquete de tempo anterior. */
|
|
|
te_time_pkg_(): pps_serial(0), is_gnss_time(false), pnext(0), previous(0){}
|
|
|
}te_time_pkg;
|
|
|
|
|
|
/*!
|
|
|
*
|
|
|
*/
|
|
|
typedef struct te_command_struct_{
|
|
|
|
|
|
}te_command_struct;
|
|
|
|
|
|
|
|
|
#endif /* UTILS_TE_STRUCTS_H_ */
|
|
|
|