1/******************************************************************************
2 *
3 *  Copyright (C) 1999-2012 Broadcom Corporation
4 *
5 *  Licensed under the Apache License, Version 2.0 (the "License");
6 *  you may not use this file except in compliance with the License.
7 *  You may obtain a copy of the License at:
8 *
9 *  http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *  Unless required by applicable law or agreed to in writing, software
12 *  distributed under the License is distributed on an "AS IS" BASIS,
13 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *  See the License for the specific language governing permissions and
15 *  limitations under the License.
16 *
17 ******************************************************************************/
18#ifndef __CONFIG_H
19#define __CONFIG_H
20
21#ifdef __cplusplus
22extern "C"
23{
24#endif
25
26int GetStrValue(const char* name, char* p_value, unsigned long len);
27int GetNumValue(const char* name, void* p_value, unsigned long len);
28
29#ifdef __cplusplus
30};
31#endif
32
33#define NAME_USE_NXP_P2P_RC_WORKAROUND  "USE_NXP_P2P_RC_WORKAROUND"
34#define NAME_NFA_DM_ENABLE_SLEEP        "NFA_DM_ENABLE_SLEEP"
35#define NAME_ENABLE_BRCM_EXTRAS_API     "ENABLE_BRCM_EXTRAS_API"
36#define NAME_POLLING_TECH_MASK          "POLLING_TECH_MASK"
37#define NAME_REGISTER_VIRTUAL_SE        "REGISTER_VIRTUAL_SE"
38#define NAME_APPL_TRACE_LEVEL           "APPL_TRACE_LEVEL"
39#define NAME_LPTD_CFG                   "LPTD_CFG"
40#define NAME_SCREEN_OFF_POWER_STATE     "SCREEN_OFF_POWER_STATE"
41#define NAME_UICC_IDLE_TIMEOUT          "UICC_IDLE_TIMEOUT"
42#define NAME_PREINIT_DSP_CFG            "PREINIT_DSP_CFG"
43#define NAME_DTA_START_CFG              "DTA_START_CFG"
44#define NAME_TRANSPORT_DRIVER           "TRANSPORT_DRIVER"
45#define NAME_POWER_CONTROL_DRIVER       "POWER_CONTROL_DRIVER"
46#define NAME_PROTOCOL_TRACE_LEVEL       "PROTOCOL_TRACE_LEVEL"
47#define NAME_UART_PORT                  "UART_PORT"
48#define NAME_UART_BAUD                  "UART_BAUD"
49#define NAME_UART_PARITY                "UART_PARITY"
50#define NAME_UART_STOPBITS              "UART_STOPBITS"
51#define NAME_UART_DATABITS              "UART_DATABITS"
52#define NAME_CLIENT_ADDRESS             "BCMI2CNFC_ADDRESS"
53#define NAME_NFA_DM_START_UP_CFG        "NFA_DM_START_UP_CFG"
54#define NAME_NFA_DM_CFG                 "NFA_DM_CFG"
55#define NAME_NFA_DM_LP_CFG              "NFA_DM_LP_CFG"
56#define NAME_LOW_SPEED_TRANSPORT        "LOW_SPEED_TRANSPORT"
57#define NAME_NFC_WAKE_DELAY             "NFC_WAKE_DELAY"
58#define NAME_NFC_WRITE_DELAY            "NFC_WRITE_DELAY"
59#define NAME_PERF_MEASURE_FREQ          "REPORT_PERFORMANCE_MEASURE"
60#define NAME_READ_MULTI_PACKETS         "READ_MULTIPLE_PACKETS"
61#define NAME_POWER_ON_DELAY             "POWER_ON_DELAY"
62#define NAME_PRE_POWER_OFF_DELAY        "PRE_POWER_OFF_DELAY"
63#define NAME_POST_POWER_OFF_DELAY       "POST_POWER_OFF_DELAY"
64#define NAME_NFA_STORAGE                "NFA_STORAGE"
65#define NAME_NFA_DM_START_UP_VSC_CFG    "NFA_DM_START_UP_VSC_CFG"
66#define NAME_UICC_LISTEN_TECH_MASK      "UICC_LISTEN_TECH_MASK"
67#define NAME_SNOOZE_MODE_CFG            "SNOOZE_MODE_CFG"
68#define NAME_XTAL_FREQUENCY             "XTAL_FREQUENCY"
69#define NAME_NFA_DM_DISC_DURATION_POLL  "NFA_DM_DISC_DURATION_POLL"
70#define NAME_AID_FOR_EMPTY_SELECT       "AID_FOR_EMPTY_SELECT"
71
72#define                     LPTD_PARAM_LEN (40)
73
74// default configuration
75#define default_transport       "/dev/bcm2079x"
76#define default_storage_location "/data/nfc"
77
78struct tUART_CONFIG {
79    int     m_iBaudrate;            // 115200
80    int     m_iDatabits;            // 8
81    int     m_iParity;              // 0 - none, 1 = odd, 2 = even
82    int     m_iStopbits;
83};
84
85extern struct tUART_CONFIG  uartConfig;
86#define MAX_CHIPID_LEN  (16)
87void    readOptionalConfig(const char* option);
88
89/* Snooze mode configuration structure */
90typedef struct
91{
92    unsigned char   snooze_mode;            /* Snooze Mode */
93    unsigned char   idle_threshold_dh;      /* Idle Threshold Host */
94    unsigned char   idle_threshold_nfcc;    /* Idle Threshold NFCC   */
95    unsigned char   nfc_wake_active_mode;   /* NFC_LP_ACTIVE_LOW or NFC_LP_ACTIVE_HIGH */
96    unsigned char   dh_wake_active_mode;    /* NFC_LP_ACTIVE_LOW or NFC_LP_ACTIVE_HIGH */
97} tSNOOZE_MODE_CONFIG;
98#endif
99