27 #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 28 #include <nuttx/arch.h> 29 #include <systemlib/systemlib.h> 30 #include <drivers/drv_hrt.h> 31 #elif CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS 42 bool init(
void)
override;
45 bool reset(
void)
override;
48 bool send(
const uint8_t *pkt, uint16_t
len)
override;
60 uint16_t
read(uint8_t
chan)
override;
66 void update(
void)
override;
71 return (uint16_t(
dsm.tx_firmware_year)<<12) + (uint16_t(
dsm.tx_firmware_month)<<8) +
dsm.tx_firmware_day;
117 #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 120 #elif CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS 121 virtual_timer_t timeout_vt;
122 static thread_t *_irq_handler_ctx;
139 #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 142 #elif CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS 143 static void irq_handler_thd(
void* arg);
144 static void trigger_irq_radio_event(
void);
145 static void trigger_timeout_event(
void *arg);
void dsm_set_channel(uint8_t channel, bool is_dsm2, uint8_t sop_col, uint8_t data_col, uint16_t crc_seed)
struct telem_status t_status
void start_recv_bind(void) override
uint8_t last_transmit_power
enum AP_Radio_cypress::@170 state
void send_telem_packet(void)
static const uint8_t max_channels
void send_FCC_test_packet(void)
bool send(const uint8_t *pkt, uint16_t len) override
void write_multiple(uint8_t reg, uint8_t n, const uint8_t *data)
uint32_t telem_send_count
static const uint16_t bind_magic
uint32_t receive_start_us
void save_bind_info(void)
uint32_t last_chan_change_us
uint16_t pwm_channels[max_channels]
uint8_t num_channels(void) override
AP_Radio_cypress(AP_Radio &radio)
void dsm_setup_transfer_dsmx(void)
static AP_Radio_cypress * radio_instance
uint8_t read_register(uint8_t reg)
void set_channel(uint8_t channel)
void handle_data_packet(mavlink_channel_t chan, const mavlink_data96_t &m) override
static const uint8_t pn_bind[]
bool parse_dsm_channels(const uint8_t *data)
static const uint8_t pn_codes[5][9][8]
void transmit16(const uint8_t data[16])
void irq_handler_send(uint8_t tx_status)
uint32_t last_debug_print_ms
static const config cyrf_transfer_config[]
void process_bind(const uint8_t *pkt, uint8_t len)
void check_double_bind(void)
static const config cyrf_bind_config[]
void radio_set_config(const struct config *config, uint8_t size)
uint16_t read(uint8_t chan) override
static const config cyrf_config[]
void print_debug_info(void)
void dsm_choose_channel(void)
struct hrt_call wait_call
void update(void) override
struct AP_Radio_cypress::@171 dsm
uint32_t last_autobind_send
void process_packet(const uint8_t *pkt, uint8_t len)
void setup_timeout(uint32_t timeout_ms)
void load_bind_info(void)
void set_wifi_channel(uint8_t channel)
uint32_t receive_timeout_msec
void write_register(uint8_t reg, uint8_t value)
void force_initial_state(void)
uint32_t get_tx_version(void) override
void dsm_generate_channels_dsmx(uint8_t mfg_id[4], uint8_t channels[23])
AP_HAL::OwnPtr< AP_HAL::SPIDevice > dev
uint8_t read_status_debounced(uint8_t adr)
AP_Radio::stats last_stats
static int irq_timeout_trampoline(int irq, void *context)
struct AP_Radio_cypress::@172 fwupload
void dsm2_start_sync(void)
static int irq_radio_trampoline(int irq, void *context)
bool reset(void) override
void dump_registers(uint8_t n)
uint32_t last_recv_us(void) override
uint8_t current_rf_channel
const AP_Radio::stats & get_stats(void) override
void map_stick_mode(uint16_t *channels)
enum dsm_protocol protocol
uint8_t tx_firmware_month
void irq_handler_recv(uint8_t rx_status)
uint8_t last_data_code[16]