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++)
 
   93    *c++ = 
esc->buf_in[
idx + i];
 
 
  100    esc->buf_out[
esc->out_idx++] = c;
 
 
  107  unsigned char *c = (
unsigned char *)&i;
 
 
  115  unsigned char *c = (
unsigned char *)&
f;
 
 
  125  esc->buf_out[
esc->out_idx++] = 
'A';
 
  126  esc->buf_out[
esc->out_idx++] = 
'q';
 
  136    esc->buf_out[
esc->out_idx++] = 
esc->ck_out.ck_a;
 
  137    esc->buf_out[
esc->out_idx++] = 
esc->ck_out.ck_b;
 
  141  return (
esc->cmd_seq_id - 1);
 
 
  146#define SEARCH_COMMAND  2 
  147#define GET_CMD_ROWS    3 
  148#define GET_CMD_COLS    4 
  155  switch (
esc->state) {
 
  198        esc->buf_in[
esc->in_idx++] = c;
 
  199        if (
esc->in_idx >= 
esc->in_rows * 
esc->in_cols * 
sizeof(
float)) {
 
  205      if (
esc->ck_in.ck_a == c) {
 
  213      if (
esc->ck_in.ck_b == c) {
 
  214        esc->msg_available = 
true;
 
 
  252#if PERIODIC_TELEMETRY 
 
  268    while (i < (
int) 
sizeof(data)) {
 
 
  343      esc->data_available = 
true;
 
 
Common code for AP and FBW telemetry.
void esc32_periodic(void)
static float esc32_get_float(struct esc32_private *esc, int idx)
static void esc32_msg_send(struct transport_tx *trans, struct link_device *dev)
uint8_t buf_in[ESC32_BUF_IN_LEN]
uint8_t buf_out[ESC32_BUF_OUT_LEN]
static void esc32_init_ck(struct esc32_ck *ck)
static void esc32_parse_msg(struct esc32_private *esc_priv, struct esc32 *esc)
static void esc32_filter_data(struct esc32_parameter *in, struct esc32_parameter *out, struct esc32_parameter *min, struct esc32_parameter *max)
#define ESC32_BUF_OUT_LEN
static void esc32_send(struct esc32_private *esc)
static void esc32_compute_ck(struct esc32_ck *ck, uint8_t c)
static struct esc32_private esc32_priv
struct esc32_parameter params[ESC32_PARAMS_LEN]
static void parse_esc32(struct esc32_private *esc, uint8_t c)
static void esc32_put_float(struct esc32_private *esc, float f)
#define ESC32_TELEMETRY_RATE
static uint16_t esc32_send_command(struct esc32_private *esc, enum binaryCommands command, float param1, float param2, int n)
static void esc32_put_short(struct esc32_private *esc, unsigned short i)
static void esc32_put_char(struct esc32_private *esc, unsigned char c)
float rpm
motor rotation speed
@ BINARY_COMMAND_TELEM_VALUE
@ BINARY_COMMAND_TELEM_RATE
float amps
current consumption
float energy
accumulated energy
@ BINARY_VALUE_VOLTS_MOTOR
float volts_motor
motor voltage (bat voltage * throttle in % in fact)
float volts_bat
input battery voltage
float power
computed battery power
struct esc32_parameter params
filtered data from the esc
void uart_put_byte(struct uart_periph *periph, long fd, uint8_t data)
int uart_char_available(struct uart_periph *p)
Check UART for available chars in receive buffer.
uint8_t uart_getch(struct uart_periph *p)
static const struct usb_device_descriptor dev
Architecture independent timing functions.
int16_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint16_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
uint16_t f
Camera baseline, in meters (i.e. horizontal distance between the two cameras of the stereo setup)