31 #include "pprzlink/pprzlink_device.h"
32 #include "pprzlink/pprz_transport.h"
34 #include "generated/airframe.h"
36 #define W5100_RX_BUFFER_SIZE 80
37 #define W5100_TX_BUFFER_SIZE 80
38 #define W5100_BUFFER_NUM 2
40 #ifndef W5100_UPDATE_DL
41 #define W5100_UPDATE_DL TRUE
75 extern struct pprz_w5100_tp;
93 }
while ((t->status !=
UNINIT) && !(t->trans_rx.msg_received));
99 if (
dev->char_available(
dev->periph)) {
101 if (trans->trans_rx.msg_received) {
103 trans->trans_rx.msg_received =
false;
Handling of messages coming from ground and other A/Cs.
#define DatalinkFillDlBuffer(_buf, _len)
Convenience macro to fill dl_buffer.
static void DlCheckAndParse(struct link_device *dev, struct transport_tx *trans, uint8_t *buf, bool *msg_available, bool update_dl)
Check for new message and parse.
uint8_t dl_buffer[MSG_SIZE]
bool dl_msg_available
Flag provided to control calls to dl_parse_msg.
#define UNINIT
Receiving pprz messages.
static const struct usb_device_descriptor dev
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
#define W5100_TX_BUFFER_SIZE
volatile uint16_t tx_extract_idx[W5100_BUFFER_NUM]
volatile uint8_t work_tx[4]
static void w5100_read_buffer(struct pprz_transport *t)
volatile uint16_t rx_insert_idx[W5100_BUFFER_NUM]
void w5100_transmit(uint8_t data)
volatile uint8_t work_rx[4]
struct link_device device
Generic device interface.
#define W5100_RX_BUFFER_SIZE
void w5100_transmit_buffer(uint8_t *data, uint16_t len)
uint16_t w5100_rx_size(uint8_t _s)
volatile uint8_t tx_buf[W5100_BUFFER_NUM][W5100_TX_BUFFER_SIZE]
bool w5100_ch_available(void)
struct w5100_periph chip0
uint8_t w5100_rx_buf[W5100_RX_BUFFER_SIZE]
uint16_t w5100_receive(uint8_t *buf, uint16_t len)
volatile uint8_t tx_running
volatile uint16_t rx_extract_idx[W5100_BUFFER_NUM]
volatile uint16_t tx_insert_idx[W5100_BUFFER_NUM]
volatile uint8_t rx_buf[W5100_BUFFER_NUM][W5100_RX_BUFFER_SIZE]
static void w5100_check_and_parse(struct link_device *dev, struct pprz_transport *trans)