Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
sbus_dual.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2014 Christophe De Wagter
3 *
4 * This file is part of paparazzi.
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 */
20
29#include "modules/core/abi.h"
30#include BOARD_CONFIG
31#include "mcu_periph/uart.h"
32#include <string.h>
33
34#ifndef RC_POLARITY_GPIO_PORT
35#define RC_POLARITY_GPIO_PORT 0
36#endif
37#ifndef RC_POLARITY_GPIO_PIN
38#define RC_POLARITY_GPIO_PIN 0
39#endif
40
41#ifndef RC2_POLARITY_GPIO_PORT
42#define RC2_POLARITY_GPIO_PORT RC_POLARITY_GPIO_PORT
43#endif
44#ifndef RC2_POLARITY_GPIO_PIN
45#define RC2_POLARITY_GPIO_PIN RC_POLARITY_GPIO_PIN
46#endif
47
50
51// Telemetry function
52#if PERIODIC_TELEMETRY
54
55static void send_sbus(struct transport_tx *trans, struct link_device *dev)
56{
57 // Using PPM message
60}
61#endif
62
63// Init function
75
81
Main include for ABI (AirBorneInterface).
#define RADIO_CONTROL_SBUS_DUAL_ID
uint16_t foo
Definition main_demo5.c:58
struct RadioControl radio_control
Generic interface for radio control modules.
uint8_t time_since_last_frame
uint8_t radio_ok_cpt
uint8_t frame_rate
uint8_t frame_cpt
#define RC_OK
uint8_t nb_channel
void sbus_common_init(struct Sbus *sbus_p, struct uart_periph *dev, gpio_port_t gpio_polarity_port, uint16_t gpio_polarity_pin)
Init function.
Definition sbus_common.c:74
void sbus_common_decode_event(struct Sbus *sbus_p, struct uart_periph *dev)
Decoding event function.
uint16_t pulses[SBUS_NB_CHANNEL]
Decoded values.
Definition sbus_common.h:69
bool frame_available
A data frame is available.
Definition sbus_common.h:71
#define SBUS_NB_CHANNEL
Definition sbus_common.h:63
SBUS structure.
Definition sbus_common.h:68
#define RC_POLARITY_GPIO_PORT
Definition sbus_dual.c:35
static void send_sbus(struct transport_tx *trans, struct link_device *dev)
Definition sbus_dual.c:55
struct Sbus sbus1 sbus2
SBUS struct.
Definition sbus_dual.c:49
void sbus_dual_event(void)
RC event function.
Definition sbus_dual.c:82
#define RC_POLARITY_GPIO_PIN
Definition sbus_dual.c:38
#define RC2_POLARITY_GPIO_PIN
Definition sbus_dual.c:45
static void sbus_dual_decode_event(void)
Definition sbus_dual.c:76
#define RC2_POLARITY_GPIO_PORT
Definition sbus_dual.c:42
void sbus_dual_init(void)
RC init function.
Definition sbus_dual.c:64
Radio control via two SBUS receivers.
static const struct usb_device_descriptor dev
Definition usb_ser_hw.c:74
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Definition telemetry.c:51
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
Definition telemetry.h:66
arch independent UART (Universal Asynchronous Receiver/Transmitter) API