当前位置:网站首页>7、实时数据备份和实时时钟相关定义
7、实时数据备份和实时时钟相关定义
2022-07-28 14:26:00 【Turing_321】
\qquad 下面是HD-GR GNSS导航软件的实时数据备份和实时时钟相关定义:
// rtc.h -- Header file for the rtc.c file
/* * Copyright (C) 2005 Andrew Greenberg * Distributed under the GNU GENERAL PUBLIC LICENSE (GPL) Version 2 (June 1991). * See the "COPYING" file distributed with this software for more information. */
/* * HD-GR GNSS receiver project * Modes : None * version : V1.0 * date : xx/xx/2015 */
#ifndef RTC_H_
#define RTC_H_
#include "gnsstime.h"
#include "main_position.h"
#include "gps_almanac.h"
#include "b1i_almanac.h"
/******************************************************************************* * Definitions ******************************************************************************/
#define BACKUP_HEADER_SIGNATURE 0xABABABAB
/******************************************************************************* * Declarations ******************************************************************************/
// flash数据备份头结构
typedef struct {
unsigned long signature;
unsigned long data_size;
stdtime_t data_time;
} backup_header_t;
// flash数据备份体结构
typedef struct {
pvt_t rec_pvt;
neu_t rec_neu;
almanac_t gps_alm[32];
} backup_body_t;
// flash数据备份结构:
// (1) 备份数据在程序启动时调用cycgps_init_backup读取;
// (2) 每30分钟调用一次cycgps_save_backup进行保存。
typedef struct {
backup_header_t header;
backup_body_t body;
} flash_backup_t;
// 返回0表示成功,否则表示失败
int flash_read_backup(int offset,void* dest_addr,int length);
// 返回0表示成功,否则表示失败
int flash_write_backup(int offset,void* dest_addr,int length);
// 返回0表示成功,否则表示失败
int cycgps_init_backup(void);
// 返回0表示成功,否则表示失败
int cycgps_save_backup(void);
/* * Name: iic_start * Description: IIC启动 */
void iic_start(void);
/* * Name: iic_stop * Description: IIC停止 */
void iic_stop(void);
/* * Name: iic_write * Description: IIC写一个字节 */
void iic_write(alt_u8 dat);
/* * Name: iic_read * Description: IIC读一个字节 */
alt_u8 iic_read(void);
/* * Name: iic_ack * Description: 发出IIC应答或非应答信号 */
void iic_ack(int a);
/* * Name: rtc_write_byte * Description: 向RTC写一个字节 * Return: 1表示成功 */
int rtc_write_byte(alt_u8 addr, alt_u8 dat);
/* * Name: rtc_write_multibytes * Description: 向RTC写多个字节 * Return: 1表示成功 */
int rtc_write_multibytes(alt_u8 addr, alt_u8 suba, alt_u8 *dat, int no);
/* * Name: rtc_read_byte * Description: 从RTC读一个字节 * Return: 1表示成功 */
int rtc_read_byte(alt_u8 addr, alt_u8 *c);
/* * Name: rtc_read_multibytes * Description: 从RTC读多个字节 * Return: 1表示成功 */
int rtc_read_multibytes(alt_u8 addr, alt_u8 suba, alt_u8 *dat, int no);
/* * Description: 设置时间信息 * Return: 1表示成功 */
int ds32x35_set_time(stdtime_t st, double gsts);
/* * Description: 获取时间信息 * Return: 1表示成功 */
int ds32x35_get_time(stdtime_t *pst);
/* * Description: 检查时间设置情况,如果未设置,需要时进行设置 * Return: 1表示进行了设置, 0表示保持现有设置,-1表示错误 */
int ds32x35_check_set_time(void);
/******************************************************************************* * Externs ******************************************************************************/
extern int m_rtc_inited;
#endif // RTC_H_
边栏推荐
猜你喜欢

About the reptile thing

No files or folders found to process

DAY:7/11

crmeb v4.3部署流程

一文看懂CRMEB开源在线教育知知识付费系统

电压继电器DY-28C

代码比较干净的多商户商城系统

sql语句的执行流程

Crmeb Standard Edition window+phpstudy8 installation tutorial (II)
![PMP [agile textbook + full truth simulation question]. After the exam on June 25, agile has become the top priority](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
PMP [agile textbook + full truth simulation question]. After the exam on June 25, agile has become the top priority
随机推荐
3438. Number system conversion
No files or folders found to process
Template injection summary
4518. Minimum ticket price
模板注入总结
Heuristic merging simple problem on tree
Deepfacelab model parameters collection
Opencv - closely combine multiple irregular small graphs into large graphs
What functions will be added to crmeb Standard Version 4.4
Problems encountered by pyppeter
Crmeb Standard Edition window+phpstudy8 installation tutorial (III)
Understanding of entropy and cross entropy loss function
2022年全球程序员平均薪资发布,中国排名很意外
sql语句的执行流程
.net core 3.1版本配置跨域问题
svg 验证码识别体验
一文看懂CRMEB开源在线教育知知识付费系统
3477. 简单排序
.net core version 2.2 cross domain configuration
Establish binary tree + C language code from preorder and middle order