|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
30 #if BATTERY_MONITOR_REV4
44 #if PERIODIC_TELEMETRY
49 #if BATTERY_MONITOR_REV4
62 pprz_msg_send_BATTERY_MONITOR(trans,
dev, AC_ID,
65 &batmonbus_bus_trans_status,
73 &batmonbal1_bus_trans_status,
76 &batmonbal2_bus_trans_status,
92 if ((chan>8) || (chan<1)){
95 static uint8_t adr[] = {0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0};
152 #if PERIODIC_TELEMETRY
float batmon_temp_sensitivity
#define BATTERY_MONITOR_CURRENT_SENSITIVITY
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
#define BATTERY_MONITOR_VREF_MULT
@ BATTERY_MONITOR_BUS_TEMPERATURE_READ
#define BATTERY_MONITOR_TEMP_OFFSET
@ BATTERY_MONITOR_BUS_VOLTAGE_READ
void battery_monitor_check_i2c_transaction(struct i2c_transaction *t)
Complete i2c transactions once they succeed or fail.
@ BATTERY_MONITOR_BUS_TEMPERATURE_REQ
Battery monitor Bus ADC struct.
#define BATTERY_MONITOR_BUS_CURRENT_CHANNEL
Battery monitor Balance ADC struct.
struct BatMonBus batmonbus
struct i2c_transaction bus_trans
@ I2CTransFailed
transaction failed
uint16_t bat_cell_mvolts[BATTERY_CELLS_NB]
int16_t batmon_temp_offset
float bus_temp[TEMP_SENSORS_NB]
float vsupply
supply voltage in V
#define BATTERY_MONITOR_TEMP_SENSITIVITY
@ I2CTransSuccess
transaction successfully finished by I2C driver
static const uint8_t battery_monitor_tempmap[]
#define BATTERY_MONITOR_CURRENT_OFFSET
void battery_monitor_init_balance(struct BatMonBal *batmonbal)
Initalizes balance ADC.
void battery_monitor_read_balance_ports_2(void)
Read Balance ADC 2.
@ BATTERY_MONITOR_BUS_VOLTAGE_REQ
void battery_monitor_init(void)
Init variables.
void battery_monitor_read_bus(void)
Read bus (current, voltage and temperature sensors)
uint16_t bus_tempsensors_mvolts[TEMP_SENSORS_NB]
@ BATTERY_MONITOR_BUS_CURRENT_READ
static const struct usb_device_descriptor dev
static const float BatmonVbusGain
bool i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
@ I2CTransRunning
transaction is currently ongoing
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
void battery_monitor_event(void)
Event function Check i2c transaction status for each device.
enum I2CTransactionStatus status
Transaction status.
void battery_monitor_init_bus(void)
Initializes bus ADC.
struct BatMonBal batmonbal2
int16_t batmon_current_offset
I2C transaction structure.
struct i2c_transaction bus_trans
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
void battery_monitor_read_balance_ports_1(void)
Read Balance ADC 1.
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 ...
static const uint8_t battery_monitor_cellmap[]
Cell map - which cell is which channel Channels are 1-indexed, ie.e.
static const float battery_monitor_cellgains[]
#define BATTERY_MONITOR_BUS_VOLTAGE_CHANNEL
static void send_batmon(struct transport_tx *trans, struct link_device *dev)
@ I2CTransPending
transaction is pending in queue
struct BatMonBal batmonbal1
@ I2CTransDone
transaction set to done by user level
struct Electrical electrical
uint16_t bus_voltage_mvolts
float batmon_current_sensitivity
#define BATTERY_MONITOR_BIT_RES
@ BATTERY_MONITOR_BUS_CURRENT_REQ
#define DefaultPeriodic
Set default periodic telemetry.
uint16_t bus_current_mvolts
enum BatmonBusStatus bus_status
float current
current in A
void battery_monitor_read_balance_ports(struct BatMonBal *batmonbal)
Read balance ADC.