| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2011, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bhab.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/33 $ |
|---|
| 12 | * $brcm_Date: 12/8/11 3:12p $ |
|---|
| 13 | * |
|---|
| 14 | * |
|---|
| 15 | * Revision History: |
|---|
| 16 | * |
|---|
| 17 | * $brcm_Log: /magnum/basemodules/hab/bhab.h $ |
|---|
| 18 | * |
|---|
| 19 | * Hydra_Software_Devel/33 12/8/11 3:12p atanugul |
|---|
| 20 | * SW3128-89: Add PI support for Spectrum Analyzer Data retrieval |
|---|
| 21 | * |
|---|
| 22 | * Hydra_Software_Devel/32 11/9/11 2:57p atanugul |
|---|
| 23 | * SW3128-68: Add BHAB_ReadSlave() and BHAB_ReadSlave() API to 3128 |
|---|
| 24 | * |
|---|
| 25 | * Hydra_Software_Devel/31 11/2/11 4:42p atanugul |
|---|
| 26 | * SW3461-3: Update BHAB_GetApVersion to include familyId, AP major |
|---|
| 27 | * version, minor version and remove script version and configuration |
|---|
| 28 | * version |
|---|
| 29 | * |
|---|
| 30 | * Hydra_Software_Devel/30 10/18/11 3:20p atanugul |
|---|
| 31 | * SW3461-67: change write_len, read_len and command_len in |
|---|
| 32 | * BHAB_SendHabCommand() from type uint8_t to uint16_t |
|---|
| 33 | * |
|---|
| 34 | * Hydra_Software_Devel/29 8/11/11 4:18p enavarro |
|---|
| 35 | * SWSATFE-86: added more BHAB error codes |
|---|
| 36 | * |
|---|
| 37 | * Hydra_Software_Devel/28 8/11/11 10:22a enavarro |
|---|
| 38 | * SWSATFE-86: added AST device to BHAB_DevId list |
|---|
| 39 | * |
|---|
| 40 | * Hydra_Software_Devel/27 8/11/11 9:24a enavarro |
|---|
| 41 | * SW7425-883: added BHAB_DevId for diseqc |
|---|
| 42 | * |
|---|
| 43 | * Hydra_Software_Devel/26 7/28/11 10:03a enavarro |
|---|
| 44 | * SW7425-883: added BHAB_DevId for satellite front end cores |
|---|
| 45 | * |
|---|
| 46 | * Hydra_Software_Devel/25 7/28/11 9:58a enavarro |
|---|
| 47 | * SW7425-883: added interrupt types for satellite front end |
|---|
| 48 | * |
|---|
| 49 | * Hydra_Software_Devel/24 6/30/11 3:58p atanugul |
|---|
| 50 | * SW3128-25: Add BHAB_ReadRegister() and BHAB_WriteRegister() prototypes |
|---|
| 51 | * |
|---|
| 52 | * Hydra_Software_Devel/23 6/20/11 11:46a atanugul |
|---|
| 53 | * SW3461-5: Add LoopThrough Support for 3461 |
|---|
| 54 | * |
|---|
| 55 | * Hydra_Software_Devel/22 6/1/11 3:43p atanugul |
|---|
| 56 | * SW3461-5: Add THD support to 3461 |
|---|
| 57 | * |
|---|
| 58 | * Hydra_Software_Devel/21 5/27/11 4:28p atanugul |
|---|
| 59 | * SW3461-3: Added BHAB_GetConfigSettings() and BHAB_SetConfigSettings() |
|---|
| 60 | * |
|---|
| 61 | * Hydra_Software_Devel/20 5/6/11 3:48p atanugul |
|---|
| 62 | * SW3128-2: Added support to configure TM_MTSIF_CTRL - Transport Control |
|---|
| 63 | * Register for BCM3128 |
|---|
| 64 | * |
|---|
| 65 | * Hydra_Software_Devel/19 4/29/11 10:16a atanugul |
|---|
| 66 | * SW3128-8: Add SPI support for 3128 |
|---|
| 67 | * |
|---|
| 68 | * Hydra_Software_Devel/18 3/28/11 12:13p atanugul |
|---|
| 69 | * SW3128-2: Add Support for 8 cores and code cleanup |
|---|
| 70 | * |
|---|
| 71 | * Hydra_Software_Devel/17 3/16/11 4:52p atanugul |
|---|
| 72 | * SW3128-2: Add Support for BCM3128 |
|---|
| 73 | * |
|---|
| 74 | * Hydra_Software_Devel/16 3/2/11 6:08p atanugul |
|---|
| 75 | * SW3128-2: Add Support for BCM3128 |
|---|
| 76 | * |
|---|
| 77 | * Hydra_Software_Devel/15 2/1/11 5:41p VISHK |
|---|
| 78 | * SW7422-171: Nexus support for the 3128 (8 ADS core + tuner on daughter |
|---|
| 79 | * board) plug on 7422 board Read and write memory modified to 32 bit |
|---|
| 80 | * addressing to support 3128 chipset as it has 32 bit memory addressing. |
|---|
| 81 | * |
|---|
| 82 | * Hydra_Software_Devel/14 12/2/10 7:17p VISHK |
|---|
| 83 | * SW7405-5037: To make the i2c address programmable for the slave |
|---|
| 84 | * device(LNA) of 31xx frontend chip. |
|---|
| 85 | * |
|---|
| 86 | * Hydra_Software_Devel/13 11/2/10 5:59p VISHK |
|---|
| 87 | * SW7420-1020: Request for non-blocking call support in Nexus frontend |
|---|
| 88 | * |
|---|
| 89 | * Hydra_Software_Devel/12 10/21/10 6:48p vishk |
|---|
| 90 | * SW7420-1020: Request for non-blocking call support in Nexus frontend |
|---|
| 91 | * |
|---|
| 92 | * Hydra_Software_Devel/11 7/2/10 4:23p vishk |
|---|
| 93 | * SW7420-873: Add support to inform application to update frontend tuner |
|---|
| 94 | * gain and to inform that there is no signal to tune upon multiple tries |
|---|
| 95 | * to acquire |
|---|
| 96 | * |
|---|
| 97 | * Hydra_Software_Devel/10 6/22/10 6:02p vishk |
|---|
| 98 | * SW7420-839: Add support to program AGC gain to 31xx TNR PI |
|---|
| 99 | * |
|---|
| 100 | * Hydra_Software_Devel/9 10/5/09 10:43a vishk |
|---|
| 101 | * SW7405-2851: 31xx: Add support to configure the Watchdog feature of |
|---|
| 102 | * 31xx. |
|---|
| 103 | * |
|---|
| 104 | * Hydra_Software_Devel/8 5/12/09 10:54a vishk |
|---|
| 105 | * PR 46431: ADS PI: Add support for BCM3117, BCM3114, and BCM3112. |
|---|
| 106 | * PR 46436: AOB PI: Add support for BCM3117 and BCM3114 |
|---|
| 107 | * |
|---|
| 108 | * Hydra_Software_Devel/7 4/10/09 11:51a vishk |
|---|
| 109 | * PR 46431: ADS PI: Add support for BCM3117, BCM3114, and BCM3112. |
|---|
| 110 | * PR 46436: AOB PI: Add support for BCM3117 and BCM3114 |
|---|
| 111 | * |
|---|
| 112 | * Hydra_Software_Devel/6 3/3/09 1:08p vishk |
|---|
| 113 | * PR 46431: ADS PI: Add support for BCM3117, BCM3114, and BCM3112. |
|---|
| 114 | * PR 46436: AOB PI: Add support for BCM3117 and BCM3114 |
|---|
| 115 | * |
|---|
| 116 | * Hydra_Software_Devel/5 1/29/09 7:17p vishk |
|---|
| 117 | * PR 46431: ADS PI: Add support for BCM3117, BCM3114, and BCM3112. |
|---|
| 118 | * PR 46436: AOB PI: Add support for BCM3117 and BCM3114 |
|---|
| 119 | * |
|---|
| 120 | * Removed GetLockStateChangeEventHandle. |
|---|
| 121 | * |
|---|
| 122 | * Hydra_Software_Devel/4 1/17/09 2:37p vishk |
|---|
| 123 | * PR 46431: ADS PI: Add support for BCM3117, BCM3114, and BCM3112. |
|---|
| 124 | * PR 46436: AOB PI: Add support for BCM3117 and BCM3114 |
|---|
| 125 | * |
|---|
| 126 | * Added comment. |
|---|
| 127 | * |
|---|
| 128 | * Hydra_Software_Devel/3 1/16/09 7:12p vishk |
|---|
| 129 | * PR 46431: ADS PI: Add support for BCM3117, BCM3114, and BCM3112. |
|---|
| 130 | * PR 46436: AOB PI: Add support for BCM3117 and BCM3114 |
|---|
| 131 | * |
|---|
| 132 | * Hydra_Software_Devel/2 10/27/08 11:11a gmohile |
|---|
| 133 | * PR 47386 : Add temination byte for send hab command |
|---|
| 134 | * |
|---|
| 135 | * Hydra_Software_Devel/1 10/20/08 2:52p gmohile |
|---|
| 136 | * PR 47386 : Checkin initial version |
|---|
| 137 | * |
|---|
| 138 | ***************************************************************************/ |
|---|
| 139 | |
|---|
| 140 | #ifndef BHAB_H |
|---|
| 141 | #define BHAB_H |
|---|
| 142 | |
|---|
| 143 | #ifdef __cplusplus |
|---|
| 144 | extern "C" { |
|---|
| 145 | #endif |
|---|
| 146 | |
|---|
| 147 | |
|---|
| 148 | #include "berr_ids.h" |
|---|
| 149 | #include "bstd.h" |
|---|
| 150 | #include "bkni.h" |
|---|
| 151 | #include "bkni_multi.h" |
|---|
| 152 | |
|---|
| 153 | |
|---|
| 154 | #define BHAB_CHK_RETCODE(x) \ |
|---|
| 155 | { if ((retCode = (x)) != BERR_SUCCESS) goto done; } |
|---|
| 156 | |
|---|
| 157 | |
|---|
| 158 | /* bit definitions for BHAB_ApStatus */ |
|---|
| 159 | #define BHAB_APSTATUS_RESET 0x00000001 /* AP is in reset state */ |
|---|
| 160 | #define BHAB_APSTATUS_IDLE 0x00000002 /* AP is in idle state */ |
|---|
| 161 | #define BHAB_APSTATUS_RUN 0x00000000 /* AP is running */ |
|---|
| 162 | #define BHAB_APSTATUS_RUN_MASK 0x00000003 /* AP execution state mask */ |
|---|
| 163 | #define BHAB_APSTATUS_HAB_DONE 0x00000400 /* HAB done */ |
|---|
| 164 | #define BHAB_APSTATUS_HAB_ERR 0x00001000 /* HAB access violation */ |
|---|
| 165 | #define BHAB_APSTATUS_MEM_ERR 0x00002000 /* memory access violation */ |
|---|
| 166 | #define BHAB_APSTATUS_IOMB_ERR 0x00004000 /* io_mbox isb transfer error */ |
|---|
| 167 | #define BHAB_APSTATUS_H_ERR 0x00008000 /* host transfer error */ |
|---|
| 168 | #define BHAB_APSTATUS_INIT_DONE 0x00800000 /* AP init done */ |
|---|
| 169 | #define BHAB_APSTATUS_LOCK 0x00400000 /* inband lock status */ |
|---|
| 170 | #define BHAB_APSTATUS_HAB_MASK 0x00800403 /* HAB available condition mask */ |
|---|
| 171 | #define BHAB_APSTATUS_HAB_READY 0x00800400 /* HAB available condition */ |
|---|
| 172 | #define BHAB_APSTATUS_HABCMD_ERR 0x00080000 /* HAB command syntax error */ |
|---|
| 173 | #define BHAB_APSTATUS_AP_ERR 0x00040000 /* internal AP error */ |
|---|
| 174 | |
|---|
| 175 | |
|---|
| 176 | /*************************************************************************** |
|---|
| 177 | Summary: |
|---|
| 178 | BHAB error codes |
|---|
| 179 | |
|---|
| 180 | Description: |
|---|
| 181 | |
|---|
| 182 | See Also: |
|---|
| 183 | |
|---|
| 184 | ****************************************************************************/ |
|---|
| 185 | #define BERR_HAB_ID 61 |
|---|
| 186 | #define BHAB_ERR_AP_FAIL BERR_MAKE_CODE(BERR_HAB_ID, 0) /* This is a BERR_Code to indicate that host was unable to reset/idle/run the AP. */ |
|---|
| 187 | #define BHAB_ERR_HOST_XFER BERR_MAKE_CODE(BERR_HAB_ID, 1) /* This is a BERR_Code to indicate a host transfer error (underrun/overrun). */ |
|---|
| 188 | #define BHAB_ERR_IOMB_XFER BERR_MAKE_CODE(BERR_HAB_ID, 2) /* This is a BERR_Code to indicate an IO Mailbox ISB transfer error. */ |
|---|
| 189 | #define BHAB_ERR_MEMAV BERR_MAKE_CODE(BERR_HAB_ID, 3) /* This is a BERR_Code to indicate a memory access violation. */ |
|---|
| 190 | #define BHAB_ERR_AP_EEPROM BERR_MAKE_CODE(BERR_HAB_ID, 4) /* This is a BERR_Code to indicate no i2c ack from EEPROM. */ |
|---|
| 191 | #define BHAB_ERR_AP_NOT_INIT BERR_MAKE_CODE(BERR_HAB_ID, 5) /* This is a BERR_Code to indicate that the AP has failed to initialize. */ |
|---|
| 192 | #define BHAB_ERR_HABAV BERR_MAKE_CODE(BERR_HAB_ID, 6) /* This is a BERR_Code to indicate an HAB access violation. */ |
|---|
| 193 | #define BHAB_ERR_HAB_NOT_AVAIL BERR_MAKE_CODE(BERR_HAB_ID, 7) /* This is a BERR_Code to indicate that the HAB is busy. */ |
|---|
| 194 | #define BHAB_ERR_HAB_ERR BERR_MAKE_CODE(BERR_HAB_ID, 8) /* This is a BERR_Code to indicate an HAB command format error. */ |
|---|
| 195 | #define BHAB_ERR_HAB_NO_ACK BERR_MAKE_CODE(BERR_HAB_ID, 9) /* This is a BERR_Code to indicate that the HAB command was not processed by AP. */ |
|---|
| 196 | #define BHAB_ERR_HAB_FAIL BERR_MAKE_CODE(BERR_HAB_ID, 10) /* This is a BERR_Code to indicate bad/unexpected HAB data read. */ |
|---|
| 197 | #define BHAB_ERR_AP_HABAV BERR_MAKE_CODE(BERR_HAB_ID, 11) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 198 | #define BHAB_ERR_AP_COPY BERR_MAKE_CODE(BERR_HAB_ID, 12) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 199 | #define BHAB_ERR_AP_IRQ BERR_MAKE_CODE(BERR_HAB_ID, 13) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 200 | #define BHAB_ERR_AP_SCR BERR_MAKE_CODE(BERR_HAB_ID, 14) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 201 | #define BHAB_ERR_AP_ISB BERR_MAKE_CODE(BERR_HAB_ID, 15) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 202 | #define BHAB_ERR_AP_WD BERR_MAKE_CODE(BERR_HAB_ID, 16) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 203 | #define BHAB_ERR_AP_STACK BERR_MAKE_CODE(BERR_HAB_ID, 17) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 204 | #define BHAB_ERR_AP_BSC BERR_MAKE_CODE(BERR_HAB_ID, 18) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 205 | #define BHAB_ERR_IOMB_BUSY BERR_MAKE_CODE(BERR_HAB_ID, 19) /* This is a BERR_Code to indicate the IO MBOX was busy. */ |
|---|
| 206 | #define BHAB_ERR_HAB_TIMEOUT BERR_MAKE_CODE(BERR_HAB_ID, 20) /* This is a BERR_Code to indicate an HAB timeout. */ |
|---|
| 207 | #define BHAB_ERR_AP_UNKNOWN BERR_MAKE_CODE(BERR_HAB_ID, 21) /* This is a BERR_Code to indicate an AP-internal error. */ |
|---|
| 208 | #define BHAB_ERR_MI2C_NO_ACK BERR_MAKE_CODE(BERR_HAB_ID, 22) /* This is a BERR_Code to indicate no ack from i2c slave device (e.g. tuner). */ |
|---|
| 209 | #define BHAB_ERR_HAB_CHECKSUM BERR_MAKE_CODE(BERR_HAB_ID, 23) /* This is a BERR_Code to indicate bad checksum in HAB */ |
|---|
| 210 | #define BHAB_ERR_HAB_BAD_PARAM BERR_MAKE_CODE(BERR_HAB_ID, 24) /* This is a BERR_Code to indicate invalid parameter specified in HAB command */ |
|---|
| 211 | #define BHAB_ERR_HAB_NOT_SUPP BERR_MAKE_CODE(BERR_HAB_ID, 25) /* This is a BERR_Code to indicate AP does not support this HAB command */ |
|---|
| 212 | |
|---|
| 213 | |
|---|
| 214 | /*************************************************************************** |
|---|
| 215 | Summary: |
|---|
| 216 | Enum for HAB interrupt tyes |
|---|
| 217 | |
|---|
| 218 | Description: |
|---|
| 219 | This enum lists the different types of interrupts from the device |
|---|
| 220 | |
|---|
| 221 | See Also: |
|---|
| 222 | None. |
|---|
| 223 | |
|---|
| 224 | ****************************************************************************/ |
|---|
| 225 | typedef enum BHAB_InterruptType{ |
|---|
| 226 | BHAB_Interrupt_eHabDone, |
|---|
| 227 | BHAB_Interrupt_eInitDone, |
|---|
| 228 | BHAB_Interrupt_eLockChange, |
|---|
| 229 | BHAB_Interrupt_eUpdateGain, |
|---|
| 230 | BHAB_Interrupt_eNoSignal, |
|---|
| 231 | BHAB_Interrupt_eQamAsyncStatusReady, |
|---|
| 232 | BHAB_Interrupt_eOobAsyncStatusReady, |
|---|
| 233 | BHAB_Interrupt_eTc2AsyncStatusReady, |
|---|
| 234 | BHAB_Interrupt_eThdAsyncStatusReady, |
|---|
| 235 | BHAB_Interrupt_eFskReady, |
|---|
| 236 | BHAB_Interrupt_eDiseqcDone, |
|---|
| 237 | BHAB_Interrupt_eDiseqcOverVoltage, |
|---|
| 238 | BHAB_Interrupt_eDiseqcUnderVoltage, |
|---|
| 239 | BHAB_Interrupt_eStatus, |
|---|
| 240 | BHAB_Interrupt_ePeakScanDone, |
|---|
| 241 | BHAB_Interrupt_eSpectrumAnalyzerDataReady, |
|---|
| 242 | BHAB_Interrupt_eMax |
|---|
| 243 | } BHAB_InterruptType; |
|---|
| 244 | |
|---|
| 245 | |
|---|
| 246 | typedef enum BHAB_DevId{ |
|---|
| 247 | BHAB_DevId_eADS0 = 0, |
|---|
| 248 | BHAB_DevId_eADS1, |
|---|
| 249 | BHAB_DevId_eADS2, |
|---|
| 250 | BHAB_DevId_eADS3, |
|---|
| 251 | BHAB_DevId_eADS4, |
|---|
| 252 | BHAB_DevId_eADS5, |
|---|
| 253 | BHAB_DevId_eADS6, |
|---|
| 254 | BHAB_DevId_eADS7, |
|---|
| 255 | BHAB_DevId_eAOB0 = 10, |
|---|
| 256 | BHAB_DevId_eAOB1, |
|---|
| 257 | BHAB_DevId_eAUS0 = 20, |
|---|
| 258 | BHAB_DevId_eAUS1, |
|---|
| 259 | BHAB_DevId_eVSB0 = 30, |
|---|
| 260 | BHAB_DevId_eVSB1, |
|---|
| 261 | BHAB_DevId_eTC20 = 40, |
|---|
| 262 | BHAB_DevId_eTC21, |
|---|
| 263 | BHAB_DevId_eTHD0 = 50, |
|---|
| 264 | BHAB_DevId_eTHD1, |
|---|
| 265 | BHAB_DevId_eAST, |
|---|
| 266 | BHAB_DevId_eMax |
|---|
| 267 | }BHAB_DevId; |
|---|
| 268 | |
|---|
| 269 | /*************************************************************************** |
|---|
| 270 | Summary: |
|---|
| 271 | Enumeration for Daisy Chain |
|---|
| 272 | |
|---|
| 273 | Description: |
|---|
| 274 | This enum lists the different types of Daisy Chain outputs from the |
|---|
| 275 | device. |
|---|
| 276 | |
|---|
| 277 | See Also: |
|---|
| 278 | BHAB_GetConfigSettings(), BHAB_SetConfigSettings() |
|---|
| 279 | |
|---|
| 280 | ****************************************************************************/ |
|---|
| 281 | typedef enum BHAB_RfDaisyChain |
|---|
| 282 | { |
|---|
| 283 | BHAB_RfDaisyChain_eOff, /* Daisychaining is tunrned off. */ |
|---|
| 284 | BHAB_RfDaisyChain_eExternalLna, /* Daisychaining through UHF path. This Rf daisychaining path does not use internal LNA. */ |
|---|
| 285 | BHAB_RfDaisyChain_eInternalLna, /* Daisychaining through VHF path. This Rf daisychaining path uses internal LNA. */ |
|---|
| 286 | BHAB_RfDaisyChain_eMax |
|---|
| 287 | } BHAB_RfDaisyChain; |
|---|
| 288 | |
|---|
| 289 | /*************************************************************************** |
|---|
| 290 | Summary: |
|---|
| 291 | The handle for hab module. |
|---|
| 292 | |
|---|
| 293 | Description: |
|---|
| 294 | This is an opaque handle that is used to access HAB. |
|---|
| 295 | |
|---|
| 296 | See Also: |
|---|
| 297 | BHAB_Open() |
|---|
| 298 | |
|---|
| 299 | ****************************************************************************/ |
|---|
| 300 | typedef struct BHAB_P_Handle *BHAB_Handle; |
|---|
| 301 | |
|---|
| 302 | |
|---|
| 303 | /*************************************************************************** |
|---|
| 304 | Summary: |
|---|
| 305 | Typedef for status information |
|---|
| 306 | |
|---|
| 307 | Description: |
|---|
| 308 | This typedef contains AP status information |
|---|
| 309 | |
|---|
| 310 | See Also: |
|---|
| 311 | None. |
|---|
| 312 | |
|---|
| 313 | ****************************************************************************/ |
|---|
| 314 | typedef uint32_t BHAB_ApStatus; |
|---|
| 315 | |
|---|
| 316 | /*************************************************************************** |
|---|
| 317 | Summary: |
|---|
| 318 | |
|---|
| 319 | Description: |
|---|
| 320 | |
|---|
| 321 | See Also: |
|---|
| 322 | |
|---|
| 323 | ****************************************************************************/ |
|---|
| 324 | typedef struct BHAB_NmiGpioSettings |
|---|
| 325 | { |
|---|
| 326 | bool polarity; |
|---|
| 327 | bool enable; |
|---|
| 328 | uint8_t select; |
|---|
| 329 | } BHAB_NmiGpioSettings; |
|---|
| 330 | |
|---|
| 331 | /*************************************************************************** |
|---|
| 332 | Summary: |
|---|
| 333 | |
|---|
| 334 | Description: |
|---|
| 335 | |
|---|
| 336 | See Also: |
|---|
| 337 | |
|---|
| 338 | ****************************************************************************/ |
|---|
| 339 | typedef struct BHAB_WatchDogTimerSettings |
|---|
| 340 | { |
|---|
| 341 | bool start; |
|---|
| 342 | bool oneShot; |
|---|
| 343 | bool nmiMode; |
|---|
| 344 | uint32_t timeout; |
|---|
| 345 | BHAB_NmiGpioSettings clearWatchDog; |
|---|
| 346 | } BHAB_WatchDogTimerSettings; |
|---|
| 347 | |
|---|
| 348 | /*************************************************************************** |
|---|
| 349 | Summary: |
|---|
| 350 | |
|---|
| 351 | Description: |
|---|
| 352 | |
|---|
| 353 | See Also: |
|---|
| 354 | |
|---|
| 355 | ****************************************************************************/ |
|---|
| 356 | typedef struct BHAB_NmiSettings |
|---|
| 357 | { |
|---|
| 358 | BHAB_NmiGpioSettings powerDownDetect; |
|---|
| 359 | BHAB_NmiGpioSettings spare1; |
|---|
| 360 | BHAB_NmiGpioSettings spare2; |
|---|
| 361 | BHAB_NmiGpioSettings nmi; /*Here the polarity is always high. */ |
|---|
| 362 | } BHAB_NmiSettings; |
|---|
| 363 | |
|---|
| 364 | /*************************************************************************** |
|---|
| 365 | Summary: |
|---|
| 366 | Structure to set HAB config settings. |
|---|
| 367 | |
|---|
| 368 | Description: |
|---|
| 369 | Defines the structure to set HAB config settings. |
|---|
| 370 | |
|---|
| 371 | See Also: |
|---|
| 372 | BHAB_GetConfigSettings(), BHAB_SetConfigSettings() |
|---|
| 373 | |
|---|
| 374 | ****************************************************************************/ |
|---|
| 375 | typedef struct BHAB_ConfigSettings |
|---|
| 376 | { |
|---|
| 377 | BHAB_RfDaisyChain daisyChain; /* daisy chain output*/ |
|---|
| 378 | bool enableLoopThrough; |
|---|
| 379 | } BHAB_ConfigSettings; |
|---|
| 380 | |
|---|
| 381 | /*************************************************************************** |
|---|
| 382 | Summary: |
|---|
| 383 | This defines the function prototype that is used for callbacks. |
|---|
| 384 | |
|---|
| 385 | Description: |
|---|
| 386 | None. |
|---|
| 387 | |
|---|
| 388 | See Also: |
|---|
| 389 | None. |
|---|
| 390 | |
|---|
| 391 | ****************************************************************************/ |
|---|
| 392 | typedef BERR_Code (*BHAB_IntCallbackFunc)( void * pParm1, int parm2 ); |
|---|
| 393 | |
|---|
| 394 | |
|---|
| 395 | typedef struct BHAB_Settings BHAB_Settings; |
|---|
| 396 | |
|---|
| 397 | |
|---|
| 398 | /*************************************************************************** |
|---|
| 399 | Summary: |
|---|
| 400 | Structure for API function table |
|---|
| 401 | |
|---|
| 402 | Description: |
|---|
| 403 | This structure contains pointers to all public BHAB functions. |
|---|
| 404 | |
|---|
| 405 | See Also: |
|---|
| 406 | None. |
|---|
| 407 | |
|---|
| 408 | ****************************************************************************/ |
|---|
| 409 | typedef struct BHAB_ApiFuncTable |
|---|
| 410 | { |
|---|
| 411 | BERR_Code (*Open)(BHAB_Handle *, void*, const BHAB_Settings *); |
|---|
| 412 | BERR_Code (*Close)(BHAB_Handle); |
|---|
| 413 | BERR_Code (*InitAp)(BHAB_Handle, const uint8_t *); |
|---|
| 414 | BERR_Code (*GetApStatus)(BHAB_Handle, BHAB_ApStatus *); |
|---|
| 415 | BERR_Code (*GetApVersion)(BHAB_Handle, uint32_t*, uint32_t*, uint16_t*, uint8_t*, uint8_t*); |
|---|
| 416 | BERR_Code (*ReadRegister)(BHAB_Handle, uint32_t, uint32_t*); |
|---|
| 417 | BERR_Code (*WriteRegister)(BHAB_Handle, uint32_t, uint32_t*); |
|---|
| 418 | BERR_Code (*ReadMemory)(BHAB_Handle, uint32_t, uint8_t*, uint32_t); |
|---|
| 419 | BERR_Code (*WriteMemory)(BHAB_Handle, uint32_t, const uint8_t*, uint32_t); |
|---|
| 420 | BERR_Code (*ReadMbox)(BHAB_Handle, uint32_t, uint32_t*); |
|---|
| 421 | BERR_Code (*WriteMbox)(BHAB_Handle, uint32_t, uint32_t*); |
|---|
| 422 | BERR_Code (*HandleInterrupt_isr)(BHAB_Handle); |
|---|
| 423 | BERR_Code (*ProcessInterruptEvent)(BHAB_Handle); |
|---|
| 424 | BERR_Code (*EnableLockInterrupt)(BHAB_Handle, BHAB_DevId, bool); |
|---|
| 425 | BERR_Code (*InstallInterruptCallback)(BHAB_Handle, BHAB_DevId, BHAB_IntCallbackFunc, void *, int); |
|---|
| 426 | BERR_Code (*UnInstallInterruptCallback)(BHAB_Handle, BHAB_DevId); |
|---|
| 427 | BERR_Code (*SendHabCommand)(BHAB_Handle, uint8_t *, uint16_t, uint8_t *, uint16_t, bool, bool, uint16_t); |
|---|
| 428 | BERR_Code (*GetInterruptEventHandle)(BHAB_Handle, BKNI_EventHandle*); |
|---|
| 429 | BERR_Code (*GetWatchDogTimer)(BHAB_Handle, BHAB_WatchDogTimerSettings *); |
|---|
| 430 | BERR_Code (*SetWatchDogTimer)(BHAB_Handle, const BHAB_WatchDogTimerSettings *); |
|---|
| 431 | BERR_Code (*GetNmiConfig)(BHAB_Handle, BHAB_NmiSettings *); |
|---|
| 432 | BERR_Code (*SetNmiConfig)(BHAB_Handle, const BHAB_NmiSettings *); |
|---|
| 433 | BERR_Code (*GetConfigSettings)(BHAB_Handle, BHAB_ConfigSettings *); |
|---|
| 434 | BERR_Code (*SetConfigSettings)(BHAB_Handle, const BHAB_ConfigSettings *); |
|---|
| 435 | BERR_Code (*ReadSlave)(BHAB_Handle, uint8_t, uint32_t, uint32_t *, uint8_t); |
|---|
| 436 | BERR_Code (*WriteSlave)(BHAB_Handle, uint8_t, uint32_t, uint32_t *, uint8_t); |
|---|
| 437 | } BHAB_ApiFuncTable; |
|---|
| 438 | |
|---|
| 439 | |
|---|
| 440 | /*************************************************************************** |
|---|
| 441 | Summary: |
|---|
| 442 | Structure for HAB settings |
|---|
| 443 | |
|---|
| 444 | Description: |
|---|
| 445 | This structure contains the settings for HAB. |
|---|
| 446 | |
|---|
| 447 | See Also: |
|---|
| 448 | None. |
|---|
| 449 | |
|---|
| 450 | ****************************************************************************/ |
|---|
| 451 | struct BHAB_Settings |
|---|
| 452 | { |
|---|
| 453 | uint16_t chipAddr; /* i2c chip address (i2c) */ |
|---|
| 454 | void (*interruptEnableFunc)(bool, void*); /* callback function for enabling/disabling L1 interrupt */ |
|---|
| 455 | void *interruptEnableFuncParam; /* parameter passed to interruptEnableFunc */ |
|---|
| 456 | BHAB_ApiFuncTable api; |
|---|
| 457 | uint8_t slaveChipAddr; /* i2c chip address for the 31xx's i2c slave device */ |
|---|
| 458 | bool isSpi; |
|---|
| 459 | bool isMtsif; |
|---|
| 460 | }; |
|---|
| 461 | |
|---|
| 462 | |
|---|
| 463 | /****************************************************************************** |
|---|
| 464 | Summary: |
|---|
| 465 | Initializes the BHAB API. |
|---|
| 466 | Description: |
|---|
| 467 | This function must be called first to get a BHAB_Handle. This handle is |
|---|
| 468 | used by all other function calls in the BHAB API. |
|---|
| 469 | Returns: |
|---|
| 470 | BERR_Code |
|---|
| 471 | ******************************************************************************/ |
|---|
| 472 | BERR_Code BHAB_Open( |
|---|
| 473 | BHAB_Handle *handle, /* [out] BHAB handle */ |
|---|
| 474 | void *pReg, /* [in] pointer ot i2c or spi handle */ |
|---|
| 475 | const BHAB_Settings *pDefSettings /* [in] Default Settings */ |
|---|
| 476 | ); |
|---|
| 477 | |
|---|
| 478 | |
|---|
| 479 | /****************************************************************************** |
|---|
| 480 | Summary: |
|---|
| 481 | Closes the BHAB API. |
|---|
| 482 | Description: |
|---|
| 483 | This function releases all the resources allocated by BHAB API and disables |
|---|
| 484 | host interrupts. |
|---|
| 485 | Returns: |
|---|
| 486 | BERR_Code |
|---|
| 487 | ******************************************************************************/ |
|---|
| 488 | BERR_Code BHAB_Close( |
|---|
| 489 | BHAB_Handle h /* [in] BHAB handle */ |
|---|
| 490 | ); |
|---|
| 491 | |
|---|
| 492 | |
|---|
| 493 | /****************************************************************************** |
|---|
| 494 | Summary: |
|---|
| 495 | Downloads the microcode and runs the AP. |
|---|
| 496 | Description: |
|---|
| 497 | This function downloads the microcode to the AP RAM and then starts running |
|---|
| 498 | the AP. |
|---|
| 499 | Returns: |
|---|
| 500 | BERR_Code : BERR_SUCCESS = AP is running and successfully initialized |
|---|
| 501 | ******************************************************************************/ |
|---|
| 502 | BERR_Code BHAB_InitAp( |
|---|
| 503 | BHAB_Handle h, /* [in] BHAB handle */ |
|---|
| 504 | const uint8_t *pImage /* [in] pointer to AP microcode image */ |
|---|
| 505 | ); |
|---|
| 506 | |
|---|
| 507 | |
|---|
| 508 | /****************************************************************************** |
|---|
| 509 | Summary: |
|---|
| 510 | Returns AP version information. |
|---|
| 511 | Description: |
|---|
| 512 | This function returns the Family ID, chip ID, chip revision, AP microcode |
|---|
| 513 | version. |
|---|
| 514 | Returns: |
|---|
| 515 | BERR_Code |
|---|
| 516 | ******************************************************************************/ |
|---|
| 517 | BERR_Code BHAB_GetApVersion( |
|---|
| 518 | BHAB_Handle handle, /* [in] BHAB handle */ |
|---|
| 519 | uint32_t *pFamilyId, /* [out] Chip Family id */ |
|---|
| 520 | uint32_t *pChipId, /* [out] chip id */ |
|---|
| 521 | uint16_t *pChipVer, /* [out] chip revision number */ |
|---|
| 522 | uint8_t *pMajApVer, /* [out] AP microcode major version */ |
|---|
| 523 | uint8_t *pMinApVer /* [out] AP microcode minor version */ |
|---|
| 524 | ); |
|---|
| 525 | |
|---|
| 526 | |
|---|
| 527 | /****************************************************************************** |
|---|
| 528 | Summary: |
|---|
| 529 | Reads from an RBUS register. |
|---|
| 530 | Description: |
|---|
| 531 | This function is normally used to read a specific RBUS register. |
|---|
| 532 | Returns: |
|---|
| 533 | BERR_Code |
|---|
| 534 | ******************************************************************************/ |
|---|
| 535 | BERR_Code BHAB_ReadRegister( |
|---|
| 536 | BHAB_Handle handle, /* [in] BHAB handle */ |
|---|
| 537 | uint32_t reg, /* [in] address of register to read */ |
|---|
| 538 | uint32_t *val /* [in] contains data that was read */ |
|---|
| 539 | ); |
|---|
| 540 | |
|---|
| 541 | |
|---|
| 542 | /****************************************************************************** |
|---|
| 543 | Summary: |
|---|
| 544 | Writes to an RBUS register. |
|---|
| 545 | Description: |
|---|
| 546 | This function is normally used to write to a specific RBUS register. |
|---|
| 547 | Returns: |
|---|
| 548 | BERR_Code |
|---|
| 549 | ******************************************************************************/ |
|---|
| 550 | BERR_Code BHAB_WriteRegister( |
|---|
| 551 | BHAB_Handle handle, /* [in] BHAB handle */ |
|---|
| 552 | uint32_t reg, /* [in] address of register to read */ |
|---|
| 553 | uint32_t *val /* [in] contains data that was read */ |
|---|
| 554 | ); |
|---|
| 555 | |
|---|
| 556 | |
|---|
| 557 | /****************************************************************************** |
|---|
| 558 | Summary: |
|---|
| 559 | Reads from the AP RAM/ROM space. |
|---|
| 560 | Description: |
|---|
| 561 | This function is normally used for verifying the contents of the AP RAM |
|---|
| 562 | after microcode download. This function assumes that the AP is already in |
|---|
| 563 | idle or reset state. |
|---|
| 564 | Returns: |
|---|
| 565 | BERR_Code |
|---|
| 566 | ******************************************************************************/ |
|---|
| 567 | BERR_Code BHAB_ReadMemory( |
|---|
| 568 | BHAB_Handle h, /* [in] BHAB PI Handle */ |
|---|
| 569 | uint32_t addr, /* [in] starting address */ |
|---|
| 570 | uint8_t *buf, /* [out] holds the data read */ |
|---|
| 571 | uint32_t n /* [in] number of bytes to read */ |
|---|
| 572 | ); |
|---|
| 573 | |
|---|
| 574 | |
|---|
| 575 | /****************************************************************************** |
|---|
| 576 | Summary: |
|---|
| 577 | Writes to the AP RAM space. |
|---|
| 578 | Description: |
|---|
| 579 | This function is normally used for downloading the microcode. This function |
|---|
| 580 | assumes that the AP is already in idle or reset state. |
|---|
| 581 | Returns: |
|---|
| 582 | BERR_Code |
|---|
| 583 | ******************************************************************************/ |
|---|
| 584 | BERR_Code BHAB_WriteMemory( |
|---|
| 585 | BHAB_Handle handle, /* [in] BHAB PI Handle */ |
|---|
| 586 | uint32_t addr, /* [in] starting address in AP RAM */ |
|---|
| 587 | uint8_t *buf, /* [in] specifies the data to write */ |
|---|
| 588 | uint32_t n /* [in] number of bytes to write */ |
|---|
| 589 | ); |
|---|
| 590 | |
|---|
| 591 | /****************************************************************************** |
|---|
| 592 | Summary: |
|---|
| 593 | Writes to the mailbox space. |
|---|
| 594 | Description: |
|---|
| 595 | Returns: |
|---|
| 596 | BERR_Code |
|---|
| 597 | ******************************************************************************/ |
|---|
| 598 | BERR_Code BHAB_ReadMbox( |
|---|
| 599 | BHAB_Handle handle, /* [in] BHAB PI Handle */ |
|---|
| 600 | uint32_t reg, /* [in] RBUS register address */ |
|---|
| 601 | uint32_t *val /* [out] value read from register */ |
|---|
| 602 | ); |
|---|
| 603 | |
|---|
| 604 | /****************************************************************************** |
|---|
| 605 | Summary: |
|---|
| 606 | Writes to the mailbox space. |
|---|
| 607 | Description: |
|---|
| 608 | Returns: |
|---|
| 609 | BERR_Code |
|---|
| 610 | ******************************************************************************/ |
|---|
| 611 | BERR_Code BHAB_WriteMbox( |
|---|
| 612 | BHAB_Handle handle, /* [in] BHAB PI Handle */ |
|---|
| 613 | uint32_t reg, /* [in] RBUS register address */ |
|---|
| 614 | uint32_t *val /* [in] value to write */ |
|---|
| 615 | ); |
|---|
| 616 | |
|---|
| 617 | /****************************************************************************** |
|---|
| 618 | Summary: |
|---|
| 619 | Handle BHAB interrupts. |
|---|
| 620 | Description: |
|---|
| 621 | This function must be called when the host receives an interrupt from the |
|---|
| 622 | BHAB device. |
|---|
| 623 | Returns: |
|---|
| 624 | BERR_Code |
|---|
| 625 | ******************************************************************************/ |
|---|
| 626 | BERR_Code BHAB_HandleInterrupt_isr( |
|---|
| 627 | BHAB_Handle handle /* [in] BHAB handle */ |
|---|
| 628 | ); |
|---|
| 629 | |
|---|
| 630 | |
|---|
| 631 | /****************************************************************************** |
|---|
| 632 | Summary: |
|---|
| 633 | This function processes BHAB interrupt events. |
|---|
| 634 | Description: |
|---|
| 635 | This function is used for an i2c-controlled BHAB device only. The |
|---|
| 636 | application calls this function when a BHAB interrupt event has been |
|---|
| 637 | signalled. This function will decode the interrupt and set approriate |
|---|
| 638 | events. For memory-mapped BHAB devices, this function will return |
|---|
| 639 | BERR_NOT_SUPPORTED. |
|---|
| 640 | Returns: |
|---|
| 641 | BERR_Code |
|---|
| 642 | ******************************************************************************/ |
|---|
| 643 | BERR_Code BHAB_ProcessInterruptEvent( |
|---|
| 644 | BHAB_Handle handle /* [in] HAB device handle */ |
|---|
| 645 | ); |
|---|
| 646 | |
|---|
| 647 | |
|---|
| 648 | /****************************************************************************** |
|---|
| 649 | Summary: |
|---|
| 650 | Enables/Disables the inband channel lock interrupt. |
|---|
| 651 | Description: |
|---|
| 652 | This function enables or disables an interrupt to be generated upon change |
|---|
| 653 | in inband channel lock status. |
|---|
| 654 | Returns: |
|---|
| 655 | BERR_Code |
|---|
| 656 | ******************************************************************************/ |
|---|
| 657 | BERR_Code BHAB_EnableLockInterrupt( |
|---|
| 658 | BHAB_Handle handle, /* [in] BHAB Handle */ |
|---|
| 659 | BHAB_DevId eDevId, /* [in] Device ID */ |
|---|
| 660 | bool bEnable /* [in] true = enable lock interrupts, false = disables lock interrupts */ |
|---|
| 661 | ); |
|---|
| 662 | |
|---|
| 663 | |
|---|
| 664 | /****************************************************************************** |
|---|
| 665 | Summary: |
|---|
| 666 | Used to install a callback for a given Interrupt. |
|---|
| 667 | Description: |
|---|
| 668 | This function install a callback for an interrupt |
|---|
| 669 | Returns: |
|---|
| 670 | BERR_Code |
|---|
| 671 | ******************************************************************************/ |
|---|
| 672 | BERR_Code BHAB_InstallInterruptCallback( |
|---|
| 673 | BHAB_Handle handle, /* [in] BHAB handle */ |
|---|
| 674 | BHAB_DevId eDevId, /* [in] Device ID */ |
|---|
| 675 | BHAB_IntCallbackFunc fCallBack, /* [in] Callback function pointer */ |
|---|
| 676 | void * pParm1, /* [in] Paramater1 for callback function*/ |
|---|
| 677 | int parm2 /* [in] Paramater2 for callback function*/ |
|---|
| 678 | ); |
|---|
| 679 | |
|---|
| 680 | |
|---|
| 681 | /****************************************************************************** |
|---|
| 682 | Summary: |
|---|
| 683 | Used to uninstall a callback for a given Interrupt. |
|---|
| 684 | Description: |
|---|
| 685 | This function uninstall a callback for an interrupt |
|---|
| 686 | Returns: |
|---|
| 687 | BERR_Code |
|---|
| 688 | ******************************************************************************/ |
|---|
| 689 | BERR_Code BHAB_UnInstallInterruptCallback( |
|---|
| 690 | BHAB_Handle handle, /* [in] BHAB handle */ |
|---|
| 691 | BHAB_DevId eDevId /* [in] Device ID */ |
|---|
| 692 | ); |
|---|
| 693 | |
|---|
| 694 | |
|---|
| 695 | /****************************************************************************** |
|---|
| 696 | Summary: |
|---|
| 697 | This function sends an HAB command. |
|---|
| 698 | Description: |
|---|
| 699 | This function writes a command to the HAB, asserts HABR, waits for the AP to |
|---|
| 700 | release the HAB, then optionally checks for a service acknowlegement from |
|---|
| 701 | the AP. If bCheckForAck is true, then read_len must be greater than 0. |
|---|
| 702 | Returns: |
|---|
| 703 | BERR_Code |
|---|
| 704 | ******************************************************************************/ |
|---|
| 705 | BERR_Code BHAB_SendHabCommand( |
|---|
| 706 | BHAB_Handle h, /* [in] BHAB PI Handle */ |
|---|
| 707 | uint8_t *write_buf, /* [in] specifies the HAB command to send */ |
|---|
| 708 | uint16_t write_len, /* [in] number of bytes of the HAB command to be written using either I2c or SPI. */ |
|---|
| 709 | uint8_t *read_buf, /* [out] holds the data read from the HAB */ |
|---|
| 710 | uint16_t read_len, /* [in] number of bytes to read from the HAB */ |
|---|
| 711 | bool bCheckForAck, /* [in] true = determine if the AP has serviced the command */ |
|---|
| 712 | bool bInsertTermination, /* [in] true = insert termination byte 0x00 in write buffer at read_len position */ |
|---|
| 713 | uint16_t command_len /* [in] Total number of bytes in the HAB command so that the termination byte is inserted at the right HAB location. */ |
|---|
| 714 | ); |
|---|
| 715 | |
|---|
| 716 | |
|---|
| 717 | /****************************************************************************** |
|---|
| 718 | Summary: |
|---|
| 719 | Returns status of the AP. |
|---|
| 720 | Description: |
|---|
| 721 | The state of the AP and the HAB are returned in this function. |
|---|
| 722 | Returns: |
|---|
| 723 | BERR_Code |
|---|
| 724 | ******************************************************************************/ |
|---|
| 725 | BERR_Code BHAB_GetApStatus( |
|---|
| 726 | BHAB_Handle handle, /* [in] HAB device handle */ |
|---|
| 727 | BHAB_ApStatus *pStatus /* [out] AP status */ |
|---|
| 728 | ); |
|---|
| 729 | |
|---|
| 730 | /****************************************************************************** |
|---|
| 731 | Summary: |
|---|
| 732 | Returns status of the AP. |
|---|
| 733 | Description: |
|---|
| 734 | The state of the AP and the HAB are returned in this function. |
|---|
| 735 | Returns: |
|---|
| 736 | BERR_Code |
|---|
| 737 | ******************************************************************************/ |
|---|
| 738 | BERR_Code BHAB_GetInterruptEventHandle( |
|---|
| 739 | BHAB_Handle handle, |
|---|
| 740 | BKNI_EventHandle *event /* [out] Interrupt event handle */ |
|---|
| 741 | ); |
|---|
| 742 | |
|---|
| 743 | /****************************************************************************** |
|---|
| 744 | Summary: |
|---|
| 745 | Gets the watch dog timer configuration. |
|---|
| 746 | |
|---|
| 747 | Description: |
|---|
| 748 | |
|---|
| 749 | Returns: |
|---|
| 750 | BERR_Code |
|---|
| 751 | ******************************************************************************/ |
|---|
| 752 | BERR_Code BHAB_GetWatchDogTimer(BHAB_Handle h, |
|---|
| 753 | BHAB_WatchDogTimerSettings *wdtSettings); |
|---|
| 754 | |
|---|
| 755 | /****************************************************************************** |
|---|
| 756 | Summary: |
|---|
| 757 | Sets the watch dog timer configuration. |
|---|
| 758 | |
|---|
| 759 | Description: |
|---|
| 760 | |
|---|
| 761 | Returns: |
|---|
| 762 | BERR_Code |
|---|
| 763 | ******************************************************************************/ |
|---|
| 764 | BERR_Code BHAB_SetWatchDogTimer(BHAB_Handle h, /* [in] BHAB PI Handle */ |
|---|
| 765 | const BHAB_WatchDogTimerSettings *wdtSettings); |
|---|
| 766 | |
|---|
| 767 | /****************************************************************************** |
|---|
| 768 | Summary: |
|---|
| 769 | Gets the 31xx non maskable interrupt configuration. |
|---|
| 770 | |
|---|
| 771 | Description: |
|---|
| 772 | |
|---|
| 773 | Returns: |
|---|
| 774 | BERR_Code |
|---|
| 775 | ******************************************************************************/ |
|---|
| 776 | BERR_Code BHAB_GetNmiConfig(BHAB_Handle h, /* [in] BHAB PI Handle */ |
|---|
| 777 | BHAB_NmiSettings *nmiSettings); |
|---|
| 778 | |
|---|
| 779 | /****************************************************************************** |
|---|
| 780 | Summary: |
|---|
| 781 | Sets the 31xx non maskable interrupt configuration. |
|---|
| 782 | |
|---|
| 783 | Description: |
|---|
| 784 | |
|---|
| 785 | Returns: |
|---|
| 786 | BERR_Code |
|---|
| 787 | ******************************************************************************/ |
|---|
| 788 | BERR_Code BHAB_SetNmiConfig(BHAB_Handle h, /* [in] BHAB PI Handle */ |
|---|
| 789 | const BHAB_NmiSettings *nmiSettings); |
|---|
| 790 | |
|---|
| 791 | /*************************************************************************** |
|---|
| 792 | Summary: |
|---|
| 793 | This function gets HAB settings. |
|---|
| 794 | |
|---|
| 795 | Description: |
|---|
| 796 | This function returns the current HAB Settings. |
|---|
| 797 | |
|---|
| 798 | Returns: |
|---|
| 799 | TODO: |
|---|
| 800 | |
|---|
| 801 | See Also: |
|---|
| 802 | BHAB_SetConfigSettings() |
|---|
| 803 | |
|---|
| 804 | ****************************************************************************/ |
|---|
| 805 | BERR_Code BHAB_GetConfigSettings( |
|---|
| 806 | BHAB_Handle handle, /* [in] Device handle */ |
|---|
| 807 | BHAB_ConfigSettings *settings /* [out] HAB config settings. */ |
|---|
| 808 | ); |
|---|
| 809 | |
|---|
| 810 | /*************************************************************************** |
|---|
| 811 | Summary: |
|---|
| 812 | This function sets HAB settings. |
|---|
| 813 | |
|---|
| 814 | Description: |
|---|
| 815 | This function sets the current HAB Settings. |
|---|
| 816 | |
|---|
| 817 | Returns: |
|---|
| 818 | TODO: |
|---|
| 819 | |
|---|
| 820 | See Also: |
|---|
| 821 | BHAB_GetConfigSettings() |
|---|
| 822 | ****************************************************************************/ |
|---|
| 823 | BERR_Code BHAB_SetConfigSettings( |
|---|
| 824 | BHAB_Handle handle, /* [in] Device handle */ |
|---|
| 825 | const BHAB_ConfigSettings *settings /* [in] HAB config settings. */ |
|---|
| 826 | ); |
|---|
| 827 | |
|---|
| 828 | /****************************************************************************** |
|---|
| 829 | Summary: |
|---|
| 830 | This function allows the reading from a slave device attached to the demod chip. |
|---|
| 831 | Description: |
|---|
| 832 | |
|---|
| 833 | Returns: |
|---|
| 834 | BERR_Code |
|---|
| 835 | ******************************************************************************/ |
|---|
| 836 | BERR_Code BHAB_ReadSlave( |
|---|
| 837 | BHAB_Handle handle, /* [in] Device channel handle */ |
|---|
| 838 | uint8_t chipAddr, /* [in] chip addr of the i2c slave device */ |
|---|
| 839 | uint32_t subAddr, /* [in] sub addr of the register to read from the slave device */ |
|---|
| 840 | uint32_t *data, /* [out] ptr to the data that we will read from the slave device */ |
|---|
| 841 | uint8_t dataLen /* [in] how many bytes are we going to read?, for 3412 LNA, this should be in multiples of 4-bytes, |
|---|
| 842 | for 3128, dataLen can only be 4 bytes */ |
|---|
| 843 | ); |
|---|
| 844 | |
|---|
| 845 | /****************************************************************************** |
|---|
| 846 | Summary: |
|---|
| 847 | This function allows the writing to a slave device attached to the demod chip. |
|---|
| 848 | Description: |
|---|
| 849 | |
|---|
| 850 | Returns: |
|---|
| 851 | BERR_Code |
|---|
| 852 | ******************************************************************************/ |
|---|
| 853 | BERR_Code BHAB_WriteSlave( |
|---|
| 854 | BHAB_Handle handle, /* [in] Device channel handle */ |
|---|
| 855 | uint8_t chipAddr, /* [in] chip addr of the i2c slave device */ |
|---|
| 856 | uint32_t subAddr, /* [in] sub addr of the register to read from the slave device */ |
|---|
| 857 | uint32_t *data, /* [out] ptr to the data that we will read from the slave device */ |
|---|
| 858 | uint8_t dataLen /* [in] how many bytes are we going to read?, for 3412 LNA, this should be in multiples of 4-bytes, |
|---|
| 859 | for 3128, dataLen can only be 4 bytes */ |
|---|
| 860 | ); |
|---|
| 861 | |
|---|
| 862 | #ifdef __cplusplus |
|---|
| 863 | } |
|---|
| 864 | #endif |
|---|
| 865 | |
|---|
| 866 | |
|---|
| 867 | #endif |
|---|