Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / platform / K32W / PlatformManagerImpl.h
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *    Copyright (c) 2020 Nest Labs, Inc.
5  *    All rights reserved.
6  *
7  *    Licensed under the Apache License, Version 2.0 (the "License");
8  *    you may not use this file except in compliance with the License.
9  *    You may obtain a copy of the License at
10  *
11  *        http://www.apache.org/licenses/LICENSE-2.0
12  *
13  *    Unless required by applicable law or agreed to in writing, software
14  *    distributed under the License is distributed on an "AS IS" BASIS,
15  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  *    See the License for the specific language governing permissions and
17  *    limitations under the License.
18  */
19
20 /**
21  *    @file
22  *          Provides an implementation of the PlatformManager object
23  *          for K32W platforms using the NXP SDK.
24  */
25
26 #pragma once
27
28 #include <platform/internal/GenericPlatformManagerImpl_FreeRTOS.h>
29
30 namespace chip {
31 namespace DeviceLayer {
32
33 /**
34  * Concrete implementation of the PlatformManager singleton object for the K32W platform.
35  */
36 class PlatformManagerImpl final : public PlatformManager, public Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>
37 {
38     // Allow the PlatformManager interface class to delegate method calls to
39     // the implementation methods provided by this class.
40     friend PlatformManager;
41
42     // Allow the generic implementation base class to call helper methods on
43     // this class.
44 #ifndef DOXYGEN_SHOULD_SKIP_THIS
45     friend Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>;
46 #endif
47
48 public:
49     // ===== Platform-specific members that may be accessed directly by the application.
50
51     /* none so far */
52
53 private:
54     // ===== Methods that implement the PlatformManager abstract interface.
55
56     CHIP_ERROR _InitChipStack(void);
57
58     // ===== Members for internal use by the following friends.
59
60     friend PlatformManager & PlatformMgr(void);
61     friend PlatformManagerImpl & PlatformMgrImpl(void);
62     friend class Internal::BLEManagerImpl;
63
64     static PlatformManagerImpl sInstance;
65
66     using Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>::PostEventFromISR;
67 };
68
69 /**
70  * Returns the public interface of the PlatformManager singleton object.
71  *
72  * chip applications should use this to access features of the PlatformManager object
73  * that are common to all platforms.
74  */
75 inline PlatformManager & PlatformMgr(void)
76 {
77     return PlatformManagerImpl::sInstance;
78 }
79
80 /**
81  * Returns the platform-specific implementation of the PlatformManager singleton object.
82  *
83  * chip applications can use this to gain access to features of the PlatformManager
84  * that are specific to the K32W platform.
85  */
86 inline PlatformManagerImpl & PlatformMgrImpl(void)
87 {
88     return PlatformManagerImpl::sInstance;
89 }
90
91 } // namespace DeviceLayer
92 } // namespace chip