xWRL6432 MMWAVE-L-SDK  05.04.00.01
ina.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  */
43 /* INA228 registers */
44 #define INA228_CONFIG_REG0 (0x00)
45 #define INA228_CONFIG_REG1 (0x01)
46 #define INA228_CURRENT_REG (0x7)
47 #define INA228_CALIB_REG (0x2)
48 #define INA228_SHUNT_TEMP_REG (0x3)
49 #define INA228_DIE_ID_REG (0x3f)
50 #define INA228_DIE_ID_REG_VALUE (552U)
51 
52 
53 #include <drivers/i2c.h>
54 
66 void SensorConfig228(I2C_Handle i2cHandle, uint8_t i2cTargetAddress, uint32_t config0Val, uint32_t config1Val, uint32_t shuntTempVal, uint32_t calibVal);
67 
77 float currentRead228(I2C_Handle i2cHandle, uint8_t i2cTargetAddress, uint32_t currentLsb);
78 
currentRead228
float currentRead228(I2C_Handle i2cHandle, uint8_t i2cTargetAddress, uint32_t currentLsb)
Read INA228 sensor Current value.
I2C_Handle
struct I2C_Config_s * I2C_Handle
A handle that is returned from a I2C_open() call.
Definition: i2c/v0/i2c.h:173
SensorConfig228
void SensorConfig228(I2C_Handle i2cHandle, uint8_t i2cTargetAddress, uint32_t config0Val, uint32_t config1Val, uint32_t shuntTempVal, uint32_t calibVal)
Configure INA228 sensor.
i2c.h