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

📄 i2c.h

📁 H9200F(2.6.12)的音频接口驱动。 操作方法: 1、将驱动程序rsound.ko拷贝到系统目录:/lib/modules 2、执行如下命令加载模块: insmod /
💻 H
字号:
/*    i2c Support for Atmel's AT91RM9200 Two-Wire Interface    (c) Rick Bronson    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; if not, write to the Free Software    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#ifndef AT91RM9200_I2C_H#define AT91RM9200_I2C_H#define AT91C_TWI_CLOCK         100000#define AT91C_TWI_SCLOCK        (10 * AT91C_MASTER_CLOCK / AT91C_TWI_CLOCK)//#define AT91C_TWI_CKDIV1        (1 << 16)       /* TWI clock divider */#define AT91C_TWI_CKDIV1        (2 << 16)	/* TWI clock divider */#if (AT91C_TWI_SCLOCK % 10) >= 5#define AT91C_TWI_CLDIV2 ((AT91C_TWI_SCLOCK / 10) - 5)#else#define AT91C_TWI_CLDIV2 ((AT91C_TWI_SCLOCK / 10) - 6)#endif#define AT91C_TWI_CLDIV3 ((AT91C_TWI_CLDIV2 + (4 - AT91C_TWI_CLDIV2 % 4)) >> 2)#define AT91C_EEPROM_I2C_ADDRESS        (0x50 << 16)extern void port_init_I2C(void);extern int I2C_write(char reg_address, unsigned short data_out, int);extern int I2C_read(char reg_address, unsigned short *data_in, int);extern unsigned int I2C_test(void);#endif

⌨️ 快捷键说明

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