25 #if PERIODIC_TELEMETRY
32 #if PERIODIC_TELEMETRY
33 static void send_uart0_err(
struct transport_tx *trans,
struct link_device *
dev)
39 pprz_msg_send_UART_ERRORS(trans, dev, AC_ID,
40 &ore, &ne_err, &fe_err, &_bus0);
49 #if PERIODIC_TELEMETRY
50 static void send_uart1_err(
struct transport_tx *trans,
struct link_device *
dev)
56 pprz_msg_send_UART_ERRORS(trans, dev, AC_ID,
57 &ore, &ne_err, &fe_err, &_bus1);
66 #if PERIODIC_TELEMETRY
67 static void send_uart2_err(
struct transport_tx *trans,
struct link_device *
dev)
73 pprz_msg_send_UART_ERRORS(trans, dev, AC_ID,
74 &ore, &ne_err, &fe_err, &_bus2);
83 #if PERIODIC_TELEMETRY
84 static void send_uart3_err(
struct transport_tx *trans,
struct link_device *
dev)
90 pprz_msg_send_UART_ERRORS(trans, dev, AC_ID,
91 &ore, &ne_err, &fe_err, &_bus3);
100 #if PERIODIC_TELEMETRY
101 static void send_uart4_err(
struct transport_tx *trans,
struct link_device *
dev)
107 pprz_msg_send_UART_ERRORS(trans, dev, AC_ID,
108 &ore, &ne_err, &fe_err, &_bus4);
117 #if PERIODIC_TELEMETRY
118 static void send_uart5_err(
struct transport_tx *trans,
struct link_device *
dev)
124 pprz_msg_send_UART_ERRORS(trans, dev, AC_ID,
125 &ore, &ne_err, &fe_err, &_bus5);
134 #if PERIODIC_TELEMETRY
135 static void send_uart6_err(
struct transport_tx *trans,
struct link_device *
dev)
141 pprz_msg_send_UART_ERRORS(trans, dev, AC_ID,
142 &ore, &ne_err, &fe_err, &_bus6);
151 #if PERIODIC_TELEMETRY
152 static void send_uart7_err(
struct transport_tx *trans,
struct link_device *
dev)
158 pprz_msg_send_UART_ERRORS(trans, dev, AC_ID,
159 &ore, &ne_err, &fe_err, &_bus7);
167 #if PERIODIC_TELEMETRY
168 static void send_uart8_err(
struct transport_tx *trans,
struct link_device *
dev)
174 pprz_msg_send_UART_ERRORS(trans, dev, AC_ID,
175 &ore, &ne_err, &fe_err, &_bus8);
180 #if PERIODIC_TELEMETRY
181 static void send_uart_err(
struct transport_tx *trans __attribute__ ((unused)),
182 struct link_device *
dev __attribute__ ((unused)))
184 static uint8_t uart_nb_cnt = 0;
185 switch (uart_nb_cnt) {
188 send_uart0_err(trans,
dev);
break;
192 send_uart1_err(trans,
dev);
break;
196 send_uart2_err(trans,
dev);
break;
200 send_uart3_err(trans,
dev);
break;
204 send_uart4_err(trans,
dev);
break;
208 send_uart5_err(trans,
dev);
break;
212 send_uart6_err(trans,
dev);
break;
216 send_uart7_err(trans,
dev);
break;
220 send_uart8_err(trans,
dev);
break;
225 if (uart_nb_cnt == 9) {
241 p->
device.periph = (
void *)p;
250 #if PERIODIC_TELEMETRY
262 return (
uint16_t)(space - 1) >= len;
269 for (i = 0; i < len; i++) {
uint8_t rx_buf[UART_RX_BUFFER_SIZE]
Receive buffer.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
void uart_periph_set_baudrate(struct uart_periph *p, uint32_t baud)
Set baudrate.
volatile uint8_t tx_running
Periodic telemetry system header (includes downlink utility and generated code).
void WEAK uart_arch_init(void)
void WEAK uart_periph_invert_data_logic(struct uart_periph *p, bool invert_rx, bool invert_tx)
struct link_device device
Generic device interface.
#define UART_RX_BUFFER_SIZE
void WEAK uart_put_buffer(struct uart_periph *p, long fd, const uint8_t *data, uint16_t len)
Uart transmit buffer implementation.
void uart_periph_init(struct uart_periph *p)
#define DefaultPeriodic
Set default periodic telemetry.
uint8_t WEAK uart_getch(struct uart_periph *p)
volatile uint16_t ne_err
noise error counter
volatile uint16_t fe_err
framing error counter
static const struct usb_device_descriptor dev
void uart_put_byte(struct uart_periph *p, long fd, uint8_t data)
Uart transmit implementation.
bool WEAK uart_check_free_space(struct uart_periph *p, long *fd, uint16_t len)
uint16_t WEAK uart_char_available(struct uart_periph *p)
Check UART for available chars in receive buffer.
#define UART_TX_BUFFER_SIZE
static void send_uart_err(struct transport_tx *trans, struct link_device *dev)
void WEAK uart_send_message(struct uart_periph *p, long fd)
volatile uint16_t ore
overrun error counter
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.