初始化毕业设计项目

This commit is contained in:
2026-05-01 20:29:02 +08:00
commit df5b05e936
158 changed files with 67957 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
#ifndef __DS1302_H
#define __DS1302_H
#include "stm32f10x.h"
// DS1302时间结构体
typedef struct {
uint16_t year; // 年份 (2000-2099)
uint8_t month; // 月份 (1-12)
uint8_t day; // 日期 (1-31)
uint8_t hour; // 小时 (0-23)
uint8_t minute; // 分钟 (0-59)
uint8_t second; // 秒钟 (0-59)
uint8_t week; // 星期 (1-7, 1=周一)
} DS1302_Time;
// 函数声明
void DS1302_Init(void);
void DS1302_SetTime(DS1302_Time* time);
void DS1302_GetTime(DS1302_Time* time);
uint8_t DS1302_ReadByte(uint8_t addr);
void DS1302_WriteByte(uint8_t addr, uint8_t dat);
#endif