|  | Paparazzi UAS v7.0_unstable
    Paparazzi is a free software Unmanned Aircraft System. | 
driver for ADC AD7997 on a custom made power board version 4.0 and 5.0 More...
 Include dependency graph for battery_monitor.c:
 Include dependency graph for battery_monitor.c:Go to the source code of this file.
| Functions | |
| static void | send_batmon (struct transport_tx *trans, struct link_device *dev) | 
| uint8_t | battery_monitor_get_address (uint8_t chan) | 
| Translates the channel number to the value for address pointer register Channels are numbered from 1 to 8. | |
| void | battery_monitor_init_bus (void) | 
| Initializes bus ADC. | |
| void | battery_monitor_init_balance (struct BatMonBal *batmonbal) | 
| Initalizes balance ADC. | |
| void | battery_monitor_init (void) | 
| Init variables. | |
| void | battery_monitor_event (void) | 
| Event function Check i2c transaction status for each device. | |
| void | battery_monitor_check_i2c_transaction (struct i2c_transaction *t) | 
| Complete i2c transactions once they succeed or fail. | |
| void | battery_monitor_read_bus (void) | 
| Read bus (current, voltage and temperature sensors) | |
| void | battery_monitor_read_balance_ports_1 (void) | 
| Read Balance ADC 1. | |
| void | battery_monitor_read_balance_ports_2 (void) | 
| Read Balance ADC 2. | |
| void | battery_monitor_read_balance_ports (struct BatMonBal *batmonbal) | 
| Read balance ADC. | |
| Variables | |
| struct BatMonBus | batmonbus | 
| struct BatMonBal | batmonbal1 | 
| struct BatMonBal | batmonbal2 | 
| int16_t | batmon_current_offset | 
| float | batmon_current_sensitivity | 
| int16_t | batmon_temp_offset | 
| float | batmon_temp_sensitivity | 
driver for ADC AD7997 on a custom made power board version 4.0 and 5.0
Definition in file battery_monitor.c.
| void battery_monitor_check_i2c_transaction | ( | struct i2c_transaction * | t | ) | 
Complete i2c transactions once they succeed or fail.
Definition at line 170 of file battery_monitor.c.
References foo, I2CTransDone, I2CTransFailed, I2CTransPending, I2CTransRunning, and I2CTransSuccess.
Referenced by battery_monitor_event().
 Here is the caller graph for this function:
 Here is the caller graph for this function:Event function Check i2c transaction status for each device.
Definition at line 161 of file battery_monitor.c.
References batmonbal1, batmonbal2, batmonbus, battery_monitor_check_i2c_transaction(), BatMonBus::bus_trans, and BatMonBal::bus_trans.
 Here is the call graph for this function:
 Here is the call graph for this function:Translates the channel number to the value for address pointer register Channels are numbered from 1 to 8.
| chan | - desired channel | 
Definition at line 91 of file battery_monitor.c.
References foo.
Referenced by battery_monitor_read_balance_ports(), and battery_monitor_read_bus().
 Here is the caller graph for this function:
 Here is the caller graph for this function:Init variables.
Definition at line 140 of file battery_monitor.c.
References BatMonBal::addr, batmonbal1, batmonbal2, battery_monitor_init_balance(), battery_monitor_init_bus(), DefaultPeriodic, foo, register_periodic_telemetry(), and send_batmon().
 Here is the call graph for this function:
 Here is the call graph for this function:Initalizes balance ADC.
Definition at line 130 of file battery_monitor.c.
References foo, and I2CTransDone.
Referenced by battery_monitor_init().
 Here is the caller graph for this function:
 Here is the caller graph for this function:Initializes bus ADC.
Definition at line 102 of file battery_monitor.c.
References BatMonBus::addr, batmon_current_offset, batmon_current_sensitivity, batmon_temp_offset, batmon_temp_sensitivity, batmonbus, BATTERY_MONITOR_BUS_CURRENT_REQ, BATTERY_MONITOR_CURRENT_OFFSET, BATTERY_MONITOR_CURRENT_SENSITIVITY, BATTERY_MONITOR_TEMP_OFFSET, BATTERY_MONITOR_TEMP_SENSITIVITY, BatMonBus::bus_brd_tmp, BatMonBus::bus_current, BatMonBus::bus_current_mvolts, BatMonBus::bus_status, BatMonBus::bus_temp, BatMonBus::bus_tempsensors_mvolts, BatMonBus::bus_trans, BatMonBus::bus_voltage_mvolts, BatMonBus::data, foo, I2CTransDone, i2c_transaction::status, and BatMonBus::t_idx.
Referenced by battery_monitor_init().
 Here is the caller graph for this function:
 Here is the caller graph for this function:Read balance ADC.
Definition at line 354 of file battery_monitor.c.
References BATTERY_CELLS_NB, BATTERY_MONITOR_BIT_RES, battery_monitor_cellgains, battery_monitor_cellmap, battery_monitor_get_address(), BATTERY_MONITOR_VREF_MULT, foo, i2c_transceive(), and I2CTransDone.
Referenced by battery_monitor_read_balance_ports_1(), and battery_monitor_read_balance_ports_2().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Read Balance ADC 1.
Definition at line 340 of file battery_monitor.c.
References batmonbal1, and battery_monitor_read_balance_ports().
 Here is the call graph for this function:
 Here is the call graph for this function:Read Balance ADC 2.
Definition at line 347 of file battery_monitor.c.
References batmonbal2, and battery_monitor_read_balance_ports().
 Here is the call graph for this function:
 Here is the call graph for this function:Read bus (current, voltage and temperature sensors)
Definition at line 197 of file battery_monitor.c.
References BatMonBus::addr, batmon_current_offset, batmon_current_sensitivity, batmon_temp_offset, batmon_temp_sensitivity, batmonbus, BatmonVbusGain, BATTERY_MONITOR_BIT_RES, BATTERY_MONITOR_BUS_CURRENT_CHANNEL, BATTERY_MONITOR_BUS_CURRENT_READ, BATTERY_MONITOR_BUS_CURRENT_REQ, BATTERY_MONITOR_BUS_TEMPERATURE_READ, BATTERY_MONITOR_BUS_TEMPERATURE_REQ, BATTERY_MONITOR_BUS_VOLTAGE_CHANNEL, BATTERY_MONITOR_BUS_VOLTAGE_READ, BATTERY_MONITOR_BUS_VOLTAGE_REQ, battery_monitor_get_address(), battery_monitor_tempmap, BATTERY_MONITOR_VREF_MULT, i2c_transaction::buf, BatMonBus::bus_current, BatMonBus::bus_current_mvolts, BatMonBus::bus_status, BatMonBus::bus_temp, BatMonBus::bus_tempsensors_mvolts, BatMonBus::bus_trans, BatMonBus::bus_voltage_mvolts, Electrical::current, BatMonBus::data, electrical, foo, i2c_transceive(), I2CTransDone, i2c_transaction::status, BatMonBus::t_idx, TEMP_SENSORS_NB, and Electrical::vsupply.
 Here is the call graph for this function:
 Here is the call graph for this function:| 
 | static | 
Definition at line 46 of file battery_monitor.c.
References BatMonBal::bat_cell_mvolts, batmonbal1, batmonbal2, batmonbus, BATTERY_CELLS_NB, BatMonBus::bus_current, BatMonBus::bus_current_mvolts, BatMonBus::bus_status, BatMonBus::bus_temp, BatMonBus::bus_tempsensors_mvolts, BatMonBus::bus_trans, BatMonBal::bus_trans, BatMonBus::bus_voltage_mvolts, dev, foo, i2c_transaction::status, and TEMP_SENSORS_NB.
Referenced by battery_monitor_init().
 Here is the caller graph for this function:
 Here is the caller graph for this function:| int16_t batmon_current_offset | 
Definition at line 39 of file battery_monitor.c.
Referenced by battery_monitor_init_bus(), and battery_monitor_read_bus().
| float batmon_current_sensitivity | 
Definition at line 40 of file battery_monitor.c.
Referenced by battery_monitor_init_bus(), and battery_monitor_read_bus().
| int16_t batmon_temp_offset | 
Definition at line 41 of file battery_monitor.c.
Referenced by battery_monitor_init_bus(), and battery_monitor_read_bus().
| float batmon_temp_sensitivity | 
Definition at line 42 of file battery_monitor.c.
Referenced by battery_monitor_init_bus(), and battery_monitor_read_bus().
| struct BatMonBal batmonbal1 | 
Definition at line 35 of file battery_monitor.c.
Referenced by battery_monitor_event(), battery_monitor_init(), battery_monitor_read_balance_ports_1(), and send_batmon().
| struct BatMonBal batmonbal2 | 
Definition at line 36 of file battery_monitor.c.
Referenced by battery_monitor_event(), battery_monitor_init(), battery_monitor_read_balance_ports_2(), and send_batmon().
| struct BatMonBus batmonbus | 
Definition at line 34 of file battery_monitor.c.
Referenced by battery_monitor_event(), battery_monitor_init_bus(), battery_monitor_read_bus(), and send_batmon().