|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
34 #if PERIODIC_TELEMETRY
40 #define ESC32_BUF_IN_LEN 64
41 #define ESC32_BUF_OUT_LEN 32
42 #define ESC32_PARAMS_LEN 10
43 #define ESC32_TELEMETRY_RATE 100.0
73 for (i = 0; i < esc->
out_idx; i++) {
90 unsigned char *
c = (
unsigned char *)&
f;
92 for (i = 0; i <
sizeof(float); i++)
107 unsigned char *
c = (
unsigned char *)&i;
109 for (j = 0; j <
sizeof(short); j++)
115 unsigned char *
c = (
unsigned char *)&
f;
117 for (j = 0; j <
sizeof(float); j++)
146 #define SEARCH_COMMAND 2
147 #define GET_CMD_ROWS 3
148 #define GET_CMD_COLS 4
149 #define GET_COMMAND 5
155 switch (esc->
state) {
225 pprz_msg_send_ESC(trans,
dev, AC_ID,
245 #if PERIODIC_TELEMETRY
252 static int debug_start = 0;
261 while (i < (
int)
sizeof(data)) {
static void esc32_filter_data(struct esc32_parameter *in, struct esc32_parameter *out, struct esc32_parameter *min, struct esc32_parameter *max)
VIC slots used for the LPC2148 define name e g gps UART1_VIC_SLOT e g modem SPI1_VIC_SLOT SPI1 in mcu_periph spi_arch c or spi_slave_hs_arch c(and some others not using the SPI peripheral yet..) I2C0_VIC_SLOT 8 mcu_periph/i2c_arch.c I2C1_VIC_SLOT 9 mcu_periph/i2c_arch.c USB_VIC_SLOT 10 usb
#define ESC32_BUF_OUT_LEN
uint8_t uart_getch(struct uart_periph *p)
static void esc32_compute_ck(struct esc32_ck *ck, uint8_t c)
float volts_motor
motor voltage (bat voltage * throttle in % in fact)
bool data_available
data updated
float amps
current consumption
void esc32_periodic(void)
int uart_char_available(struct uart_periph *p)
Check UART for available chars in receive buffer.
static float esc32_get_float(struct esc32_private *esc, int idx)
uint8_t buf_out[ESC32_BUF_OUT_LEN]
static void esc32_put_float(struct esc32_private *esc, float f)
static struct esc32_private esc32_priv
float power
computed battery power
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
static void esc32_put_short(struct esc32_private *esc, unsigned short i)
struct esc32_parameter params[ESC32_PARAMS_LEN]
#define ESC32_TELEMETRY_RATE
static const struct usb_device_descriptor dev
static void esc32_send(struct esc32_private *esc)
Architecture independent timing functions.
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
void uart_put_byte(struct uart_periph *p, long fd, uint8_t data)
Uart transmit implementation.
static void esc32_msg_send(struct transport_tx *trans, struct link_device *dev)
@ BINARY_VALUE_VOLTS_MOTOR
uint8_t buf_in[ESC32_BUF_IN_LEN]
static void esc32_parse_msg(struct esc32_private *esc_priv, struct esc32 *esc)
uint16_t f
Camera baseline, in meters (i.e. horizontal distance between the two cameras of the stereo setup)
Common code for AP and FBW telemetry.
static uint16_t esc32_send_command(struct esc32_private *esc, enum binaryCommands command, float param1, float param2, int n)
@ BINARY_COMMAND_TELEM_RATE
float volts_bat
input battery voltage
static void esc32_put_char(struct esc32_private *esc, unsigned char c)
@ BINARY_COMMAND_TELEM_VALUE
static void esc32_init_ck(struct esc32_ck *ck)
struct esc32_parameter params
filtered data from the esc
float rpm
motor rotation speed
float energy
accumulated energy
static void parse_esc32(struct esc32_private *esc, uint8_t c)
#define DefaultPeriodic
Set default periodic telemetry.