当前位置:网站首页>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_
边栏推荐
- sql 开发篇一 之 表锁查询及解锁
- shellcode编写学习-环境
- 模板注入总结
- 2022年全球程序员平均薪资发布,中国排名很意外
- Table lock query and unlocking in SQL development part 1
- [touch] count the number of engineering documents, code lines, and line comment coverage
- How to set some app application icons on the iPhone Apple phone that you don't want others to see? How to hide the app application settings on the mobile desktop so that they can be used normally afte
- 3511. Water pouring problem
- Template injection summary
- .net core 3.1版本配置跨域问题
猜你喜欢

Classic Dijkstra and the longest way

Apple iPhone app icon hidden how to retrieve and restore the hidden app icon displayed on the iPhone iPhone desktop to the iPhone iPhone iPhone desktop?

Hjs-de1/2 time relay

Grpc protocol buffer

Template injection summary

celery 相关

In 2022, the average salary of global programmers was released, and China ranked unexpectedly

滑块还原和验证(法律数据库)

DAY:7/11

RY-D1/1电压继电器
随机推荐
php parse_ URL bypass whitelist
Establish binary tree + C language code from preorder and middle order
Configure CX Oracle solution (cx_oracle.databaseerror) dpi-1047: cannot locate a 64 bit Oracle client library: "th
Summary of common redis commands (self provided)
crmeb 标准版window+phpstudy8安装教程(三)
2022-07-28日报:Science:AI设计蛋白质再获突破,可设计特定功能性蛋白质
Here comes the full open source free customer service system
SRTT-110VDC-4H-C时间继电器
[leetcode] binary search given an N-element ordered (ascending) integer array num and a target value target, write a function to search the target in num. if the target value exists, return the subscr
Daily question (retrospective)
[MP error] MP: 'getbasemappe serviceimpl' claims
2021-06-29
树上启发式合并简单题
Hjs-de1/2 time relay
sql语句的执行流程
JWY-32B电压继电器
R introduction example details
crmeb知识付费手动安装教程
Crmeb Standard Version window+phpstudy8 installation tutorial (I)
Grpc frequently asked questions