Paparazzi UAS  v6.0_unstable-94-gda5b527-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
actuators_uavcan.c File Reference

UAVCan actuators using RAWCOMMAND message and ESC_STATUS telemetry. More...

+ Include dependency graph for actuators_uavcan.c:

Go to the source code of this file.

Data Structures

struct  actuators_uavcan_telem_t
 

Macros

#define UAVCAN_ACTUATORS_USE_CURRENT   TRUE
 
#define UAVCAN_EQUIPMENT_ESC_STATUS_ID   1034
 
#define UAVCAN_EQUIPMENT_ESC_STATUS_SIGNATURE   (0xA9AF28AEA2FBB254ULL)
 
#define UAVCAN_EQUIPMENT_ESC_STATUS_MAX_SIZE   ((110 + 7)/8)
 
#define UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_ID   1030
 
#define UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_SIGNATURE   (0x217F5C87D7EC951DULL)
 
#define UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_MAX_SIZE   ((285 + 7)/8)
 

Functions

static void actuators_uavcan_send_esc (struct transport_tx *trans, struct link_device *dev)
 
static void actuators_uavcan_esc_status_cb (struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
 Whevener an ESC_STATUS message from the EQUIPMENT group is received. More...
 
void actuators_uavcan_init (struct uavcan_iface_t *iface)
 Initialize an uavcan interface. More...
 
void actuators_uavcan_commit (struct uavcan_iface_t *iface, int16_t *values, uint8_t nb)
 Commit actuator values to the uavcan interface. More...
 

Variables

static bool actuators_uavcan_initialized = false
 
static uavcan_event esc_status_ev
 

Detailed Description

UAVCan actuators using RAWCOMMAND message and ESC_STATUS telemetry.

Definition in file actuators_uavcan.c.


Data Structure Documentation

struct actuators_uavcan_telem_t

Definition at line 37 of file actuators_uavcan.c.

Data Fields
float current
uint32_t energy
int32_t rpm
float temperature
float voltage

Macro Definition Documentation

#define UAVCAN_ACTUATORS_USE_CURRENT   TRUE

Definition at line 33 of file actuators_uavcan.c.

#define UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_ID   1030

Definition at line 60 of file actuators_uavcan.c.

Referenced by actuators_uavcan_commit().

#define UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_MAX_SIZE   ((285 + 7)/8)

Definition at line 62 of file actuators_uavcan.c.

Referenced by actuators_uavcan_commit().

#define UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_SIGNATURE   (0x217F5C87D7EC951DULL)

Definition at line 61 of file actuators_uavcan.c.

Referenced by actuators_uavcan_commit().

#define UAVCAN_EQUIPMENT_ESC_STATUS_ID   1034

Definition at line 55 of file actuators_uavcan.c.

Referenced by actuators_uavcan_init().

#define UAVCAN_EQUIPMENT_ESC_STATUS_MAX_SIZE   ((110 + 7)/8)

Definition at line 57 of file actuators_uavcan.c.

#define UAVCAN_EQUIPMENT_ESC_STATUS_SIGNATURE   (0xA9AF28AEA2FBB254ULL)

Definition at line 56 of file actuators_uavcan.c.

Referenced by actuators_uavcan_init().

Function Documentation

void actuators_uavcan_commit ( struct uavcan_iface_t iface,
int16_t values,
uint8_t  nb 
)

Commit actuator values to the uavcan interface.

Definition at line 198 of file actuators_uavcan.c.

References offset, uavcan_broadcast(), UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_ID, UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_MAX_SIZE, and UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_SIGNATURE.

+ Here is the call graph for this function:

static void actuators_uavcan_esc_status_cb ( struct uavcan_iface_t iface,
CanardRxTransfer *  transfer 
)
static

Whevener an ESC_STATUS message from the EQUIPMENT group is received.

Definition at line 121 of file actuators_uavcan.c.

References actuators_uavcan_telem_t::current, Electrical::current, electrical, actuators_uavcan_telem_t::energy, rpm, actuators_uavcan_telem_t::temperature, and actuators_uavcan_telem_t::voltage.

Referenced by actuators_uavcan_init().

+ Here is the caller graph for this function:

void actuators_uavcan_init ( struct uavcan_iface_t iface)
static void actuators_uavcan_send_esc ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 71 of file actuators_uavcan.c.

References actuators_uavcan_telem_t::current, electrical, actuators_uavcan_telem_t::energy, offset, rand_uniform(), rpm, actuators_uavcan_telem_t::rpm, actuators_uavcan_telem_t::voltage, and Electrical::vsupply.

Referenced by actuators_uavcan_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

bool actuators_uavcan_initialized = false
static

Definition at line 65 of file actuators_uavcan.c.

Referenced by actuators_uavcan_init().

uavcan_event esc_status_ev
static

Definition at line 66 of file actuators_uavcan.c.