50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Includes ----------------------------------------------------------------- */
|
|
#include <cmsis_os2.h>
|
|
#include <stdbool.h>
|
|
|
|
#include <component/cmd.h>
|
|
#include "device/device.h"
|
|
|
|
/* Exported constants ------------------------------------------------------- */
|
|
/* Exported macro ----------------------------------------------------------- */
|
|
/* Exported types ----------------------------------------------------------- */
|
|
|
|
typedef struct {
|
|
uint16_t ch_r_x;
|
|
uint16_t ch_r_y;
|
|
uint16_t ch_l_x;
|
|
uint16_t ch_l_y;
|
|
uint8_t sw_l;
|
|
uint8_t sw_r;
|
|
uint16_t x;
|
|
uint16_t y;
|
|
uint16_t z;
|
|
uint8_t press_l;
|
|
uint8_t press_r;
|
|
uint16_t key;
|
|
uint16_t res;
|
|
} DR16_Data_t;
|
|
|
|
typedef struct {
|
|
DR16_Data_t data;
|
|
} DR16_t;
|
|
|
|
/* Exported functions prototypes -------------------------------------------- */
|
|
int8_t DR16_Init(DR16_t *dr16);
|
|
int8_t DR16_Restart(void);
|
|
int8_t DR16_StartDmaRecv(DR16_t *dr16);
|
|
bool DR16_WaitDmaCplt(uint32_t timeout);
|
|
int8_t DR16_ParseData(DR16_t *dr16);
|
|
int8_t DR16_ParseRC(const DR16_t *dr16, CMD_RC_t *rc);
|
|
int8_t DR16_HandleOffline(DR16_t *dr16);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|