12345678910111213141516171819202122232425262728293031323334353637383940 |
- #ifndef __I2C_API_H__
- #define __I2C_API_H__
- #include <stdint.h>
- #include <fcntl.h>
- #include "./../../driver/I2C/i2c.h"
- //#include <linux/i2c.h>
- //#include <linux/fs.h>
- //#include <linux/slab.h>
- int I2C_Master_Transmit(I2C_DEV_T *dev, uint8_t DevAddress, uint8_t *pData, uint8_t start_reg, uint16_t Size);
- int I2C_Master_Receiver(I2C_DEV_T *dev, uint8_t DevAddress, uint8_t *pData, uint8_t start_reg, uint16_t Size);
- //int test()
- //{
- // char a[2];
- // struct file *my_file;
- // int ret;
- // char b=0;
- // my_file=kzalloc(sizeof(file),GFP_KERNEL);
- // ret = i2cdev_open("/dev/i2c3",&my_file)
- // if(ret!=0)
- // printf("open fail\n");
- //
- // my_file.private_data.addr=0x88;
- //
- // i2c_master_send&((my_file->private_data),&b,1)
- // i2c_master_recv(&(my_file->private_data),a ,2);
- // printf("read data is %x , %x\n",a[0],a[1]);
- //
- //};
- //
- //}
- #endif /* __I2C_API_H__ */
|