davincihd_i2c_gpio.h
来自「用于dm6467 开发平台的uboot源码」· C头文件 代码 · 共 66 行
H
66 行
/*
* Copyright 2007 by Spectrum Digital Incorporated.
* All rights reserved. Property of Spectrum Digital Incorporated.
*/
/*
* I2C GPIO I/O expander header file
*
*/
#ifndef I2C_GPIO_
#define I2C_GPIO_
#ifdef __cplusplus
extern "C" {
#endif
#include "davincihd.h"
#include "davincihd_i2c.h"
/* ------------------------------------------------------------------------ *
* I2C Addresses *
* ------------------------------------------------------------------------ */
#define I2C_GPIO_GROUP_0 ( 0x38 | 0 )
#define I2C_GPIO_GROUP_1 ( 0x38 | 1 )
#define I2C_GPIO_GROUP_2 ( 0x38 | 2 )
#define I2C_GPIO_GROUP_3 ( 0x38 | 3 )
#define I2C_GPIO_GROUP_4 ( 0x38 | 4 )
#define I2C_GPIO_GROUP_5 ( 0x38 | 5 )
#define I2C_GPIO_GROUP_6 ( 0x38 | 6 )
#define I2C_GPIO_GROUP_7 ( 0x38 | 7 )
/* ------------------------------------------------------------------------ *
* Short Hand *
* ------------------------------------------------------------------------ */
#define CPLD_I2C_ADDR_0 I2C_GPIO_GROUP_2
#define CPLD_I2C_ADDR_1 I2C_GPIO_GROUP_3
#define CPLD_I2C_ADDR_2 I2C_GPIO_GROUP_4
/* ------------------------------------------------------------------------ *
* CPLD Regs *
* ------------------------------------------------------------------------ */
#define CPLD_REG0_SET( reg ) DAVINCIHD_I2C_GPIO_setall( CPLD_I2C_ADDR_0, reg )
#define CPLD_REG1_SET( reg ) DAVINCIHD_I2C_GPIO_setall( CPLD_I2C_ADDR_1, reg )
#define CPLD_REG2_SET( reg ) DAVINCIHD_I2C_GPIO_setall( CPLD_I2C_ADDR_2, reg )
#define CPLD_REG0_GET( reg ) DAVINCIHD_I2C_GPIO_getall( CPLD_I2C_ADDR_0, reg )
#define CPLD_REG1_GET( reg ) DAVINCIHD_I2C_GPIO_getall( CPLD_I2C_ADDR_1, reg )
#define CPLD_REG2_GET( reg ) DAVINCIHD_I2C_GPIO_getall( CPLD_I2C_ADDR_2, reg )
/* ------------------------------------------------------------------------ *
* Prototypes *
* ------------------------------------------------------------------------ */
Int16 DAVINCIHD_I2C_GPIO_init( );
Int16 DAVINCIHD_I2C_GPIO_getall( Uint16 group_id, Uint16 *pattern );
Int16 DAVINCIHD_I2C_GPIO_setall( Uint16 group_id, Uint16 pattern );
Int16 DAVINCIHD_I2C_GPIO_setOutput( Uint16 group_id, Uint16 number, Uint8 value );
Int16 DAVINCIHD_I2C_GPIO_getInput ( Uint16 group_id, Uint16 number );
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?