M350b版本
This commit is contained in:
@ -52,6 +52,11 @@ typedef void *T_DjiUsbBulkHandle;
|
||||
*/
|
||||
typedef void *T_DjiNetworkHandle;
|
||||
|
||||
/**
|
||||
* @brief Platform handle of i2c device operation.
|
||||
*/
|
||||
typedef void *T_DjiI2cHandle;
|
||||
|
||||
/**
|
||||
* @brief Platform handle of thread task operation.
|
||||
*/
|
||||
@ -104,6 +109,7 @@ typedef enum {
|
||||
typedef enum {
|
||||
DJI_HAL_USB_BULK_NUM_0 = 0,
|
||||
DJI_HAL_USB_BULK_NUM_1,
|
||||
DJI_HAL_USB_BULK_NUM_2,
|
||||
DJI_HAL_USB_BULK_NUM_MAX,
|
||||
} E_DjiHalUsbBulkNum;
|
||||
|
||||
@ -133,6 +139,11 @@ typedef struct {
|
||||
bool isDir;
|
||||
} T_DjiFileInfo;
|
||||
|
||||
typedef struct {
|
||||
uint16_t pid;
|
||||
uint16_t vid;
|
||||
} T_DjiHalUartDeviceInfo;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*UartInit)(E_DjiHalUartNum uartNum, uint32_t baudRate, T_DjiUartHandle *uartHandle);
|
||||
|
||||
@ -143,6 +154,13 @@ typedef struct {
|
||||
T_DjiReturnCode (*UartReadData)(T_DjiUartHandle uartHandle, uint8_t *buf, uint32_t len, uint32_t *realLen);
|
||||
|
||||
T_DjiReturnCode (*UartGetStatus)(E_DjiHalUartNum uartNum, T_DjiUartStatus *status);
|
||||
|
||||
/**
|
||||
* Get the device info of USB uart (virtual com or TTL-To-USB) which directly connected to UAV.
|
||||
* Use for SDK adapter type Eport V2 ribbon cable.
|
||||
* When using other types of interface, it is not necessary to implement this member function.
|
||||
*/
|
||||
T_DjiReturnCode (*UartGetDeviceInfo)(T_DjiHalUartDeviceInfo *deviceInfo);
|
||||
} T_DjiHalUartHandler;
|
||||
|
||||
typedef struct {
|
||||
@ -172,6 +190,11 @@ typedef struct {
|
||||
} usbNetAdapter;
|
||||
} T_DjiHalNetworkDeviceInfo;
|
||||
|
||||
typedef struct {
|
||||
uint32_t i2cSpeed;
|
||||
uint16_t devAddress;
|
||||
} T_DjiHalI2cConfig;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*UsbBulkInit)(T_DjiHalUsbBulkInfo usbBulkInfo, T_DjiUsbBulkHandle *usbBulkHandle);
|
||||
|
||||
@ -194,6 +217,18 @@ typedef struct {
|
||||
T_DjiReturnCode (*NetworkGetDeviceInfo)(T_DjiHalNetworkDeviceInfo *deviceInfo);
|
||||
} T_DjiHalNetworkHandler;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*I2cInit)(T_DjiHalI2cConfig i2cConfig, T_DjiI2cHandle *i2cHandle);
|
||||
|
||||
T_DjiReturnCode (*I2cDeInit)(T_DjiI2cHandle i2cHandle);
|
||||
|
||||
T_DjiReturnCode (*I2cWriteData)(T_DjiI2cHandle i2cHandle, uint16_t devAddress, const uint8_t *buf,
|
||||
uint32_t len, uint32_t *realLen);
|
||||
|
||||
T_DjiReturnCode (*I2cReadData)(T_DjiI2cHandle i2cHandle, uint16_t devAddress, uint8_t *buf,
|
||||
uint32_t len, uint32_t *realLen);
|
||||
} T_DjiHalI2cHandler;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*TaskCreate)(const char *name, void *(*taskFunc)(void *),
|
||||
uint32_t stackSize, void *arg, T_DjiTaskHandle *task);
|
||||
@ -314,11 +349,24 @@ T_DjiReturnCode DjiPlatform_RegHalUsbBulkHandler(const T_DjiHalUsbBulkHandler *h
|
||||
* sure that the feature is available after a successful registration.
|
||||
* @attention The interface needs to be called at the beginning of the application for registration, otherwise, the
|
||||
* subsequent functions will not work properly.
|
||||
* @param osalHandler: pointer to the handler for network handler interfaces by your platform.
|
||||
* @param halNetworkHandler: pointer to the handler for network handler interfaces by your platform.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPlatform_RegHalNetworkHandler(const T_DjiHalNetworkHandler *halNetworkHandler);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for hal i2c master mode interfaces by your platform.
|
||||
* @note It should be noted that the interface in hal is written and tested well. Users need to implement all the
|
||||
* interfaces. Otherwise, the user interface cannot be successfully registered, and then the user interface is registered
|
||||
* through the interface. If the registration fails, it needs to be based on the return code. To judge the problem. Make
|
||||
* sure that the feature is available after a successful registration.
|
||||
* @attention The interface needs to be called at the beginning of the application for registration, otherwise, the
|
||||
* subsequent functions will not work properly.
|
||||
* @param halI2cHandler: pointer to the handler for hal i2c handler interfaces by your platform.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPlatform_RegHalI2cHandler(const T_DjiHalI2cHandler *halI2cHandler);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for osal interfaces by your platform.
|
||||
* @note It should be noted that the interface in osal is written and tested well. Users need to implement all the
|
||||
@ -363,6 +411,12 @@ T_DjiHalUsbBulkHandler *DjiPlatform_GetHalUsbBulkHandler(void);
|
||||
*/
|
||||
T_DjiHalNetworkHandler *DjiPlatform_GetHalNetworkHandler(void);
|
||||
|
||||
/**
|
||||
* @brief Get the handler of i2c interfaces.
|
||||
* @return Pointer to i2c handler.
|
||||
*/
|
||||
T_DjiHalI2cHandler *DjiPlatform_GetHalI2cHandler(void);
|
||||
|
||||
/**
|
||||
* @brief Get the handler of file-system interfaces.
|
||||
* @return Pointer to file-system handler.
|
||||
|
||||
Reference in New Issue
Block a user