Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
power_uavcan.c File Reference

Power sensors on the uavcan bus. More...

#include "power_uavcan.h"
#include "uavcan/uavcan.h"
#include "modules/energy/electrical.h"
+ Include dependency graph for power_uavcan.c:

Go to the source code of this file.

Data Structures

struct  uavcan_equipment_power_BatteryInfo
 
struct  uavcan_equipment_power_CircuitStatus
 
struct  uavcan_circuit_battery_t
 

Macros

#define UAVCAN_EQUIPMENT_POWER_BATTERYINFO_ID   1092
 
#define UAVCAN_EQUIPMENT_POWER_BATTERYINFO_SIGNATURE   (0x249C26548A711966ULL)
 
#define UAVCAN_EQUIPMENT_POWER_BATTERYINFO_MAX_SIZE   55
 
#define UAVCAN_EQUIPMENT_POWER_CIRCUITSTATUS_ID   1091
 
#define UAVCAN_EQUIPMENT_POWER_CIRCUITSTATUS_SIGNATURE   (0x8313D33D0DDDA115ULL)
 
#define UAVCAN_EQUIPMENT_POWER_CIRCUITSTATUS_MAX_SIZE   7
 
#define POWER_UAVCAN_BATTERIES_MAX   3
 
#define POWER_UAVCAN_CIRCUITS_MAX   15
 
#define POWER_UAVCAN_BATTERY_CIRCUITS   {}
 

Functions

static void power_uavcan_battery_cb (struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
 
static void power_uavcan_circuit_cb (struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
 
void power_uavcan_init (void)
 

Variables

static uavcan_event power_uavcan_ev
 
static uavcan_event circuit_uavcan_ev
 
static struct uavcan_equipment_power_BatteryInfo batteries [POWER_UAVCAN_BATTERIES_MAX] = {0}
 
static struct uavcan_equipment_power_CircuitStatus circuits [POWER_UAVCAN_CIRCUITS_MAX] = {0}
 
static struct uavcan_circuit_battery_t battery_circuits [] = POWER_UAVCAN_BATTERY_CIRCUITS
 

Detailed Description

Power sensors on the uavcan bus.

Definition in file power_uavcan.c.


Data Structure Documentation

◆ uavcan_equipment_power_BatteryInfo

struct uavcan_equipment_power_BatteryInfo

Definition at line 60 of file power_uavcan.c.

Data Fields
float average_power_10sec
uint8_t battery_id
float current
float full_charge_capacity_wh
float hours_to_full_charge
uint32_t model_instance_id
uint8_t node_id
float remaining_capacity_wh
bool set
uint8_t state_of_charge_pct
uint8_t state_of_charge_pct_stdev
uint8_t state_of_health_pct
uint16_t status_flags
float temperature
float voltage

◆ uavcan_equipment_power_CircuitStatus

struct uavcan_equipment_power_CircuitStatus

Definition at line 82 of file power_uavcan.c.

Data Fields
uint16_t circuit_id
float current
uint8_t error_flags
bool is_battery
uint8_t node_id
bool set
float voltage

◆ uavcan_circuit_battery_t

struct uavcan_circuit_battery_t

Definition at line 95 of file power_uavcan.c.

Data Fields
uint16_t circuit_id
uint8_t node_id

Macro Definition Documentation

◆ POWER_UAVCAN_BATTERIES_MAX

#define POWER_UAVCAN_BATTERIES_MAX   3

Definition at line 42 of file power_uavcan.c.

◆ POWER_UAVCAN_BATTERY_CIRCUITS

#define POWER_UAVCAN_BATTERY_CIRCUITS   {}

Definition at line 52 of file power_uavcan.c.

◆ POWER_UAVCAN_CIRCUITS_MAX

#define POWER_UAVCAN_CIRCUITS_MAX   15

Definition at line 47 of file power_uavcan.c.

◆ UAVCAN_EQUIPMENT_POWER_BATTERYINFO_ID

#define UAVCAN_EQUIPMENT_POWER_BATTERYINFO_ID   1092

Definition at line 31 of file power_uavcan.c.

◆ UAVCAN_EQUIPMENT_POWER_BATTERYINFO_MAX_SIZE

#define UAVCAN_EQUIPMENT_POWER_BATTERYINFO_MAX_SIZE   55

Definition at line 33 of file power_uavcan.c.

◆ UAVCAN_EQUIPMENT_POWER_BATTERYINFO_SIGNATURE

#define UAVCAN_EQUIPMENT_POWER_BATTERYINFO_SIGNATURE   (0x249C26548A711966ULL)

Definition at line 32 of file power_uavcan.c.

◆ UAVCAN_EQUIPMENT_POWER_CIRCUITSTATUS_ID

#define UAVCAN_EQUIPMENT_POWER_CIRCUITSTATUS_ID   1091

Definition at line 36 of file power_uavcan.c.

◆ UAVCAN_EQUIPMENT_POWER_CIRCUITSTATUS_MAX_SIZE

#define UAVCAN_EQUIPMENT_POWER_CIRCUITSTATUS_MAX_SIZE   7

Definition at line 38 of file power_uavcan.c.

◆ UAVCAN_EQUIPMENT_POWER_CIRCUITSTATUS_SIGNATURE

#define UAVCAN_EQUIPMENT_POWER_CIRCUITSTATUS_SIGNATURE   (0x8313D33D0DDDA115ULL)

Definition at line 37 of file power_uavcan.c.

Function Documentation

◆ power_uavcan_battery_cb()

◆ power_uavcan_circuit_cb()

◆ power_uavcan_init()

Variable Documentation

◆ batteries

Definition at line 57 of file power_uavcan.c.

Referenced by power_uavcan_battery_cb().

◆ battery_circuits

struct uavcan_circuit_battery_t battery_circuits[] = POWER_UAVCAN_BATTERY_CIRCUITS
static

Definition at line 57 of file power_uavcan.c.

Referenced by power_uavcan_init().

◆ circuit_uavcan_ev

uavcan_event circuit_uavcan_ev
static

Definition at line 57 of file power_uavcan.c.

Referenced by power_uavcan_init().

◆ circuits

Definition at line 57 of file power_uavcan.c.

Referenced by power_uavcan_circuit_cb(), and power_uavcan_init().

◆ power_uavcan_ev

uavcan_event power_uavcan_ev
static

Definition at line 56 of file power_uavcan.c.

Referenced by power_uavcan_init().