3 * Copyright (c) 2020 Project CHIP Authors
4 * Copyright (c) 2019 Nest Labs, Inc.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 * Provides an implementation of the PlatformManager object
22 * for EFR32 platforms using the Silicon Labs SDK.
27 #include <platform/internal/GenericPlatformManagerImpl_FreeRTOS.h>
30 namespace DeviceLayer {
33 * Concrete implementation of the PlatformManager singleton object for the EFR32 platform.
35 class PlatformManagerImpl final : public PlatformManager, public Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>
37 // Allow the PlatformManager interface class to delegate method calls to
38 // the implementation methods provided by this class.
39 friend PlatformManager;
41 // Allow the generic implementation base class to call helper methods on
43 #ifndef DOXYGEN_SHOULD_SKIP_THIS
44 friend Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>;
48 // ===== Platform-specific members that may be accessed directly by the application.
53 // ===== Methods that implement the PlatformManager abstract interface.
55 CHIP_ERROR _InitChipStack(void);
57 // ===== Members for internal use by the following friends.
59 friend PlatformManager & PlatformMgr(void);
60 friend PlatformManagerImpl & PlatformMgrImpl(void);
61 friend class Internal::BLEManagerImpl;
63 static PlatformManagerImpl sInstance;
65 using Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>::PostEventFromISR;
69 * Returns the public interface of the PlatformManager singleton object.
71 * Chip applications should use this to access features of the PlatformManager object
72 * that are common to all platforms.
74 inline PlatformManager & PlatformMgr(void)
76 return PlatformManagerImpl::sInstance;
80 * Returns the platform-specific implementation of the PlatformManager singleton object.
82 * Chip applications can use this to gain access to features of the PlatformManager
83 * that are specific to the ESP32 platform.
85 inline PlatformManagerImpl & PlatformMgrImpl(void)
87 return PlatformManagerImpl::sInstance;
90 } // namespace DeviceLayer