OSDN Git Service

hw/BQ34110.h
authorPawel Jewstafjew <Pawel.Jewstafjew@gmail.com>
Wed, 14 Nov 2018 19:50:42 +0000 (19:50 +0000)
committerPawel Jewstafjew <Pawel.Jewstafjew@gmail.com>
Wed, 14 Nov 2018 19:50:42 +0000 (19:50 +0000)
hw/BQ34110.h [new file with mode: 0644]

diff --git a/hw/BQ34110.h b/hw/BQ34110.h
new file mode 100644 (file)
index 0000000..8634529
--- /dev/null
@@ -0,0 +1,21 @@
+// Texas Instruments BQ34100
+// Multi-Chemistry CEDV Battery Gas Gauge
+
+enum bq_i2c_enum { // I2C address
+   BQ34110_I2C_ADDR = 0x55 // wr: 0xAA, rd: 0xAB
+};
+
+enum bq_cmd_enum {
+   BQ34110_CONTROL       = 0x0, // Control (subcommands)
+   BQ34110_VOLTAGE       = 0x8, // Voltage
+   BQ34110_CURRENT       = 0xC, // Current
+   BQ34110_AVG_CURRENT   = 0x14, // AverageCurrent
+   BQ34110_RAW_CURRENT   = 0x7A, // RawCurrent
+   BQ34110_RAW_VOLTAGE   = 0x7C, // RawVoltage
+   BQ34110_RAW_INT_TEMP  = 0x7E, // RawIntTemp
+};
+
+enum bq_subcmd_enum {
+   BQ34110_SUB_DEVICE_TYPE = 0x0001, // Reports the device type of 0x0110 (indicating the bq34110 device)
+   BQ34110_SUB_DEVICE_NAME = 0x004A, // This MAC subcommand returns the device name on MACData() in ASCII characters (0x62 0x71 0x33 0x34 0x31 0x31 0c30 for the bq34110 device).
+};