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
123 pprz_msg_send_IMCU_COMMANDS(&(intermcu.
transport.trans_tx), intermcu.
device,
137 #pragma GCC diagnostic ignored "-Wcast-align"
143 case DL_IMCU_RADIO_COMMANDS: {
147 for (i = 0; i < size; i++) {
158 case DL_IMCU_FBW_STATUS: {
167 #if TELEMETRY_INTERMCU
168 case DL_IMCU_DATALINK: {
177 case DL_IMCU_REMOTE_GPS: {
179 gps_imcu.ecef_pos.x = DL_IMCU_REMOTE_GPS_ecef_x(
imcu_msg_buf);
180 gps_imcu.ecef_pos.y = DL_IMCU_REMOTE_GPS_ecef_y(
imcu_msg_buf);
181 gps_imcu.ecef_pos.z = DL_IMCU_REMOTE_GPS_ecef_z(
imcu_msg_buf);
184 gps_imcu.lla_pos.alt = DL_IMCU_REMOTE_GPS_alt(
imcu_msg_buf);
188 gps_imcu.ecef_vel.x = DL_IMCU_REMOTE_GPS_ecef_xd(
imcu_msg_buf);
189 gps_imcu.ecef_vel.y = DL_IMCU_REMOTE_GPS_ecef_yd(
imcu_msg_buf);
190 gps_imcu.ecef_vel.z = DL_IMCU_REMOTE_GPS_ecef_zd(
imcu_msg_buf);
193 gps_imcu.course = DL_IMCU_REMOTE_GPS_course(
imcu_msg_buf);
194 gps_imcu.gspeed = DL_IMCU_REMOTE_GPS_gspeed(
imcu_msg_buf);
199 gps_imcu.num_sv = DL_IMCU_REMOTE_GPS_numsv(
imcu_msg_buf);
221 #pragma GCC diagnostic pop
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
#define INTERMCU_LOST_CNT
void RadioControlEvent(void(*frame_handler)(void))
static struct fbw_status_t fbw_status
void intermcu_set_enabled(bool value)
struct link_device * device
Device used for communication.
Periodic telemetry system header (includes downlink utility and generated code).
uint8_t cmd_status
Command status information that is transfered (intermcu_cmd_status)
bool autopilot_get_motors_on(void)
get motors status
void telemetry_intermcu_on_msg(uint8_t msg_id, uint8_t *msg, uint8_t size)
#define INTERMCU_SET_CMD_STATUS(_bit)
struct intermcu_t intermcu
Main include for ABI (AirBorneInterface).
void intermcu_periodic(void)
enum intermcu_status status
Status of the INTERMCU.
#define GPS_FIX_3D
3D GPS fix
pprz_t values[RADIO_CONTROL_NB_CHANNEL]
bool msg_available
If we have an InterMCU message.
#define GPS_VALID_COURSE_BIT
uint8_t imcu_msg_buf[128]
The InterMCU message buffer.
bool enabled
If the InterMCU communication is enabled.
No interMCU communication anymore.
static void intermcu_parse_msg(void(*rc_frame_handler)(void))
Interface for electrical status: supply voltage, current, battery status, etc.
data structure for GPS information
The status of autopilot_motors_on.
#define GPS_FIX_NONE
No GPS fix.
Device independent GPS code (interface)
#define GPS_VALID_HMSL_BIT
#define DefaultPeriodic
Set default periodic telemetry.
struct RadioControl radio_control
void intermcu_send_spektrum_bind(void)
struct pprz_transport transport
Transport over communication line (PPRZ)
Rotorcraft Inter-MCU on the autopilot.
static void send_status(struct transport_tx *trans, struct link_device *dev)
volatile uint32_t nb_sec_rem
remainder of seconds since startup in CPU_TICKS
static const struct usb_device_descriptor dev
Core autopilot interface common to all firmwares.
uint8_t time_since_last_frame
Time since last frame.
volatile uint32_t nb_sec
full seconds since startup
#define GPS_VALID_POS_ECEF_BIT
uint8_t time_since_last_frame
#define GPS_VALID_VEL_ECEF_BIT
void intermcu_set_actuators(pprz_t *command_values, uint8_t ap_mode)
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
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.