ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
usb_link.h
Go to the documentation of this file.
1
25#ifndef USB_LINK_H
26#define USB_LINK_H
27
28#include <stdint.h>
29#include <stddef.h>
30
31#define USBL_RX_SIZE 1024u
32#define USBL_TX_SIZE 4096u
33#define USBL_CMD_MAX 32u
34#define USBL_OPEN_MS 3000u
38
39void usbl_reset(void);
40
41/* ---- USB interrupt / board binding ---- */
42void usbl_rx_isr(const uint8_t *p, uint32_t n);
44void usbl_set_configured(uint8_t on);
45void usbl_set_dtr(uint8_t on);
46
47/* ---- any task ---- */
49uint8_t usbl_host(void);
51uint8_t usbl_open(uint32_t now_ms);
52
53/* ---- LogTask (RX consumer) ---- */
55uint32_t usbl_poll(uint8_t *cmd, uint32_t cap, uint32_t now_ms);
56uint32_t usbl_rx_errors(void);
58/* ---- producers (one task per source) ---- */
59uint32_t usbl_tx_free_src(uint8_t src);
61int usbl_send_src(uint8_t src, uint8_t type, const void *payload, uint8_t len);
63int usbl_put_frame(uint8_t src, const uint8_t *frame, uint32_t n);
65static inline uint32_t usbl_tx_free(void) { return usbl_tx_free_src(USBL_SRC_LOG); }
66static inline int usbl_send(uint8_t type, const void *payload, uint8_t len) { return usbl_send_src(USBL_SRC_LOG, type, payload, len); }
67uint32_t usbl_tx_dropped(uint8_t src);
69/* ---- board binding (one consumer, the LogTask) ---- */
70uint32_t usbl_tx_peek(uint8_t *buf, uint32_t cap);
71void usbl_tx_consume(uint32_t n);
73void usbl_tx_flush(void);
74
75#endif /* USB_LINK_H */
uint32_t n
Definition calib_mgr.c:35
float cap[6][3]
Definition calib_mgr.c:36
static void cmd(uint8_t port, const uint8_t *c, uint32_t n, uint8_t armed, uint32_t now)
Definition log_task.c:222
uint8_t on
Definition log_task.c:48