mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Cleanup
This commit is contained in:
@@ -21,8 +21,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "hal_i2c.h"
|
#include "hal_i2c.h"
|
||||||
#include "bl702_i2c.h"
|
|
||||||
#include "bl702_glb.h"
|
#include "bl702_glb.h"
|
||||||
|
#include "bl702_i2c.h"
|
||||||
|
|
||||||
static i2c_device_t i2cx_device[I2C_MAX_INDEX] = {
|
static i2c_device_t i2cx_device[I2C_MAX_INDEX] = {
|
||||||
#ifdef BSP_USING_I2C0
|
#ifdef BSP_USING_I2C0
|
||||||
@@ -39,8 +39,7 @@ static i2c_device_t i2cx_device[I2C_MAX_INDEX] = {
|
|||||||
* @param oflag
|
* @param oflag
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
int i2c_open(struct device *dev, uint16_t oflag)
|
int i2c_open(struct device *dev, uint16_t oflag) {
|
||||||
{
|
|
||||||
i2c_device_t *i2c_device = (i2c_device_t *)dev;
|
i2c_device_t *i2c_device = (i2c_device_t *)dev;
|
||||||
|
|
||||||
if (i2c_device->mode == I2C_HW_MODE) {
|
if (i2c_device->mode == I2C_HW_MODE) {
|
||||||
@@ -50,54 +49,6 @@ int i2c_open(struct device *dev, uint16_t oflag)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// int i2c_close(struct device *dev)
|
|
||||||
// {
|
|
||||||
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// int i2c_control(struct device *dev, int cmd, void *args)
|
|
||||||
// {
|
|
||||||
// //i2c_device_t *i2c_device = (i2c_device_t *)dev;
|
|
||||||
|
|
||||||
// switch (cmd)
|
|
||||||
// {
|
|
||||||
// case DEVICE_CTRL_SET_INT /* constant-expression */:
|
|
||||||
|
|
||||||
// break;
|
|
||||||
// case DEVICE_CTRL_CLR_INT /* constant-expression */:
|
|
||||||
// /* code */
|
|
||||||
// /* Enable UART interrupt*/
|
|
||||||
|
|
||||||
// break;
|
|
||||||
// case DEVICE_CTRL_GET_INT /* constant-expression */:
|
|
||||||
// /* code */
|
|
||||||
// break;
|
|
||||||
// case DEVICE_CTRL_CONFIG /* constant-expression */:
|
|
||||||
// /* code */
|
|
||||||
// break;
|
|
||||||
// case 4 /* constant-expression */:
|
|
||||||
// /* code */
|
|
||||||
// break;
|
|
||||||
// case 5 /* constant-expression */:
|
|
||||||
// /* code */
|
|
||||||
// break;
|
|
||||||
// default:
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
// int i2c_write(struct device *dev, uint32_t pos, const void *buffer, uint32_t size)
|
|
||||||
// {
|
|
||||||
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
// int i2c_read(struct device *dev, uint32_t pos, void *buffer, uint32_t size)
|
|
||||||
// {
|
|
||||||
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
@@ -106,8 +57,7 @@ int i2c_open(struct device *dev, uint16_t oflag)
|
|||||||
* @param flag
|
* @param flag
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
int i2c_register(enum i2c_index_type index, const char *name)
|
int i2c_register(enum i2c_index_type index, const char *name) {
|
||||||
{
|
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
|
|
||||||
if (I2C_MAX_INDEX == 0) {
|
if (I2C_MAX_INDEX == 0) {
|
||||||
@@ -135,8 +85,7 @@ int i2c_register(enum i2c_index_type index, const char *name)
|
|||||||
* @param num
|
* @param num
|
||||||
* @return uint32_t
|
* @return uint32_t
|
||||||
*/
|
*/
|
||||||
int i2c_transfer(struct device *dev, i2c_msg_t msgs[], uint32_t num)
|
int i2c_transfer(struct device *dev, i2c_msg_t msgs[], uint32_t num) {
|
||||||
{
|
|
||||||
i2c_msg_t *msg;
|
i2c_msg_t *msg;
|
||||||
I2C_Transfer_Cfg i2cCfg = {0};
|
I2C_Transfer_Cfg i2cCfg = {0};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user