📄 i2c_soft.h
字号:
#ifndef _B_I2C_H_
#define _B_I2C_H_
#define SET_SDA setPA5()
#define CLR_SDA clrPA5()
#define SET_SCL setPA4()
#define CLR_SCL clrPA4()
#define SDA_IN setPAC5()
#define SDA_OUT clrPAC5()
#define SCL_OUT clrPAC4()
#define SCL_IN setPAC4()
#define READ_PORT peekPA()
#define SDA 0x20 //PA5
#define DELAY_TIME 5
/// about time control pcf8563
//chip address
#define PCF8563_ADDR 0xa2
// reg add
#define CON_REG0_ADD 0x00
#define CON_REG1_ADD 0x01
#define SEC_REG_ADD 0x02
#define MIN_REG_ADD 0x03
#define HOU_REG_ADD 0x04
#define DAT_REG_ADD 0x05
#define WEEK_REG_ADD 0x06
#define MON_REG_ADD 0x07
#define YEA_REG_ADD 0x08
#define MIN_ANR_REG_ADD 0x09
#define HOU_ANR_REG_ADD 0x0A
#define DAT_ANR_REG_ADD 0x0B
#define WEEK_ANR_REG_ADD 0x0C
#define CLKOUT_REG_ADD 0x0D
#define TIMER1_REG_ADD 0x0E
#define TIMER2_REG_ADD 0x0F
//reg add
//reg
#define CON_REG0 0x00
#define CON_REG1 0x00
#define SEC_REG 0x15 //vl=0, SEC:00
#define MIN_REG 0x53 // MIN:00
#define HOU_REG 0x18 // HOU:00
#define DAT_REG 0x04 // DAT:04
#define WEEK_REG 0x02 // WEEK:00
#define MON_REG 0x06 // MON:08
#define YEA_REG 0x01 // YEA:01
#define MIN_ANR_REG 0x00 //?
#define HOU_ANR_REG 0x00 //?
#define DAT_ANR_REG 0x00 //?
#define WEEK_ANR_REG 0x00 //?
#define CLKOUT_REG 0x00 //?
#define TIMER1_REG 0x00 //?
#define TIMER2_REG 0x00 //?
// eeprom part
#define MTV24C08_ADDR 0xa8
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -