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
slcan.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 Fabien-B <fabien-b@github.com>
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
27#pragma once
28
29#include <inttypes.h>
30#include <stdbool.h>
31#include "mcu_periph/can.h"
32#include "core/threads.h"
33
34#define SLCAN_CMD_BUF_LEN (2*64+15)
35
36typedef struct
37{
39 uint8_t cmd_buf[SLCAN_CMD_BUF_LEN]; // large enough for a 64 bytes frame
41 uint8_t tx_buf[SLCAN_CMD_BUF_LEN]; // large enough for a 64 bytes frame
43
44 struct pprzaddr_can can_if;
45 struct pprzcan_frame rx_frame; // frame received from CAN, to be sent through SLCAN
46
48 bool send_rx;
49} slcan_t;
50
51
52void slcan_init(void);
53void slcan_event(void);
uint16_t foo
Definition main_demo5.c:58
bool send_rx
Definition slcan.h:48
uint8_t cmd_buf_idx
Definition slcan.h:40
struct link_device * dev
Definition slcan.h:38
#define SLCAN_CMD_BUF_LEN
Definition slcan.h:34
bool timestamp
Definition slcan.h:42
void slcan_event(void)
Definition slcan.c:63
void slcan_init(void)
Definition slcan.c:53
pprz_mutex_t mtx
Definition slcan.h:47
char cmd_buf[64]
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.