 |
Paparazzi UAS
v6.1.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
28 #include "pprzlink/intermcu_msg.h"
36 #error "INTERMCU UART CAN ONLY SEND 8 COMMANDS OR THE UART WILL BE OVERFILLED"
58 #if PERIODIC_TELEMETRY
64 pprz_msg_send_FBW_STATUS(trans,
dev, AC_ID,
84 #if PERIODIC_TELEMETRY
137 #pragma GCC diagnostic ignored "-Wcast-align"
142 #if PPRZLINK_DEFAULT_VER == 2
144 if (pprzlink_get_msg_class_id(
imcu_msg_buf) == DL_intermcu_CLASS_ID) {
147 case DL_IMCU_RADIO_COMMANDS: {
151 for (i = 0; i < size; i++) {
162 case DL_IMCU_FBW_STATUS: {
171 #if TELEMETRY_INTERMCU
172 case DL_IMCU_DATALINK: {
181 case DL_IMCU_REMOTE_GPS: {
183 gps_imcu.ecef_pos.x = DL_IMCU_REMOTE_GPS_ecef_x(
imcu_msg_buf);
184 gps_imcu.ecef_pos.y = DL_IMCU_REMOTE_GPS_ecef_y(
imcu_msg_buf);
185 gps_imcu.ecef_pos.z = DL_IMCU_REMOTE_GPS_ecef_z(
imcu_msg_buf);
188 gps_imcu.lla_pos.alt = DL_IMCU_REMOTE_GPS_alt(
imcu_msg_buf);
192 gps_imcu.ecef_vel.x = DL_IMCU_REMOTE_GPS_ecef_xd(
imcu_msg_buf);
193 gps_imcu.ecef_vel.y = DL_IMCU_REMOTE_GPS_ecef_yd(
imcu_msg_buf);
194 gps_imcu.ecef_vel.z = DL_IMCU_REMOTE_GPS_ecef_zd(
imcu_msg_buf);
197 gps_imcu.course = DL_IMCU_REMOTE_GPS_course(
imcu_msg_buf);
198 gps_imcu.gspeed = DL_IMCU_REMOTE_GPS_gspeed(
imcu_msg_buf);
203 gps_imcu.num_sv = DL_IMCU_REMOTE_GPS_numsv(
imcu_msg_buf);
224 #if PPRZLINK_DEFAULT_VER == 2
228 #pragma GCC diagnostic pop
bool autopilot_get_motors_on(void)
get motors status
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Rotorcraft Inter-MCU on the autopilot.
#define GPS_VALID_COURSE_BIT
void telemetry_intermcu_on_msg(uint8_t *msg, uint8_t size)
struct link_device * device
Device used for communication.
data structure for GPS information
#define INTERMCU_LOST_CNT
uint8_t time_since_last_frame
#define INTERMCU_SET_CMD_STATUS(_bit)
static const struct usb_device_descriptor dev
enum intermcu_status status
Status of the INTERMCU.
uint8_t time_since_last_frame
Time since last frame.
float vsupply
supply voltage in V
static void intermcu_parse_msg(void(*rc_frame_handler)(void))
bool enabled
If the InterMCU communication is enabled.
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
@ INTERMCU_LOST
No interMCU communication anymore.
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
struct intermcu_t intermcu
void intermcu_send_spektrum_bind(void)
Device independent GPS code (interface)
@ INTERMCU_CMD_MOTORS_ON
The status of autopilot_motors_on.
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
void gps_periodic_check(struct GpsState *gps_s)
Periodic GPS check.
bool msg_available
If we have an InterMCU message.
uint8_t cmd_status
Command status information that is transfered (intermcu_cmd_status)
void intermcu_periodic(void)
static struct fbw_status_t fbw_status
struct Electrical electrical
void intermcu_set_enabled(bool value)
#define GPS_VALID_VEL_ECEF_BIT
void intermcu_set_actuators(pprz_t *command_values, uint8_t ap_mode)
uint8_t imcu_msg_buf[128]
The InterMCU message buffer.
struct pprz_transport transport
Transport over communication line (PPRZ)
volatile uint32_t nb_sec_rem
remainder of seconds since startup in CPU_TICKS
static void send_status(struct transport_tx *trans, struct link_device *dev)
#define GPS_VALID_POS_ECEF_BIT
volatile uint32_t nb_sec
full seconds since startup
void RadioControlEvent(void(*frame_handler)(void))
#define GPS_FIX_NONE
No GPS fix.
#define GPS_FIX_3D
3D GPS fix
#define DefaultPeriodic
Set default periodic telemetry.
#define GPS_VALID_HMSL_BIT
float current
current in A
struct RadioControl radio_control
pprz_t values[RADIO_CONTROL_NB_CHANNEL]