28 #include "generated/airframe.h"
30 #define SPEED_NEUTRAL 500
31 #define SPEED_FACTOR 1.0
32 #define TURN_NEUTRAL 500
33 #define TURN_FACTOR 0.5
35 #define SPEED_OF_CMD(_s) ((_s-SPEED_NEUTRAL)*SPEED_FACTOR)
36 #define TURN_OF_CMD(_w) ((_w-TURN_NEUTRAL)*TURN_FACTOR)
40 #define START_BYTE 0x7F
46 } __attribute__((packed)) ;
51 } __attribute__((packed)) ;
58 } __attribute__((packed)) ;
63 } __attribute__((packed)) ;
81 for (
int i = 0; i < len; i++) {
struct ActuatorsOstrich actuators_ostrich
struct SpeedMessage speed_message
static uint16_t turn_cmd_to_msg(uint16_t turn_cmd)
void actuators_ostrich_init()
void actuators_ostrich_periodic()
static uint16_t speed_cmd_to_msg(uint16_t speed_cmd)
struct SpeedMessagePayload data
static struct uart_periph * ostrich_dev
static uint8_t compute_checksum(uint8_t bytes[], int len)
void WEAK uart_put_buffer(struct uart_periph *p, long fd, const uint8_t *data, uint16_t len)
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.