• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 NXP
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include "phNxpNciHal_PowerTracker.h"
19 
20 typedef NFCSTATUS (*PowerTrackerStartFunc_t)(unsigned long pollDuration);
21 typedef NFCSTATUS (*PowerTrackerStateChangeFunc_t)(RefreshNfccPowerState state);
22 typedef NFCSTATUS (*PowerTrackerStopFunc_t)();
23 
24 /**
25  * Handle to the Power Tracker stack implementation.
26  */
27 typedef struct {
28   // Power data refresh duration
29   unsigned long pollDuration;
30   // Function to start power tracker feature.
31   PowerTrackerStartFunc_t start;
32   // Function to inform state change in system like screen
33   // state change, ulpdet state change.
34   PowerTrackerStateChangeFunc_t stateChange;
35   // Function to stop power tracker feature.
36   PowerTrackerStopFunc_t stop;
37   // power_tracker.so dynamic library handle.
38   void* dlHandle;
39 } PowerTrackerHandle;
40 
41 /*******************************************************************************
42 **
43 ** Function         phNxpNciHal_PowerTrackerInit()
44 **
45 ** Description      Initialize power tracker framework.
46 **
47 ** Parameters       outHandle - Power Tracker Handle
48 ** Returns          NFCSTATUS_SUCCESS if success.
49 **                  NFCSTATUS_FAILURE otherwise
50 *******************************************************************************/
51 NFCSTATUS phNxpNciHal_PowerTrackerInit(PowerTrackerHandle* outHandle);
52 
53 /*******************************************************************************
54 **
55 ** Function         phNxpNciHal_PowerTrackerDeinit()
56 **
57 ** Description      Deinitialize power tracker framework.
58 **
59 ** Parameters       outHandle - Power Tracker Handle
60 ** Returns          NFCSTATUS_SUCCESS if success.
61 **                  NFCSTATUS_FAILURE otherwise
62 *******************************************************************************/
63 
64 NFCSTATUS phNxpNciHal_PowerTrackerDeinit(PowerTrackerHandle* outHandle);
65