• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 The Android Open Source Project
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 
17 #ifndef ESE_HW_NXP_PN80T_PLATFORM_H_
18 #define ESE_HW_NXP_PN80T_PLATFORM_H_ 1
19 
20 typedef void *(pn80t_platform_initialize_t)(void *);
21 typedef int (pn80t_platform_release_t)(void *);
22 typedef int (pn80t_platform_toggle_t)(void *, int);
23 typedef int (pn80t_platform_wait_t)(void *, long usec);
24 
25 /* Pn80tPlatform
26  *
27  * Provides the callbacks necessary to interface with the platform, be it the Linux
28  * kernel or a bootloader in pn80t_common.c
29  *
30  * All "required" functions must be provided.
31  * All "optional" functions may be set to NULL.
32  *
33  */
34 struct Pn80tPlatform {
35   /* Required: Initializes the hardware and platform opaque handle. */
36   pn80t_platform_initialize_t *const initialize;
37   /* Required: free memory and release resources as needed. */
38   pn80t_platform_release_t *const release;
39   /* Required: determines eSE specific power. 1 = on, 0 = off. */
40   pn80t_platform_toggle_t *const toggle_reset;  /* ESE_RST or other power control. */
41   /* Optional: determines global NFC power: 1 = on, 0 = off */
42   pn80t_platform_toggle_t *const toggle_ven;  /* NFC_VEN */
43   /* Optional: enables eSE power control via |toggle_reset|. 1 = on, 0 = off */
44   pn80t_platform_toggle_t *const toggle_power_req;  /* SVDD_PWR_REQ */
45   /* Optional: toggles the in bootloader gpio */
46   pn80t_platform_toggle_t *const toggle_bootloader;  /* CLEAR_N */
47   /* Required: provides a usleep() equivalent. */
48   pn80t_platform_wait_t *const wait;
49 };
50 
51 #endif
52