⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nx8025.h

📁 最近完成的LINUX下RTC8025的驱动
💻 H
字号:
/* * nx8025.h * * Copyright (C) 2005 Fudan Software Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */#ifndef NX8025_H#define NX8025_H#define NX8025_I2C_SLAVE_ADDR	0x32#define NX8025_REG_ADDR_START	0x00#define NX8025_REG_ADDR_END     0x0F#define NX8025_REG_SIZE 	0x10#define PROC_NX8025_NAME	"driver/rtc8025"struct rtc_mem {	unsigned int	loc;	unsigned int	nr;	unsigned char	*data;};#define NX8025_GETDATETIME	0#define NX8025_SETTIME		1#define NX8025_SETDATETIME	2#define NX8025_GETCTRL		3#define NX8025_SETCTRL		4#define NX8025_MEM_READ		5#define NX8025_MEM_WRITE	6#define BCD_TO_BIN(val) (((val)&15) + ((val)>>4)*10)#define BIN_TO_BCD(val) ((((val)/10)<<4) + (val)%10)#define HOURS_AP(n)		(((n)>>5)&1)#define HOURS_12(n)		BCD_TO_BIN((n)&0x1F)#define HOURS_24(n)		BCD_TO_BIN((n)&0x3F)#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -