mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 17:48:54 +08:00
drivers/sensors/ina219.c: Appease nxstyle
This commit is contained in:
committed by
Xiang Xiao
parent
ac905598ca
commit
41f22bdba0
@@ -94,7 +94,7 @@ struct ina219_dev_s
|
|||||||
FAR struct i2c_master_s *i2c; /* I2C interface */
|
FAR struct i2c_master_s *i2c; /* I2C interface */
|
||||||
uint8_t addr; /* I2C address */
|
uint8_t addr; /* I2C address */
|
||||||
uint16_t config; /* INA 219 config shadow */
|
uint16_t config; /* INA 219 config shadow */
|
||||||
int32_t shunt_resistor_value; /* micro-ohms, max 2.15 kohms */
|
int32_t shunt_resistor_value; /* micro-ohms, max 2.15 kohms */
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -150,14 +150,16 @@ static int ina219_access(FAR struct ina219_dev_s *priv,
|
|||||||
struct i2c_msg_s msg[I2C_NOSTARTSTOP_MSGS];
|
struct i2c_msg_s msg[I2C_NOSTARTSTOP_MSGS];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].frequency = CONFIG_INA219_I2C_FREQUENCY;
|
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].frequency =
|
||||||
|
CONFIG_INA219_I2C_FREQUENCY;
|
||||||
|
|
||||||
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].addr = priv->addr;
|
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].addr = priv->addr;
|
||||||
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].flags = 0;
|
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].flags = 0;
|
||||||
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].buffer = &start_register_address;
|
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].buffer = &start_register_address;
|
||||||
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].length = 1;
|
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].length = 1;
|
||||||
|
|
||||||
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].addr = msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].addr;
|
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].addr =
|
||||||
|
msg[I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX].addr;
|
||||||
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].flags = reading ? I2C_M_READ : 0;
|
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].flags = reading ? I2C_M_READ : 0;
|
||||||
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].buffer = register_value;
|
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].buffer = register_value;
|
||||||
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].length = data_length;
|
msg[I2C_NOSTARTSTOP_DATA_MSG_INDEX].length = data_length;
|
||||||
|
|||||||
Reference in New Issue
Block a user