|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
50 for (
int i = 0; i <
msg->length; i++) {
51 buf[4+i] =
msg->data[i];
53 buf[
msg->length+4] =
msg->cksum[0];
54 buf[
msg->length+5] =
msg->cksum[1];
68 if (
msg->length != 9) {
79 memcpy(&vbat, &
msg->data[1],
sizeof(
float));
105 if (
c->channel == 0) {
109 memset(&
c->data[2], 0, 3);
113 }
else if (cmd == 1) {
114 memset(&
c->data[1], 0, 7);
119 else if (
c->channel == 1) {
125 else if (
c->channel == 2) {
130 if (
c->channel == 0) {
131 int cmd =
c->data[0];
141 if (
c->channel == 0) {
143 memset(&
c->data[2], 0, 10);
147 else if (
c->channel == 1) {
155 if (
c->channel == 0) {
158 else if (
c->channel == 1) {
161 strcpy((
char *)
c->data,
"Bitcraze PPRZ");
203 if (available > data_size) {
290 int slots =
s->tx_extract_idx -
s->tx_insert_idx;
308 while (buf_rem > 0) {
314 memcpy(&
c->data[
c->size -
sizeof(
c->header)], &data[len - buf_rem], data_size);
315 c->size += data_size;
316 buf_rem -= data_size;
321 if (tmp ==
s->tx_extract_idx) {
328 memcpy(
c->data, &data[len - buf_rem], data_size);
329 c->size =
sizeof(
c->header) + data_size;
330 buf_rem -= data_size;
331 s->tx_insert_idx = tmp;
350 uint8_t ret =
s->rx_buf[
s->rx_extract_idx];
357 int available =
s->rx_insert_idx -
s->rx_extract_idx;
VIC slots used for the LPC2148 define name e g gps UART1_VIC_SLOT e g modem SPI1_VIC_SLOT SPI1 in mcu_periph spi_arch c or spi_slave_hs_arch c(and some others not using the SPI peripheral yet..) I2C0_VIC_SLOT 8 mcu_periph/i2c_arch.c I2C1_VIC_SLOT 9 mcu_periph/i2c_arch.c USB_VIC_SLOT 10 usb
#define PPRZ_MUTEX_INIT(_mtx)
static int split(microrl_t *pThis, int limit)
static void handle_raw(syslink_message_t *msg)
Handle raw datalink.
static int syslink_check_free_space(struct syslink_dl *s, long *fd UNUSED, uint16_t len)
Implementation of syslink as generic device.
uint8_t uart_getch(struct uart_periph *p)
#define SYSLINK_RADIO_DATARATE
static void handle_battery(syslink_message_t *msg)
Handle battery message.
struct syslink_dl syslink
#define SYSLINK_RADIO_RAW
int uart_char_available(struct uart_periph *p)
Check UART for available chars in receive buffer.
#define PPRZ_MUTEX_UNLOCK(_mtx)
float vsupply
supply voltage in V
struct link_device device
#define SYSLINK_RADIO_CHANNEL
syslink_message_t msg_rx
last received syslink message
static void handle_new_msg(syslink_message_t *msg)
New RX message.
bool charging
battery charging
uint8_t rx_buf[SYSLINK_RX_BUF_LEN]
received pprzlink bytes from syslink/crtp
#define CRTP_PORT_COMMANDER
void syslink_dl_init(void)
Init function.
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
static int syslink_char_available(struct syslink_dl *s)
static void syslink_put_buffer(struct syslink_dl *s, long fd UNUSED, const uint8_t *data, uint16_t len)
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
static void syslink_put_byte(struct syslink_dl *s, long fd, const uint8_t b)
bool syslink_parse_char(syslink_parse_state *state, uint8_t c, syslink_message_t *msg)
Parse one byte.
static void syslink_send_message(struct syslink_dl *s UNUSED, long fd UNUSED)
static void handle_radio(syslink_message_t *msg)
static uint8_t syslink_getch(struct syslink_dl *s)
#define SYSLINK_PM_ONOFF_SWITCHOFF
void syslink_parse_init(syslink_parse_state *state)
Init syslink parser.
void syslink_dl_periodic(void)
Periodic function.
void syslink_compute_cksum(syslink_message_t *msg)
Compute syslink checksum.
#define SYSLINK_RADIO_RSSI
if(GpsFixValid() &&e_identification_started)
#define CRTP_MAX_DATA_SIZE
arch independent LED (Light Emitting Diodes) API
#define PPRZ_MUTEX_LOCK(_mtx)
syslink_parse_state state
syslink parser state
#define CRTP_PORT_PPRZLINK
PPRZ_MUTEX(syslink_tx_mtx)
Protect syslink TX with Mutex when using RTOS.
void uart_put_buffer(struct uart_periph *p, long fd, const uint8_t *data, uint16_t len)
Uart transmit buffer implementation.
#define SYSLINK_RADIO_ADDRESS
uint8_t rx_insert_idx
rx insert index
struct Electrical electrical
void syslink_dl_event(void)
Datalink event.
static void send_message(syslink_message_t *msg)
Send a syslink message.
#define SYSLINK_PM_BATTERY_STATE
#define SYSLINK_RX_BUF_LEN
uint8_t tx_insert_idx
tx insert index
uint8_t tx_extract_idx
tx extract index
crtp_message_t msg_tx[CRTP_BUF_LEN]
queued crtp packets to be send
static void handle_raw_other(syslink_message_t *msg)
Handle various raw messages.