1 /* 2 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef PLATFORM_CORE_H 10 #define PLATFORM_CORE_H 11 12 #include "hdf_base.h" 13 14 #include "platform_log.h" 15 #include "platform_errno.h" 16 #include "platform_event.h" 17 #include "platform_queue.h" 18 #ifndef __USER__ 19 #include "platform_device.h" 20 #include "platform_manager.h" 21 #endif 22 23 #ifdef __cplusplus 24 #if __cplusplus 25 extern "C" { 26 #endif 27 #endif /* __cplusplus */ 28 29 enum PlatformModuleType { 30 PLATFORM_MODULE_GPIO, 31 PLATFORM_MODULE_I2C, 32 PLATFORM_MODULE_SPI, 33 PLATFORM_MODULE_PIN, 34 PLATFORM_MODULE_CLOCK, 35 PLATFORM_MODULE_REGULATOR, 36 PLATFORM_MODULE_MIPI_DSI, 37 PLATFORM_MODULE_MIPI_CSI, 38 PLATFORM_MODULE_UART, 39 PLATFORM_MODULE_SDIO, 40 PLATFORM_MODULE_MDIO, 41 PLATFORM_MODULE_APB, 42 PLATFORM_MODULE_PCIE, 43 PLATFORM_MODULE_PCM, 44 PLATFORM_MODULE_I2S, 45 PLATFORM_MODULE_PWM, 46 PLATFORM_MODULE_DMA, 47 PLATFORM_MODULE_ADC, 48 PLATFORM_MODULE_RTC, 49 PLATFORM_MODULE_WDT, 50 PLATFORM_MODULE_I3C, 51 PLATFORM_MODULE_CAN, 52 PLATFORM_MODULE_HDMI, 53 PLATFORM_MODULE_MMC, 54 PLATFORM_MODULE_MTD, 55 PLATFORM_MODULE_DEFAULT, 56 PLATFORM_MODULE_MAX, 57 }; 58 59 struct PlatformModuleInfo { 60 enum PlatformModuleType moduleType; 61 const char *moduleName; 62 void *priv; 63 }; 64 65 struct PlatformModuleInfo *PlatformModuleInfoGet(enum PlatformModuleType moduleType); 66 int32_t PlatformModuleInfoCount(void); 67 68 void PlatformGlobalLock(void); 69 void PlatformGlobalUnlock(void); 70 71 /* Os adapt */ 72 bool PlatInIrqContext(void); 73 74 #ifdef __cplusplus 75 #if __cplusplus 76 } 77 #endif 78 #endif /* __cplusplus */ 79 80 #endif /* PLATFORM_CORE_H */ 81