37 lines
801 B
C
37 lines
801 B
C
#ifndef _SF_I2C_DRIVER_H
|
|
#define _SF_I2C_DRIVER_H
|
|
|
|
#ifdef __KERNEL__
|
|
#include <linux/delay.h>
|
|
#include "kwrap/type.h"
|
|
#include "kwrap/flag.h"
|
|
#include <linux/i2c.h>
|
|
#include <linux/slab.h>
|
|
#else
|
|
#include "kwrap/type.h"
|
|
#include "kwrap/flag.h"
|
|
#include "rtos_na51089/kdrv_i2c.h"
|
|
#endif
|
|
|
|
//#ifndef SF_I2C_NAME
|
|
#define SF_I2C_NAME "sf_mcu"
|
|
//#endif
|
|
|
|
//#ifndef SF_I2C_ADDR
|
|
#if (defined(_MODEL_565_HUNTING_EVB_LINUX_4G_S530_) || defined(_MODEL_565_HUNTING_EVB_LINUX_4G_S550_))
|
|
#define MCU_I2C_SLAVE_ADDR (0x20>>1)
|
|
#elif defined(_MODEL_565_HUNTING_EVB_LINUX_4G_68CS_)
|
|
#define MCU_I2C_SLAVE_ADDR (0xA0>>1)
|
|
#else
|
|
#define MCU_I2C_SLAVE_ADDR (0x20>>1)
|
|
#endif
|
|
|
|
|
|
ER sf_i2c_init_driver(UINT32 i2c_id);
|
|
void sf_i2c_remove_driver(UINT32 id);
|
|
INT32 sf_i2c_transfer(struct i2c_msg *msgs, INT32 num);
|
|
|
|
|
|
#endif
|
|
|