#ifndef _R12DS_H
#define _R12DS_H 

#include <cmsis_os2.h>
#include "device.h"
#include "bsp_usart.h"
#include "cmd.h"

#define RC_FRAME_LENGTH 25u


#define RC_CH_VALUE_OFFSET  ((uint16_t)1024)



int8_t R12ds_DMA_Init(uint8_t *rx1_buf, uint8_t *rx2_buf, uint16_t dma_buf_num);

int8_t sbus_to_rc(volatile const uint8_t *sbus_buf,CMD_RC_t *rc_ctrl);


bool_t R12Buf0_WaitDmaCplt(int32_t timeout);


bool_t R12Buf1_WaitDmaCplt(int32_t timeout);

void R12ds_HandleOffline(void);




#endif

