htujun
3 years ago
32 changed files with 3034 additions and 2327 deletions
@ -0,0 +1,86 @@ |
|||||||
|
/*
|
||||||
|
* @Author: your name |
||||||
|
* @Date: 2022-04-12 22:48:31 |
||||||
|
* @LastEditTime: 2022-04-13 00:45:47 |
||||||
|
* @LastEditors: your name |
||||||
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
|
* @FilePath: \20220410-IntelligentPiggery\stm32\HARDWARE\DS1302\DS1302.h |
||||||
|
*/ |
||||||
|
#ifndef __DS1302_H__ |
||||||
|
#define __DS1302_H__ |
||||||
|
#include <stm32f10x.h> |
||||||
|
#define uchar unsigned char |
||||||
|
#define uint unsigned int |
||||||
|
/***DS1302时钟芯片****************************/ |
||||||
|
|
||||||
|
//CLK--->PB5
|
||||||
|
//IO---->PB6
|
||||||
|
//RES--->PB7
|
||||||
|
/****************************/ |
||||||
|
|
||||||
|
#define OUT 0x01 |
||||||
|
#define IN 0x00 |
||||||
|
|
||||||
|
typedef int BOOL; |
||||||
|
#define TRUE 1 |
||||||
|
#define FALSE 0 |
||||||
|
|
||||||
|
struct ctime{ |
||||||
|
int day; |
||||||
|
int hour; |
||||||
|
int min; |
||||||
|
int sec; |
||||||
|
}; |
||||||
|
|
||||||
|
struct timing{ |
||||||
|
int year; |
||||||
|
int mon; |
||||||
|
int day; |
||||||
|
int hour; |
||||||
|
int min; |
||||||
|
int sec; |
||||||
|
BOOL run; |
||||||
|
BOOL alive; |
||||||
|
struct ctime time; |
||||||
|
}; |
||||||
|
|
||||||
|
extern struct timing nowTime; |
||||||
|
|
||||||
|
//extern uchar Settime[6]={0x17,0x04,0x18,0x16,0x57,0x30}; //设置时间函数
|
||||||
|
#define DS1302_PORT GPIOB |
||||||
|
|
||||||
|
#define CLK_Reset_0 GPIOB->BRR=GPIO_Pin_5 |
||||||
|
#define CLK_Set_1 GPIOB->BSRR=GPIO_Pin_5 |
||||||
|
|
||||||
|
#define IO_Reset_0 GPIOB->BRR=GPIO_Pin_6 |
||||||
|
#define IO_Set_1 GPIOB->BSRR=GPIO_Pin_6 |
||||||
|
|
||||||
|
#define RES_Reset_0 GPIOB->BRR=GPIO_Pin_7 |
||||||
|
#define RES_Set_1 GPIOB->BSRR=GPIO_Pin_7 |
||||||
|
|
||||||
|
#define IO_Read GPIO_ReadInputDataBit(GPIOB,GPIO_Pin_6) |
||||||
|
/*************************/ |
||||||
|
#define Time_24_Hour 0x00 //24小时制
|
||||||
|
#define Time_Start 0x00 //开始走时
|
||||||
|
//DS1302寄存器操作指令定义时间地址
|
||||||
|
#define ds1302_sec_addr 0x80 //秒
|
||||||
|
#define ds1302_min_addr 0x82 //分
|
||||||
|
#define ds1302_hour_addr 0x84 //时
|
||||||
|
#define ds1302_day_addr 0x86 //日
|
||||||
|
#define ds1302_month_addr 0x88 //月
|
||||||
|
#define ds1302_year_addr 0x8c //年
|
||||||
|
/********************/ |
||||||
|
void DS1302_GPIOInit(void); |
||||||
|
void DS1302_IO_GPIO(uchar FLAG);//配置IO的方向
|
||||||
|
void DS1302_delay(u8 dd); |
||||||
|
void DS1302_Write(uchar add,uchar dat); |
||||||
|
uchar DS1302_Read(uchar add); |
||||||
|
void DS1302_SetTime(uchar *ad); |
||||||
|
void DS1302_OFF(void); |
||||||
|
void DS1302_ON(void); |
||||||
|
void DS1302_init(uchar *time); |
||||||
|
void DS1302_Readtime(void); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,31 @@ |
|||||||
|
..\obj\ds1302.o: ..\HARDWARE\DS1302\DS1302.c |
||||||
|
..\obj\ds1302.o: ..\HARDWARE\DS1302\DS1302.h |
||||||
|
..\obj\ds1302.o: ..\USER\stm32f10x.h |
||||||
|
..\obj\ds1302.o: ..\CORE\core_cm3.h |
||||||
|
..\obj\ds1302.o: D:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h |
||||||
|
..\obj\ds1302.o: ..\USER\system_stm32f10x.h |
||||||
|
..\obj\ds1302.o: ..\USER\stm32f10x_conf.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_adc.h |
||||||
|
..\obj\ds1302.o: ..\USER\stm32f10x.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_bkp.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_can.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_cec.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_crc.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_dac.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_dbgmcu.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_dma.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_exti.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_flash.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_fsmc.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_gpio.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_i2c.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_iwdg.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_pwr.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_rcc.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_rtc.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_sdio.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_spi.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_tim.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_usart.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\stm32f10x_wwdg.h |
||||||
|
..\obj\ds1302.o: ..\STM32F10x_FWLib\inc\misc.h |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,107 @@ |
|||||||
|
{ |
||||||
|
"configurations": [ |
||||||
|
{ |
||||||
|
"name": "Target 1", |
||||||
|
"includePath": [ |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\HARDWARE\\LED", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\SYSTEM\\delay", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\SYSTEM\\sys", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\SYSTEM\\usart", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\USER", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\STM32F10x_FWLib\\inc", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\CORE", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\HARDWARE\\ESP8266", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\HARDWARE\\DHT11", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\HARDWARE\\LCD1602", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\HARDWARE\\ADC", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\HARDWARE\\TIMER", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\HARDWARE\\DS18B20", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\HARDWARE\\cJSON", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\HARDWARE\\DCmotor", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\HARDWARE\\DS1302", |
||||||
|
"D:\\Keil_v5\\ARM\\ARMCC\\include", |
||||||
|
"D:\\Keil_v5\\ARM\\ARMCC\\include\\rw", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32\\STM32F10x_FWLib\\src", |
||||||
|
"e:\\项目\\兼职项目\\20220410-IntelligentPiggery\\stm32" |
||||||
|
], |
||||||
|
"defines": [ |
||||||
|
"STM32F10X_MD", |
||||||
|
"USE_STDPERIPH_DRIVER", |
||||||
|
"__CC_ARM", |
||||||
|
"__arm__", |
||||||
|
"__align(x)=", |
||||||
|
"__ALIGNOF__(x)=", |
||||||
|
"__alignof__(x)=", |
||||||
|
"__asm(x)=", |
||||||
|
"__forceinline=", |
||||||
|
"__restrict=", |
||||||
|
"__global_reg(n)=", |
||||||
|
"__inline=", |
||||||
|
"__int64=long long", |
||||||
|
"__INTADDR__(expr)=0", |
||||||
|
"__irq=", |
||||||
|
"__packed=", |
||||||
|
"__pure=", |
||||||
|
"__smc(n)=", |
||||||
|
"__svc(n)=", |
||||||
|
"__svc_indirect(n)=", |
||||||
|
"__svc_indirect_r7(n)=", |
||||||
|
"__value_in_regs=", |
||||||
|
"__weak=", |
||||||
|
"__writeonly=", |
||||||
|
"__declspec(x)=", |
||||||
|
"__attribute__(x)=", |
||||||
|
"__nonnull__(x)=", |
||||||
|
"__register=", |
||||||
|
"__breakpoint(x)=", |
||||||
|
"__cdp(x,y,z)=", |
||||||
|
"__clrex()=", |
||||||
|
"__clz(x)=0U", |
||||||
|
"__current_pc()=0U", |
||||||
|
"__current_sp()=0U", |
||||||
|
"__disable_fiq()=", |
||||||
|
"__disable_irq()=", |
||||||
|
"__dmb(x)=", |
||||||
|
"__dsb(x)=", |
||||||
|
"__enable_fiq()=", |
||||||
|
"__enable_irq()=", |
||||||
|
"__fabs(x)=0.0", |
||||||
|
"__fabsf(x)=0.0f", |
||||||
|
"__force_loads()=", |
||||||
|
"__force_stores()=", |
||||||
|
"__isb(x)=", |
||||||
|
"__ldrex(x)=0U", |
||||||
|
"__ldrexd(x)=0U", |
||||||
|
"__ldrt(x)=0U", |
||||||
|
"__memory_changed()=", |
||||||
|
"__nop()=", |
||||||
|
"__pld(...)=", |
||||||
|
"__pli(...)=", |
||||||
|
"__qadd(x,y)=0", |
||||||
|
"__qdbl(x)=0", |
||||||
|
"__qsub(x,y)=0", |
||||||
|
"__rbit(x)=0U", |
||||||
|
"__rev(x)=0U", |
||||||
|
"__return_address()=0U", |
||||||
|
"__ror(x,y)=0U", |
||||||
|
"__schedule_barrier()=", |
||||||
|
"__semihost(x,y)=0", |
||||||
|
"__sev()=", |
||||||
|
"__sqrt(x)=0.0", |
||||||
|
"__sqrtf(x)=0.0f", |
||||||
|
"__ssat(x,y)=0", |
||||||
|
"__strex(x,y)=0U", |
||||||
|
"__strexd(x,y)=0", |
||||||
|
"__strt(x,y)=", |
||||||
|
"__swp(x,y)=0U", |
||||||
|
"__usat(x,y)=0U", |
||||||
|
"__wfe()=", |
||||||
|
"__wfi()=", |
||||||
|
"__yield()=", |
||||||
|
"__vfp_status(x,y)=0" |
||||||
|
], |
||||||
|
"intelliSenseMode": "${default}" |
||||||
|
} |
||||||
|
], |
||||||
|
"version": 4 |
||||||
|
} |
@ -0,0 +1,4 @@ |
|||||||
|
[info] Log at : 2022/4/16|13:16:04|GMT+0800 |
||||||
|
|
||||||
|
[info] Log at : 2022/4/17|11:44:45|GMT+0800 |
||||||
|
|
@ -0,0 +1,2 @@ |
|||||||
|
Load "..\\OBJ\\Template.axf" |
||||||
|
Erase Done.Programming Done.Verify OK.Flash Load finished at 12:29:02 |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue