!35 open source of hisi platform drivers

Merge pull request !35 from NickYang/master
This commit is contained in:
openharmony_ci
2021-04-29 21:26:19 +08:00
committed by Gitee
+10 -1
View File
@@ -41,7 +41,8 @@ struct UartHostMethod {
int32_t (*SetBaud)(struct UartHost *host, uint32_t baudRate);
int32_t (*GetAttribute)(struct UartHost *host, struct UartAttribute *attribute);
int32_t (*SetAttribute)(struct UartHost *host, struct UartAttribute *attribute);
int32_t (*SetTransMode)(struct UartHost *handle, enum UartTransMode mode);
int32_t (*SetTransMode)(struct UartHost *host, enum UartTransMode mode);
int32_t (*pollEvent)(struct UartHost *host, void *filep, void *table);
};
struct UartHost *UartHostCreate(struct HdfDeviceObject *device);
@@ -133,6 +134,14 @@ static inline int32_t UartHostSetTransMode(struct UartHost *host, enum UartTrans
return host->method->SetTransMode(host, mode);
}
static inline int32_t UartHostPollEvent(struct UartHost *host, void *filep, void *table)
{
if (host == NULL || host->method == NULL || host->method->pollEvent == NULL) {
return HDF_ERR_NOT_SUPPORT;
}
return host->method->pollEvent(host, filep, table);
}
#ifdef __cplusplus
#if __cplusplus
}