Home | History | Annotate | Download | only in include
      1 /******************************************************************************
      2  *
      3  *  Copyright (C) 2012-2014 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 
     19 #ifndef NFC_HAL_TARGET_H
     20 #define NFC_HAL_TARGET_H
     21 
     22 #include "data_types.h"
     23 #include "gki.h"
     24 
     25 /****************************************************************************
     26 ** NCI related configuration
     27 ****************************************************************************/
     28 
     29 /* Initial Max Control Packet Payload Size (until receiving payload size in
     30  * INIT_CORE_RSP) */
     31 #ifndef NFC_HAL_NCI_INIT_CTRL_PAYLOAD_SIZE
     32 #define NFC_HAL_NCI_INIT_CTRL_PAYLOAD_SIZE 0xFF
     33 #endif
     34 
     35 /* Number of bytes to reserve in front of NCI messages (e.g. for transport
     36  * header) */
     37 #ifndef NFC_HAL_NCI_MSG_OFFSET_SIZE
     38 #define NFC_HAL_NCI_MSG_OFFSET_SIZE 1
     39 #endif
     40 
     41 /* NFC-WAKE */
     42 #ifndef NFC_HAL_LP_NFC_WAKE_GPIO
     43 #define NFC_HAL_LP_NFC_WAKE_GPIO UPIO_GENERAL3
     44 #endif
     45 
     46 /* NFCC snooze mode idle timeout before deassert NFC_WAKE in ms */
     47 #ifndef NFC_HAL_LP_IDLE_TIMEOUT
     48 #define NFC_HAL_LP_IDLE_TIMEOUT 100
     49 #endif
     50 
     51 /* NFC snooze mode */
     52 #ifndef NFC_HAL_LP_SNOOZE_MODE
     53 #define NFC_HAL_LP_SNOOZE_MODE NFC_HAL_LP_SNOOZE_MODE_UART
     54 #endif
     55 
     56 /* Idle Threshold Host in 100ms unit */
     57 #ifndef NFC_HAL_LP_IDLE_THRESHOLD_HOST
     58 #define NFC_HAL_LP_IDLE_THRESHOLD_HOST 0
     59 #endif
     60 
     61 /* Idle Threshold HC in 100ms unit */
     62 #ifndef NFC_HAL_LP_IDLE_THRESHOLD_HC
     63 #define NFC_HAL_LP_IDLE_THRESHOLD_HC 0
     64 #endif
     65 
     66 /* Default NFCC power-up baud rate */
     67 #ifndef NFC_HAL_DEFAULT_BAUD
     68 #define NFC_HAL_DEFAULT_BAUD USERIAL_BAUD_115200
     69 #endif
     70 
     71 /* time (in ms) between power off and on NFCC */
     72 #ifndef NFC_HAL_POWER_CYCLE_DELAY
     73 #define NFC_HAL_POWER_CYCLE_DELAY 100
     74 #endif
     75 
     76 /* time (in ms) between power off and on NFCC */
     77 #ifndef NFC_HAL_NFCC_ENABLE_TIMEOUT
     78 #define NFC_HAL_NFCC_ENABLE_TIMEOUT 1000
     79 #endif
     80 
     81 #ifndef NFC_HAL_PRM_DEBUG
     82 #define NFC_HAL_PRM_DEBUG TRUE
     83 #endif
     84 
     85 /* max patch data length (Can be overridden by platform for ACL HCI command
     86  * size) */
     87 #ifndef NFC_HAL_PRM_HCD_CMD_MAXLEN
     88 #define NFC_HAL_PRM_HCD_CMD_MAXLEN 250
     89 #endif
     90 
     91 /* Require PreI2C patch by default */
     92 #ifndef NFC_HAL_PRE_I2C_PATCH_INCLUDED
     93 #define NFC_HAL_PRE_I2C_PATCH_INCLUDED TRUE
     94 #endif
     95 
     96 /* over-riden for platforms that have transport packet limitations */
     97 #ifndef NFC_HAL_PRM_MIN_NCI_CMD_PAYLOAD_SIZE
     98 #define NFC_HAL_PRM_MIN_NCI_CMD_PAYLOAD_SIZE (32)
     99 #endif
    100 
    101 /* amount of time to wait for authenticating/committing patch to NVM */
    102 #ifndef NFC_HAL_PRM_COMMIT_DELAY
    103 #define NFC_HAL_PRM_COMMIT_DELAY (30000)
    104 #endif
    105 
    106 /* amount of time to wait after downloading preI2C patch before downloading
    107  * LPM/FPM patch */
    108 #ifndef NFC_HAL_PRM_POST_I2C_FIX_DELAY
    109 #define NFC_HAL_PRM_POST_I2C_FIX_DELAY (200)
    110 #endif
    111 
    112 /* NFCC will respond to more than one technology during listen discovery  */
    113 #ifndef NFC_HAL_DM_MULTI_TECH_RESP
    114 #define NFC_HAL_DM_MULTI_TECH_RESP TRUE
    115 #endif
    116 
    117 /* Data rate for 15693 command/response, it must be same as
    118  * RW_I93_FLAG_DATA_RATE in nfc_target.h */
    119 #define NFC_HAL_I93_FLAG_DATA_RATE_HIGH 0x02
    120 
    121 #ifndef NFC_HAL_I93_FLAG_DATA_RATE
    122 #define NFC_HAL_I93_FLAG_DATA_RATE NFC_HAL_I93_FLAG_DATA_RATE_HIGH
    123 #endif
    124 
    125 /* NFC HAL HCI */
    126 #ifndef NFC_HAL_HCI_INCLUDED
    127 #define NFC_HAL_HCI_INCLUDED TRUE
    128 #endif
    129 
    130 /* Quick Timer */
    131 #ifndef QUICK_TIMER_TICKS_PER_SEC
    132 #define QUICK_TIMER_TICKS_PER_SEC 100 /* 10ms timer */
    133 #endif
    134 
    135 #ifndef NFC_HAL_SHARED_TRANSPORT_ENABLED
    136 #define NFC_HAL_SHARED_TRANSPORT_ENABLED FALSE
    137 #endif
    138 
    139 /* Enable verbose tracing by default */
    140 #ifndef NFC_HAL_TRACE_VERBOSE
    141 #define NFC_HAL_TRACE_VERBOSE TRUE
    142 #endif
    143 
    144 #ifndef NFC_HAL_INITIAL_TRACE_LEVEL
    145 #define NFC_HAL_INITIAL_TRACE_LEVEL 5
    146 #endif
    147 
    148 /* Map NFC serial port to USERIAL_PORT_6 by default */
    149 #ifndef USERIAL_NFC_PORT
    150 #define USERIAL_NFC_PORT (USERIAL_PORT_6)
    151 #endif
    152 
    153 /* Restore NFCC baud rate to default on shutdown if baud rate was updated */
    154 #ifndef NFC_HAL_RESTORE_BAUD_ON_SHUTDOWN
    155 #define NFC_HAL_RESTORE_BAUD_ON_SHUTDOWN TRUE
    156 #endif
    157 
    158 /* Enable protocol tracing by default */
    159 #ifndef NFC_HAL_TRACE_PROTOCOL
    160 #define NFC_HAL_TRACE_PROTOCOL TRUE
    161 #endif
    162 
    163 #endif /* GKI_TARGET_H */
    164