1 /****************************************************************************** 2 * Filename: rom.h 3 * 4 * Description: Prototypes for the ROM utility functions. 5 * 6 * Copyright (c) 2015 - 2022, Texas Instruments Incorporated 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions are met: 11 * 12 * 1) Redistributions of source code must retain the above copyright notice, 13 * this list of conditions and the following disclaimer. 14 * 15 * 2) Redistributions in binary form must reproduce the above copyright notice, 16 * this list of conditions and the following disclaimer in the documentation 17 * and/or other materials provided with the distribution. 18 * 19 * 3) Neither the name of the ORGANIZATION nor the names of its contributors may 20 * be used to endorse or promote products derived from this software without 21 * specific prior written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 * POSSIBILITY OF SUCH DAMAGE. 34 * 35 ******************************************************************************/ 36 37 #ifndef __ROM_H__ 38 #define __ROM_H__ 39 40 //***************************************************************************** 41 // 42 // If building with a C++ compiler, make all of the definitions in this header 43 // have a C binding. 44 // 45 //***************************************************************************** 46 #ifdef __cplusplus 47 extern "C" 48 { 49 #endif 50 51 #include "../inc/hw_types.h" 52 53 #ifndef __HAPI_H__ 54 #define __HAPI_H__ 55 56 // Start address of the ROM hard API access table (located after the ROM FW rev field) 57 #define ROM_HAPI_TABLE_ADDR 0x10000048 58 59 // ROM Hard-API function interface types 60 typedef uint32_t (* FPTR_CRC32_T) ( uint8_t* /* pui8Data */,\ 61 uint32_t /* ui32ByteCount */,\ 62 uint32_t /* ui32RepeatCount */); 63 64 typedef uint32_t (* FPTR_GETFLSIZE_T) ( void ); 65 66 typedef uint32_t (* FPTR_GETCHIPID_T) ( void ); 67 68 typedef uint32_t (* FPTR_RESERVED1_T) ( uint32_t ); 69 70 typedef uint32_t (* FPTR_RESERVED2_T) ( void ); 71 72 typedef uint32_t (* FPTR_RESERVED3_T) ( uint8_t* ,\ 73 uint32_t ,\ 74 uint32_t ); 75 76 typedef void (* FPTR_RESETDEV_T) ( void ); 77 78 typedef uint32_t (* FPTR_FLETCHER32_T) ( uint16_t* /* pui16Data */,\ 79 uint16_t /* ui16WordCount */,\ 80 uint16_t /* ui16RepeatCount */); 81 82 typedef uint32_t (* FPTR_MINVAL_T) ( uint32_t* /* ulpDataBuffer */,\ 83 uint32_t /* ui32DataCount */); 84 85 typedef uint32_t (* FPTR_MAXVAL_T) ( uint32_t* /* pui32DataBuffer */,\ 86 uint32_t /* ui32DataCount */); 87 88 typedef uint32_t (* FPTR_MEANVAL_T) ( uint32_t* /* pui32DataBuffer */,\ 89 uint32_t /* ui32DataCount */); 90 91 typedef uint32_t (* FPTR_STDDVAL_T) ( uint32_t* /* pui32DataBuffer */,\ 92 uint32_t /* ui32DataCount */); 93 94 typedef void (* FPTR_HFSOURCESAFESWITCH_T) ( void ); 95 96 typedef void (* FPTR_RESERVED4_T) ( uint32_t ); 97 98 typedef void (* FPTR_RESERVED5_T) ( uint32_t ); 99 100 typedef void (* FPTR_COMPAIN_T) ( uint8_t /* ut8Signal */); 101 102 typedef void (* FPTR_COMPAREF_T) ( uint8_t /* ut8Signal */); 103 104 typedef void (* FPTR_ADCCOMPBIN_T) ( uint8_t /* ut8Signal */); 105 106 typedef void (* FPTR_DACVREF_T) ( uint8_t /* ut8Signal */); 107 108 extern uint32_t MemBusWrkAroundHapiProgramFlash(uint8_t *pui8DataBuffer, 109 uint32_t ui32Address, 110 uint32_t ui32Count); 111 112 extern uint32_t MemBusWrkAroundHapiEraseSector(uint32_t ui32Address); 113 114 // ROM Hard-API access table type 115 typedef struct 116 { 117 FPTR_CRC32_T Crc32; 118 FPTR_GETFLSIZE_T FlashGetSize; 119 FPTR_GETCHIPID_T GetChipId; 120 FPTR_RESERVED1_T ReservedLocation1; 121 FPTR_RESERVED2_T ReservedLocation2; 122 FPTR_RESERVED3_T ReservedLocation3; 123 FPTR_RESETDEV_T ResetDevice; 124 FPTR_FLETCHER32_T Fletcher32; 125 FPTR_MINVAL_T MinValue; 126 FPTR_MAXVAL_T MaxValue; 127 FPTR_MEANVAL_T MeanValue; 128 FPTR_STDDVAL_T StandDeviationValue; 129 FPTR_RESERVED4_T ReservedLocation4; 130 FPTR_RESERVED5_T ReservedLocation5; 131 FPTR_HFSOURCESAFESWITCH_T HFSourceSafeSwitch; 132 FPTR_COMPAIN_T SelectCompAInput; 133 FPTR_COMPAREF_T SelectCompARef; 134 FPTR_ADCCOMPBIN_T SelectADCCompBInput; 135 FPTR_DACVREF_T SelectDACVref; 136 } HARD_API_T; 137 138 // Pointer to the ROM HAPI table 139 #define P_HARD_API ((HARD_API_T*) ROM_HAPI_TABLE_ADDR) 140 141 #define HapiCrc32(a,b,c) P_HARD_API->Crc32(a,b,c) 142 #define HapiGetFlashSize() P_HARD_API->FlashGetSize() 143 #define HapiGetChipId() P_HARD_API->GetChipId() 144 #define HapiSectorErase(a) MemBusWrkAroundHapiEraseSector(a) 145 #define HapiProgramFlash(a,b,c) MemBusWrkAroundHapiProgramFlash(a,b,c) 146 #define HapiResetDevice() P_HARD_API->ResetDevice() 147 #define HapiFletcher32(a,b,c) P_HARD_API->Fletcher32(a,b,c) 148 #define HapiMinValue(a,b) P_HARD_API->MinValue(a,b) 149 #define HapiMaxValue(a,b) P_HARD_API->MaxValue(a,b) 150 #define HapiMeanValue(a,b) P_HARD_API->MeanValue(a,b) 151 #define HapiStandDeviationValue(a,b) P_HARD_API->StandDeviationValue(a,b) 152 #define HapiHFSourceSafeSwitch() P_HARD_API->HFSourceSafeSwitch() 153 #define HapiSelectCompAInput(a) P_HARD_API->SelectCompAInput(a) 154 #define HapiSelectCompARef(a) P_HARD_API->SelectCompARef(a) 155 #define HapiSelectADCCompBInput(a) P_HARD_API->SelectADCCompBInput(a) 156 #define HapiSelectDACVref(a) P_HARD_API->SelectDACVref(a) 157 158 // Defines for input parameter to the HapiSelectCompAInput function. 159 #define COMPA_IN_NC 0x00 160 // Defines used in CC13x0/CC26x0 devices 161 #define COMPA_IN_AUXIO7 0x09 162 #define COMPA_IN_AUXIO6 0x0A 163 #define COMPA_IN_AUXIO5 0x0B 164 #define COMPA_IN_AUXIO4 0x0C 165 #define COMPA_IN_AUXIO3 0x0D 166 #define COMPA_IN_AUXIO2 0x0E 167 #define COMPA_IN_AUXIO1 0x0F 168 #define COMPA_IN_AUXIO0 0x10 169 // Defines used in CC13x2/CC26x2 devices 170 #define COMPA_IN_AUXIO26 COMPA_IN_AUXIO7 171 #define COMPA_IN_AUXIO25 COMPA_IN_AUXIO6 172 #define COMPA_IN_AUXIO24 COMPA_IN_AUXIO5 173 #define COMPA_IN_AUXIO23 COMPA_IN_AUXIO4 174 #define COMPA_IN_AUXIO22 COMPA_IN_AUXIO3 175 #define COMPA_IN_AUXIO21 COMPA_IN_AUXIO2 176 #define COMPA_IN_AUXIO20 COMPA_IN_AUXIO1 177 #define COMPA_IN_AUXIO19 COMPA_IN_AUXIO0 178 179 // Defines for input parameter to the HapiSelectCompARef function. 180 #define COMPA_REF_NC 0x00 181 #define COMPA_REF_DCOUPL 0x01 182 #define COMPA_REF_VSS 0x02 183 #define COMPA_REF_VDDS 0x03 184 #define COMPA_REF_ADCVREFP 0x04 185 // Defines used in CC13x0/CC26x0 devices 186 #define COMPA_REF_AUXIO7 0x09 187 #define COMPA_REF_AUXIO6 0x0A 188 #define COMPA_REF_AUXIO5 0x0B 189 #define COMPA_REF_AUXIO4 0x0C 190 #define COMPA_REF_AUXIO3 0x0D 191 #define COMPA_REF_AUXIO2 0x0E 192 #define COMPA_REF_AUXIO1 0x0F 193 #define COMPA_REF_AUXIO0 0x10 194 // Defines used in CC13x2/CC26x2 devices 195 #define COMPA_REF_AUXIO26 COMPA_REF_AUXIO7 196 #define COMPA_REF_AUXIO25 COMPA_REF_AUXIO6 197 #define COMPA_REF_AUXIO24 COMPA_REF_AUXIO5 198 #define COMPA_REF_AUXIO23 COMPA_REF_AUXIO4 199 #define COMPA_REF_AUXIO22 COMPA_REF_AUXIO3 200 #define COMPA_REF_AUXIO21 COMPA_REF_AUXIO2 201 #define COMPA_REF_AUXIO20 COMPA_REF_AUXIO1 202 #define COMPA_REF_AUXIO19 COMPA_REF_AUXIO0 203 204 // Defines for input parameter to the HapiSelectADCCompBInput function. 205 #define ADC_COMPB_IN_NC 0x00 206 #define ADC_COMPB_IN_DCOUPL 0x03 207 #define ADC_COMPB_IN_VSS 0x04 208 #define ADC_COMPB_IN_VDDS 0x05 209 // Defines used in CC13x0/CC26x0 devices 210 #define ADC_COMPB_IN_AUXIO7 0x09 211 #define ADC_COMPB_IN_AUXIO6 0x0A 212 #define ADC_COMPB_IN_AUXIO5 0x0B 213 #define ADC_COMPB_IN_AUXIO4 0x0C 214 #define ADC_COMPB_IN_AUXIO3 0x0D 215 #define ADC_COMPB_IN_AUXIO2 0x0E 216 #define ADC_COMPB_IN_AUXIO1 0x0F 217 #define ADC_COMPB_IN_AUXIO0 0x10 218 // Defines used in CC13x2/CC26x2 devices 219 #define ADC_COMPB_IN_AUXIO26 ADC_COMPB_IN_AUXIO7 220 #define ADC_COMPB_IN_AUXIO25 ADC_COMPB_IN_AUXIO6 221 #define ADC_COMPB_IN_AUXIO24 ADC_COMPB_IN_AUXIO5 222 #define ADC_COMPB_IN_AUXIO23 ADC_COMPB_IN_AUXIO4 223 #define ADC_COMPB_IN_AUXIO22 ADC_COMPB_IN_AUXIO3 224 #define ADC_COMPB_IN_AUXIO21 ADC_COMPB_IN_AUXIO2 225 #define ADC_COMPB_IN_AUXIO20 ADC_COMPB_IN_AUXIO1 226 #define ADC_COMPB_IN_AUXIO19 ADC_COMPB_IN_AUXIO0 227 228 // Defines for input parameter to the HapiSelectDACVref function. 229 // The define values can not be changed! 230 #define DAC_REF_NC 0x00 231 #define DAC_REF_DCOUPL 0x01 232 #define DAC_REF_VSS 0x02 233 #define DAC_REF_VDDS 0x03 234 235 #endif // __HAPI_H__ 236 237 //***************************************************************************** 238 // 239 // Pointers to the main API tables. 240 // 241 //***************************************************************************** 242 #define ROM_API_TABLE ((uint32_t *) 0x10000180) 243 #define ROM_VERSION (ROM_API_TABLE[0]) 244 245 246 #define ROM_API_AON_EVENT_TABLE ((uint32_t*) (ROM_API_TABLE[1])) 247 #define ROM_API_AON_IOC_TABLE ((uint32_t*) (ROM_API_TABLE[2])) 248 #define ROM_API_AON_RTC_TABLE ((uint32_t*) (ROM_API_TABLE[3])) 249 #define ROM_API_AUX_CTRL_TABLE ((uint32_t*) (ROM_API_TABLE[5])) 250 #define ROM_API_AUX_TDC_TABLE ((uint32_t*) (ROM_API_TABLE[6])) 251 #define ROM_API_DDI_TABLE ((uint32_t*) (ROM_API_TABLE[9])) 252 #define ROM_API_FLASH_TABLE ((uint32_t*) (ROM_API_TABLE[10])) 253 #define ROM_API_I2C_TABLE ((uint32_t*) (ROM_API_TABLE[11])) 254 #define ROM_API_INTERRUPT_TABLE ((uint32_t*) (ROM_API_TABLE[12])) 255 #define ROM_API_IOC_TABLE ((uint32_t*) (ROM_API_TABLE[13])) 256 #define ROM_API_PRCM_TABLE ((uint32_t*) (ROM_API_TABLE[14])) 257 #define ROM_API_SMPH_TABLE ((uint32_t*) (ROM_API_TABLE[15])) 258 #define ROM_API_SSI_TABLE ((uint32_t*) (ROM_API_TABLE[17])) 259 #define ROM_API_TIMER_TABLE ((uint32_t*) (ROM_API_TABLE[18])) 260 #define ROM_API_TRNG_TABLE ((uint32_t*) (ROM_API_TABLE[19])) 261 #define ROM_API_UART_TABLE ((uint32_t*) (ROM_API_TABLE[20])) 262 #define ROM_API_UDMA_TABLE ((uint32_t*) (ROM_API_TABLE[21])) 263 #define ROM_API_VIMS_TABLE ((uint32_t*) (ROM_API_TABLE[22])) 264 #define ROM_API_OSC_TABLE ((uint32_t*) (ROM_API_TABLE[24])) 265 #define ROM_API_AUX_ADC_TABLE ((uint32_t*) (ROM_API_TABLE[25])) 266 #define ROM_API_SYS_CTRL_TABLE ((uint32_t*) (ROM_API_TABLE[26])) 267 #define ROM_API_AON_BATMON_TABLE ((uint32_t*) (ROM_API_TABLE[27])) 268 #define ROM_API_SETUP_ROM_TABLE ((uint32_t*) (ROM_API_TABLE[28])) 269 #define ROM_API_I2S_TABLE ((uint32_t*) (ROM_API_TABLE[29])) 270 #define ROM_API_PWR_CTRL_TABLE ((uint32_t*) (ROM_API_TABLE[30])) 271 #define ROM_API_AES_TABLE ((uint32_t*) (ROM_API_TABLE[31])) 272 #define ROM_API_PKA_TABLE ((uint32_t*) (ROM_API_TABLE[32])) 273 #define ROM_API_SHA2_TABLE ((uint32_t*) (ROM_API_TABLE[33])) 274 275 // AON_EVENT FUNCTIONS 276 #define ROM_AONEventMcuWakeUpSet \ 277 ((void (*)(uint32_t ui32MCUWUEvent, uint32_t ui32EventSrc)) \ 278 ROM_API_AON_EVENT_TABLE[0]) 279 280 #define ROM_AONEventMcuWakeUpGet \ 281 ((uint32_t (*)(uint32_t ui32MCUWUEvent)) \ 282 ROM_API_AON_EVENT_TABLE[1]) 283 284 #define ROM_AONEventMcuSet \ 285 ((void (*)(uint32_t ui32MCUEvent, uint32_t ui32EventSrc)) \ 286 ROM_API_AON_EVENT_TABLE[4]) 287 288 #define ROM_AONEventMcuGet \ 289 ((uint32_t (*)(uint32_t ui32MCUEvent)) \ 290 ROM_API_AON_EVENT_TABLE[5]) 291 292 293 // AON_RTC FUNCTIONS 294 #define ROM_AONRTCCurrent64BitValueGet \ 295 ((uint64_t (*)(void)) \ 296 ROM_API_AON_RTC_TABLE[12]) 297 298 299 // AUX_TDC FUNCTIONS 300 #define ROM_AUXTDCConfigSet \ 301 ((void (*)(uint32_t ui32Base, uint32_t ui32StartCondition, uint32_t ui32StopCondition)) \ 302 ROM_API_AUX_TDC_TABLE[0]) 303 304 #define ROM_AUXTDCMeasurementDone \ 305 ((uint32_t (*)(uint32_t ui32Base)) \ 306 ROM_API_AUX_TDC_TABLE[1]) 307 308 309 // DDI FUNCTIONS 310 #define ROM_DDI16BitWrite \ 311 ((void (*)(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Mask, uint32_t ui32WrData)) \ 312 ROM_API_DDI_TABLE[0]) 313 314 #define ROM_DDI16BitfieldWrite \ 315 ((void (*)(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Mask, uint32_t ui32Shift, uint16_t ui32Data)) \ 316 ROM_API_DDI_TABLE[1]) 317 318 #define ROM_DDI16BitRead \ 319 ((uint16_t (*)(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Mask)) \ 320 ROM_API_DDI_TABLE[2]) 321 322 #define ROM_DDI16BitfieldRead \ 323 ((uint16_t (*)(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Mask, uint32_t ui32Shift)) \ 324 ROM_API_DDI_TABLE[3]) 325 326 #define ROM_DDI32RegWrite \ 327 ((void (*)(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val)) \ 328 ROM_API_DDI_TABLE[4]) 329 330 331 // FLASH FUNCTIONS 332 #define ROM_FlashPowerModeSet \ 333 ((void (*)(uint32_t ui32PowerMode, uint32_t ui32BankGracePeriod, uint32_t ui32PumpGracePeriod)) \ 334 ROM_API_FLASH_TABLE[0]) 335 336 #define ROM_FlashProtectionSet \ 337 ((void (*)(uint32_t ui32SectorAddress, uint32_t ui32ProtectMode)) \ 338 ROM_API_FLASH_TABLE[2]) 339 340 #define ROM_FlashProtectionGet \ 341 ((uint32_t (*)(uint32_t ui32SectorAddress)) \ 342 ROM_API_FLASH_TABLE[3]) 343 344 #define ROM_FlashProtectionSave \ 345 ((uint32_t (*)(uint32_t ui32SectorAddress)) \ 346 ROM_API_FLASH_TABLE[4]) 347 348 #define ROM_FlashEfuseReadRow \ 349 ((bool (*)(uint32_t *pui32EfuseData, uint32_t ui32RowAddress)) \ 350 ROM_API_FLASH_TABLE[8]) 351 352 #define ROM_FlashDisableSectorsForWrite \ 353 ((void (*)(void)) \ 354 ROM_API_FLASH_TABLE[9]) 355 356 357 // I2C FUNCTIONS 358 #define ROM_I2CMasterInitExpClk \ 359 ((void (*)(uint32_t ui32Base, uint32_t ui32I2CClk, bool bFast)) \ 360 ROM_API_I2C_TABLE[0]) 361 362 #define ROM_I2CMasterErr \ 363 ((uint32_t (*)(uint32_t ui32Base)) \ 364 ROM_API_I2C_TABLE[1]) 365 366 367 // INTERRUPT FUNCTIONS 368 #define ROM_IntPriorityGroupingSet \ 369 ((void (*)(uint32_t ui32Bits)) \ 370 ROM_API_INTERRUPT_TABLE[0]) 371 372 #define ROM_IntPriorityGroupingGet \ 373 ((uint32_t (*)(void)) \ 374 ROM_API_INTERRUPT_TABLE[1]) 375 376 #define ROM_IntPrioritySet \ 377 ((void (*)(uint32_t ui32Interrupt, uint8_t ui8Priority)) \ 378 ROM_API_INTERRUPT_TABLE[2]) 379 380 #define ROM_IntPriorityGet \ 381 ((int32_t (*)(uint32_t ui32Interrupt)) \ 382 ROM_API_INTERRUPT_TABLE[3]) 383 384 #define ROM_IntEnable \ 385 ((void (*)(uint32_t ui32Interrupt)) \ 386 ROM_API_INTERRUPT_TABLE[4]) 387 388 #define ROM_IntDisable \ 389 ((void (*)(uint32_t ui32Interrupt)) \ 390 ROM_API_INTERRUPT_TABLE[5]) 391 392 #define ROM_IntPendSet \ 393 ((void (*)(uint32_t ui32Interrupt)) \ 394 ROM_API_INTERRUPT_TABLE[6]) 395 396 #define ROM_IntPendGet \ 397 ((bool (*)(uint32_t ui32Interrupt)) \ 398 ROM_API_INTERRUPT_TABLE[7]) 399 400 #define ROM_IntPendClear \ 401 ((void (*)(uint32_t ui32Interrupt)) \ 402 ROM_API_INTERRUPT_TABLE[8]) 403 404 405 // IOC FUNCTIONS 406 #define ROM_IOCPortConfigureSet \ 407 ((void (*)(uint32_t ui32IOId, uint32_t ui32PortId, uint32_t ui32IOConfig)) \ 408 ROM_API_IOC_TABLE[0]) 409 410 #define ROM_IOCPortConfigureGet \ 411 ((uint32_t (*)(uint32_t ui32IOId)) \ 412 ROM_API_IOC_TABLE[1]) 413 414 #define ROM_IOCIOShutdownSet \ 415 ((void (*)(uint32_t ui32IOId, uint32_t ui32IOShutdown)) \ 416 ROM_API_IOC_TABLE[2]) 417 418 #define ROM_IOCIOModeSet \ 419 ((void (*)(uint32_t ui32IOId, uint32_t ui32IOMode)) \ 420 ROM_API_IOC_TABLE[4]) 421 422 #define ROM_IOCIOIntSet \ 423 ((void (*)(uint32_t ui32IOId, uint32_t ui32Int, uint32_t ui32EdgeDet)) \ 424 ROM_API_IOC_TABLE[5]) 425 426 #define ROM_IOCIOPortPullSet \ 427 ((void (*)(uint32_t ui32IOId, uint32_t ui32Pull)) \ 428 ROM_API_IOC_TABLE[6]) 429 430 #define ROM_IOCIOHystSet \ 431 ((void (*)(uint32_t ui32IOId, uint32_t ui32Hysteresis)) \ 432 ROM_API_IOC_TABLE[7]) 433 434 #define ROM_IOCIOInputSet \ 435 ((void (*)(uint32_t ui32IOId, uint32_t ui32Input)) \ 436 ROM_API_IOC_TABLE[8]) 437 438 #define ROM_IOCIOSlewCtrlSet \ 439 ((void (*)(uint32_t ui32IOId, uint32_t ui32SlewEnable)) \ 440 ROM_API_IOC_TABLE[9]) 441 442 #define ROM_IOCIODrvStrengthSet \ 443 ((void (*)(uint32_t ui32IOId, uint32_t ui32IOCurrent, uint32_t ui32DrvStrength)) \ 444 ROM_API_IOC_TABLE[10]) 445 446 #define ROM_IOCIOPortIdSet \ 447 ((void (*)(uint32_t ui32IOId, uint32_t ui32PortId)) \ 448 ROM_API_IOC_TABLE[11]) 449 450 #define ROM_IOCIntEnable \ 451 ((void (*)(uint32_t ui32IOId)) \ 452 ROM_API_IOC_TABLE[12]) 453 454 #define ROM_IOCIntDisable \ 455 ((void (*)(uint32_t ui32IOId)) \ 456 ROM_API_IOC_TABLE[13]) 457 458 #define ROM_IOCPinTypeGpioInput \ 459 ((void (*)(uint32_t ui32IOId)) \ 460 ROM_API_IOC_TABLE[14]) 461 462 #define ROM_IOCPinTypeGpioOutput \ 463 ((void (*)(uint32_t ui32IOId)) \ 464 ROM_API_IOC_TABLE[15]) 465 466 #define ROM_IOCPinTypeUart \ 467 ((void (*)(uint32_t ui32Base, uint32_t ui32Rx, uint32_t ui32Tx, uint32_t ui32Cts, uint32_t ui32Rts)) \ 468 ROM_API_IOC_TABLE[16]) 469 470 #define ROM_IOCPinTypeSsiMaster \ 471 ((void (*)(uint32_t ui32Base, uint32_t ui32Rx, uint32_t ui32Tx, uint32_t ui32Fss, uint32_t ui32Clk)) \ 472 ROM_API_IOC_TABLE[17]) 473 474 #define ROM_IOCPinTypeSsiSlave \ 475 ((void (*)(uint32_t ui32Base, uint32_t ui32Rx, uint32_t ui32Tx, uint32_t ui32Fss, uint32_t ui32Clk)) \ 476 ROM_API_IOC_TABLE[18]) 477 478 #define ROM_IOCPinTypeI2c \ 479 ((void (*)(uint32_t ui32Base, uint32_t ui32Data, uint32_t ui32Clk)) \ 480 ROM_API_IOC_TABLE[19]) 481 482 #define ROM_IOCPinTypeAux \ 483 ((void (*)(uint32_t ui32IOId)) \ 484 ROM_API_IOC_TABLE[21]) 485 486 487 // PRCM FUNCTIONS 488 #define ROM_PRCMInfClockConfigureSet \ 489 ((void (*)(uint32_t ui32ClkDiv, uint32_t ui32PowerMode)) \ 490 ROM_API_PRCM_TABLE[0]) 491 492 #define ROM_PRCMInfClockConfigureGet \ 493 ((uint32_t (*)(uint32_t ui32PowerMode)) \ 494 ROM_API_PRCM_TABLE[1]) 495 496 #define ROM_PRCMAudioClockConfigSet \ 497 ((void (*)(uint32_t ui32ClkConfig, uint32_t ui32SampleRate)) \ 498 ROM_API_PRCM_TABLE[4]) 499 500 #define ROM_PRCMPowerDomainOn \ 501 ((void (*)(uint32_t ui32Domains)) \ 502 ROM_API_PRCM_TABLE[5]) 503 504 #define ROM_PRCMPowerDomainOff \ 505 ((void (*)(uint32_t ui32Domains)) \ 506 ROM_API_PRCM_TABLE[6]) 507 508 #define ROM_PRCMPeripheralRunEnable \ 509 ((void (*)(uint32_t ui32Peripheral)) \ 510 ROM_API_PRCM_TABLE[7]) 511 512 #define ROM_PRCMPeripheralRunDisable \ 513 ((void (*)(uint32_t ui32Peripheral)) \ 514 ROM_API_PRCM_TABLE[8]) 515 516 #define ROM_PRCMPeripheralSleepEnable \ 517 ((void (*)(uint32_t ui32Peripheral)) \ 518 ROM_API_PRCM_TABLE[9]) 519 520 #define ROM_PRCMPeripheralSleepDisable \ 521 ((void (*)(uint32_t ui32Peripheral)) \ 522 ROM_API_PRCM_TABLE[10]) 523 524 #define ROM_PRCMPeripheralDeepSleepEnable \ 525 ((void (*)(uint32_t ui32Peripheral)) \ 526 ROM_API_PRCM_TABLE[11]) 527 528 #define ROM_PRCMPeripheralDeepSleepDisable \ 529 ((void (*)(uint32_t ui32Peripheral)) \ 530 ROM_API_PRCM_TABLE[12]) 531 532 #define ROM_PRCMDeepSleep \ 533 ((void (*)(void)) \ 534 ROM_API_PRCM_TABLE[14]) 535 536 #define ROM_PRCMAudioClockConfigSetOverride \ 537 ((void (*)(uint32_t ui32ClkConfig, uint32_t ui32MstDiv, uint32_t ui32BitDiv, uint32_t ui32WordDiv)) \ 538 ROM_API_PRCM_TABLE[17]) 539 540 541 // SMPH FUNCTIONS 542 #define ROM_SMPHAcquire \ 543 ((void (*)(uint32_t ui32Semaphore)) \ 544 ROM_API_SMPH_TABLE[0]) 545 546 547 // SSI FUNCTIONS 548 #define ROM_SSIConfigSetExpClk \ 549 ((void (*)(uint32_t ui32Base, uint32_t ui32SSIClk, uint32_t ui32Protocol, uint32_t ui32Mode, uint32_t ui32BitRate, uint32_t ui32DataWidth)) \ 550 ROM_API_SSI_TABLE[0]) 551 552 #define ROM_SSIDataPut \ 553 ((void (*)(uint32_t ui32Base, uint32_t ui32Data)) \ 554 ROM_API_SSI_TABLE[1]) 555 556 #define ROM_SSIDataPutNonBlocking \ 557 ((int32_t (*)(uint32_t ui32Base, uint32_t ui32Data)) \ 558 ROM_API_SSI_TABLE[2]) 559 560 #define ROM_SSIDataGet \ 561 ((void (*)(uint32_t ui32Base, uint32_t *pui32Data)) \ 562 ROM_API_SSI_TABLE[3]) 563 564 #define ROM_SSIDataGetNonBlocking \ 565 ((int32_t (*)(uint32_t ui32Base, uint32_t *pui32Data)) \ 566 ROM_API_SSI_TABLE[4]) 567 568 569 // TIMER FUNCTIONS 570 #define ROM_TimerConfigure \ 571 ((void (*)(uint32_t ui32Base, uint32_t ui32Config)) \ 572 ROM_API_TIMER_TABLE[0]) 573 574 #define ROM_TimerLevelControl \ 575 ((void (*)(uint32_t ui32Base, uint32_t ui32Timer, bool bInvert)) \ 576 ROM_API_TIMER_TABLE[1]) 577 578 #define ROM_TimerStallControl \ 579 ((void (*)(uint32_t ui32Base, uint32_t ui32Timer, bool bStall)) \ 580 ROM_API_TIMER_TABLE[3]) 581 582 #define ROM_TimerWaitOnTriggerControl \ 583 ((void (*)(uint32_t ui32Base, uint32_t ui32Timer, bool bWait)) \ 584 ROM_API_TIMER_TABLE[4]) 585 586 #define ROM_TimerIntervalLoadMode \ 587 ((void (*)(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Mode)) \ 588 ROM_API_TIMER_TABLE[5]) 589 590 #define ROM_TimerMatchUpdateMode \ 591 ((void (*)(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Mode)) \ 592 ROM_API_TIMER_TABLE[6]) 593 594 595 // TRNG FUNCTIONS 596 #define ROM_TRNGConfigure \ 597 ((void (*)(uint32_t ui32MinSamplesPerCycle, uint32_t ui32MaxSamplesPerCycle, uint32_t ui32ClocksPerSample)) \ 598 ROM_API_TRNG_TABLE[0]) 599 600 #define ROM_TRNGNumberGet \ 601 ((uint32_t (*)(uint32_t ui32Word)) \ 602 ROM_API_TRNG_TABLE[1]) 603 604 605 // UART FUNCTIONS 606 #define ROM_UARTFIFOLevelGet \ 607 ((void (*)(uint32_t ui32Base, uint32_t *pui32TxLevel, uint32_t *pui32RxLevel)) \ 608 ROM_API_UART_TABLE[0]) 609 610 #define ROM_UARTConfigSetExpClk \ 611 ((void (*)(uint32_t ui32Base, uint32_t ui32UARTClk, uint32_t ui32Baud, uint32_t ui32Config)) \ 612 ROM_API_UART_TABLE[1]) 613 614 #define ROM_UARTConfigGetExpClk \ 615 ((void (*)(uint32_t ui32Base, uint32_t ui32UARTClk, uint32_t *pui32Baud, uint32_t *pui32Config)) \ 616 ROM_API_UART_TABLE[2]) 617 618 #define ROM_UARTDisable \ 619 ((void (*)(uint32_t ui32Base)) \ 620 ROM_API_UART_TABLE[3]) 621 622 #define ROM_UARTCharGetNonBlocking \ 623 ((int32_t (*)(uint32_t ui32Base)) \ 624 ROM_API_UART_TABLE[4]) 625 626 #define ROM_UARTCharGet \ 627 ((int32_t (*)(uint32_t ui32Base)) \ 628 ROM_API_UART_TABLE[5]) 629 630 #define ROM_UARTCharPutNonBlocking \ 631 ((bool (*)(uint32_t ui32Base, uint8_t ui8Data)) \ 632 ROM_API_UART_TABLE[6]) 633 634 #define ROM_UARTCharPut \ 635 ((void (*)(uint32_t ui32Base, uint8_t ui8Data)) \ 636 ROM_API_UART_TABLE[7]) 637 638 639 // UDMA FUNCTIONS 640 #define ROM_uDMAChannelAttributeEnable \ 641 ((void (*)(uint32_t ui32Base, uint32_t ui32ChannelNum, uint32_t ui32Attr)) \ 642 ROM_API_UDMA_TABLE[0]) 643 644 #define ROM_uDMAChannelAttributeDisable \ 645 ((void (*)(uint32_t ui32Base, uint32_t ui32ChannelNum, uint32_t ui32Attr)) \ 646 ROM_API_UDMA_TABLE[1]) 647 648 #define ROM_uDMAChannelAttributeGet \ 649 ((uint32_t (*)(uint32_t ui32Base, uint32_t ui32ChannelNum)) \ 650 ROM_API_UDMA_TABLE[2]) 651 652 #define ROM_uDMAChannelControlSet \ 653 ((void (*)(uint32_t ui32Base, uint32_t ui32ChannelStructIndex, uint32_t ui32Control)) \ 654 ROM_API_UDMA_TABLE[3]) 655 656 #define ROM_uDMAChannelTransferSet \ 657 ((void (*)(uint32_t ui32Base, uint32_t ui32ChannelStructIndex, uint32_t ui32Mode, void *pvSrcAddr, void *pvDstAddr, uint32_t ui32TransferSize)) \ 658 ROM_API_UDMA_TABLE[4]) 659 660 #define ROM_uDMAChannelScatterGatherSet \ 661 ((void (*)(uint32_t ui32Base, uint32_t ui32ChannelNum, uint32_t ui32TaskCount, void *pvTaskList, uint32_t ui32IsPeriphSG)) \ 662 ROM_API_UDMA_TABLE[5]) 663 664 #define ROM_uDMAChannelSizeGet \ 665 ((uint32_t (*)(uint32_t ui32Base, uint32_t ui32ChannelStructIndex)) \ 666 ROM_API_UDMA_TABLE[6]) 667 668 #define ROM_uDMAChannelModeGet \ 669 ((uint32_t (*)(uint32_t ui32Base, uint32_t ui32ChannelStructIndex)) \ 670 ROM_API_UDMA_TABLE[7]) 671 672 673 // VIMS FUNCTIONS 674 #define ROM_VIMSConfigure \ 675 ((void (*)(uint32_t ui32Base, bool bRoundRobin, bool bPrefetch)) \ 676 ROM_API_VIMS_TABLE[0]) 677 678 #define ROM_VIMSModeSet \ 679 ((void (*)(uint32_t ui32Base, uint32_t ui32Mode)) \ 680 ROM_API_VIMS_TABLE[1]) 681 682 #define ROM_VIMSModeGet \ 683 ((uint32_t (*)(uint32_t ui32Base)) \ 684 ROM_API_VIMS_TABLE[2]) 685 686 #define ROM_VIMSModeSafeSet \ 687 ((void (*)(uint32_t ui32Base, uint32_t ui32NewMode, bool blocking)) \ 688 ROM_API_VIMS_TABLE[3]) 689 690 691 // OSC FUNCTIONS 692 #define ROM_OSCClockSourceGet \ 693 ((uint32_t (*)(uint32_t ui32SrcClk)) \ 694 ROM_API_OSC_TABLE[0]) 695 696 #define ROM_OSCClockSourceSet \ 697 ((void (*)(uint32_t ui32SrcClk, uint32_t ui32Osc)) \ 698 ROM_API_OSC_TABLE[1]) 699 700 #define ROM_OSC_HPOSCRelativeFrequencyOffsetToRFCoreFormatConvert \ 701 ((int16_t (*)(int32_t HPOSC_RelFreqOffset)) \ 702 ROM_API_OSC_TABLE[3]) 703 704 705 // AUX_ADC FUNCTIONS 706 #define ROM_AUXADCAdjustValueForGainAndOffset \ 707 ((int32_t (*)(int32_t adcValue, int32_t gain, int32_t offset)) \ 708 ROM_API_AUX_ADC_TABLE[0]) 709 710 #define ROM_AUXADCDisable \ 711 ((void (*)(void)) \ 712 ROM_API_AUX_ADC_TABLE[1]) 713 714 #define ROM_AUXADCDisableInputScaling \ 715 ((void (*)(void)) \ 716 ROM_API_AUX_ADC_TABLE[2]) 717 718 #define ROM_AUXADCEnableAsync \ 719 ((void (*)(uint32_t refSource, uint32_t trigger)) \ 720 ROM_API_AUX_ADC_TABLE[3]) 721 722 #define ROM_AUXADCEnableSyncNoBugWorkaround \ 723 ((void (*)(uint32_t refSource, uint32_t sampleTime, uint32_t trigger)) \ 724 ROM_API_AUX_ADC_TABLE[4]) 725 726 #define ROM_AUXADCFlushFifo \ 727 ((void (*)(void)) \ 728 ROM_API_AUX_ADC_TABLE[5]) 729 730 #define ROM_AUXADCGetAdjustmentGain \ 731 ((int32_t (*)(uint32_t refSource)) \ 732 ROM_API_AUX_ADC_TABLE[6]) 733 734 #define ROM_AUXADCGetAdjustmentOffset \ 735 ((int32_t (*)(uint32_t refSource)) \ 736 ROM_API_AUX_ADC_TABLE[7]) 737 738 #define ROM_AUXADCMicrovoltsToValue \ 739 ((int32_t (*)(int32_t fixedRefVoltage, int32_t microvolts)) \ 740 ROM_API_AUX_ADC_TABLE[8]) 741 742 #define ROM_AUXADCPopFifo \ 743 ((uint32_t (*)(void)) \ 744 ROM_API_AUX_ADC_TABLE[9]) 745 746 #define ROM_AUXADCReadFifo \ 747 ((uint32_t (*)(void)) \ 748 ROM_API_AUX_ADC_TABLE[10]) 749 750 #define ROM_AUXADCUnadjustValueForGainAndOffset \ 751 ((int32_t (*)(int32_t adcValue, int32_t gain, int32_t offset)) \ 752 ROM_API_AUX_ADC_TABLE[11]) 753 754 #define ROM_AUXADCValueToMicrovolts \ 755 ((int32_t (*)(int32_t fixedRefVoltage, int32_t adcValue)) \ 756 ROM_API_AUX_ADC_TABLE[12]) 757 758 759 // SYS_CTRL FUNCTIONS 760 #define ROM_SysCtrlResetSourceGet \ 761 ((uint32_t (*)(void)) \ 762 ROM_API_SYS_CTRL_TABLE[0]) 763 764 #define ROM_SysCtrl_DCDC_VoltageConditionalControl \ 765 ((void (*)(void)) \ 766 ROM_API_SYS_CTRL_TABLE[1]) 767 768 769 // AON_BATMON FUNCTIONS 770 #define ROM_AONBatMonTemperatureGetDegC \ 771 ((int32_t (*)(void)) \ 772 ROM_API_AON_BATMON_TABLE[0]) 773 774 775 // SETUP_ROM FUNCTIONS 776 #define ROM_SetupAfterColdResetWakeupFromShutDownCfg1 \ 777 ((void (*)(uint32_t ccfg_ModeConfReg)) \ 778 ROM_API_SETUP_ROM_TABLE[0]) 779 780 #define ROM_SetupAfterColdResetWakeupFromShutDownCfg2 \ 781 ((void (*)(uint32_t ui32Fcfg1Revision, uint32_t ccfg_ModeConfReg)) \ 782 ROM_API_SETUP_ROM_TABLE[1]) 783 784 #define ROM_SetupAfterColdResetWakeupFromShutDownCfg3 \ 785 ((void (*)(uint32_t ccfg_ModeConfReg)) \ 786 ROM_API_SETUP_ROM_TABLE[2]) 787 788 #define ROM_SetupGetTrimForAdcShModeEn \ 789 ((uint32_t (*)(uint32_t ui32Fcfg1Revision)) \ 790 ROM_API_SETUP_ROM_TABLE[3]) 791 792 #define ROM_SetupGetTrimForAdcShVbufEn \ 793 ((uint32_t (*)(uint32_t ui32Fcfg1Revision)) \ 794 ROM_API_SETUP_ROM_TABLE[4]) 795 796 #define ROM_SetupGetTrimForAmpcompCtrl \ 797 ((uint32_t (*)(uint32_t ui32Fcfg1Revision)) \ 798 ROM_API_SETUP_ROM_TABLE[5]) 799 800 #define ROM_SetupGetTrimForAmpcompTh1 \ 801 ((uint32_t (*)(void)) \ 802 ROM_API_SETUP_ROM_TABLE[6]) 803 804 #define ROM_SetupGetTrimForAmpcompTh2 \ 805 ((uint32_t (*)(void)) \ 806 ROM_API_SETUP_ROM_TABLE[7]) 807 808 #define ROM_SetupGetTrimForAnabypassValue1 \ 809 ((uint32_t (*)(uint32_t ccfg_ModeConfReg)) \ 810 ROM_API_SETUP_ROM_TABLE[8]) 811 812 #define ROM_SetupGetTrimForDblrLoopFilterResetVoltage \ 813 ((uint32_t (*)(uint32_t ui32Fcfg1Revision)) \ 814 ROM_API_SETUP_ROM_TABLE[9]) 815 816 #define ROM_SetupGetTrimForRadcExtCfg \ 817 ((uint32_t (*)(uint32_t ui32Fcfg1Revision)) \ 818 ROM_API_SETUP_ROM_TABLE[10]) 819 820 #define ROM_SetupGetTrimForRcOscLfIBiasTrim \ 821 ((uint32_t (*)(uint32_t ui32Fcfg1Revision)) \ 822 ROM_API_SETUP_ROM_TABLE[11]) 823 824 #define ROM_SetupGetTrimForRcOscLfRtuneCtuneTrim \ 825 ((uint32_t (*)(void)) \ 826 ROM_API_SETUP_ROM_TABLE[12]) 827 828 #define ROM_SetupGetTrimForXoscHfCtl \ 829 ((uint32_t (*)(uint32_t ui32Fcfg1Revision)) \ 830 ROM_API_SETUP_ROM_TABLE[13]) 831 832 #define ROM_SetupGetTrimForXoscHfFastStart \ 833 ((uint32_t (*)(void)) \ 834 ROM_API_SETUP_ROM_TABLE[14]) 835 836 #define ROM_SetupGetTrimForXoscHfIbiastherm \ 837 ((uint32_t (*)(void)) \ 838 ROM_API_SETUP_ROM_TABLE[15]) 839 840 #define ROM_SetupGetTrimForXoscLfRegulatorAndCmirrwrRatio \ 841 ((uint32_t (*)(uint32_t ui32Fcfg1Revision)) \ 842 ROM_API_SETUP_ROM_TABLE[16]) 843 844 #define ROM_SetupSetAonRtcSubSecInc \ 845 ((void (*)(uint32_t subSecInc)) \ 846 ROM_API_SETUP_ROM_TABLE[17]) 847 848 #define ROM_SetupSetCacheModeAccordingToCcfgSetting \ 849 ((void (*)(void)) \ 850 ROM_API_SETUP_ROM_TABLE[18]) 851 852 #define ROM_SetupStepVddrTrimTo \ 853 ((void (*)(uint32_t toCode)) \ 854 ROM_API_SETUP_ROM_TABLE[19]) 855 856 857 // I2S FUNCTIONS 858 #define ROM_I2SPointerSet \ 859 ((void (*)(uint32_t ui32Base, bool bInput, void * pNextPointer)) \ 860 ROM_API_I2S_TABLE[0]) 861 862 #define ROM_I2SSampleStampGet \ 863 ((uint32_t (*)(uint32_t ui32Base, uint32_t ui32Channel)) \ 864 ROM_API_I2S_TABLE[1]) 865 866 867 // PWR_CTRL FUNCTIONS 868 #define ROM_PowerCtrlSourceSet \ 869 ((void (*)(uint32_t ui32PowerConfig)) \ 870 ROM_API_PWR_CTRL_TABLE[0]) 871 872 873 // AES FUNCTIONS 874 #define ROM_AESConfigureCCMCtrl \ 875 ((void (*)(uint32_t nonceLength, uint32_t macLength, bool encrypt)) \ 876 ROM_API_AES_TABLE[0]) 877 878 #define ROM_AESReadFromKeyStore \ 879 ((uint32_t (*)(uint32_t keyStoreArea)) \ 880 ROM_API_AES_TABLE[1]) 881 882 #define ROM_AESReadTag \ 883 ((uint32_t (*)(uint8_t *tag, uint32_t tagLength)) \ 884 ROM_API_AES_TABLE[2]) 885 886 #define ROM_AESSetInitializationVector \ 887 ((void (*)(const uint32_t *initializationVector)) \ 888 ROM_API_AES_TABLE[3]) 889 890 #define ROM_AESStartDMAOperation \ 891 ((void (*)(const uint8_t *channel0Addr, uint32_t channel0Length, uint8_t *channel1Addr, uint32_t channel1Length)) \ 892 ROM_API_AES_TABLE[4]) 893 894 #define ROM_AESVerifyTag \ 895 ((uint32_t (*)(const uint8_t *tag, uint32_t tagLength)) \ 896 ROM_API_AES_TABLE[5]) 897 898 #define ROM_AESWaitForIRQFlags \ 899 ((uint32_t (*)(uint32_t irqFlags)) \ 900 ROM_API_AES_TABLE[6]) 901 902 #define ROM_AESWriteCCMInitializationVector \ 903 ((void (*)(const uint8_t *nonce, uint32_t nonceLength)) \ 904 ROM_API_AES_TABLE[7]) 905 906 907 // PKA FUNCTIONS 908 #define ROM_PKABigNumAddGetResult \ 909 ((uint32_t (*)(uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)) \ 910 ROM_API_PKA_TABLE[0]) 911 912 #define ROM_PKABigNumCmpGetResult \ 913 ((uint32_t (*)(void)) \ 914 ROM_API_PKA_TABLE[1]) 915 916 #define ROM_PKABigNumInvModGetResult \ 917 ((uint32_t (*)(uint8_t *resultBuf, uint32_t length, uint32_t resultPKAMemAddr)) \ 918 ROM_API_PKA_TABLE[2]) 919 920 #define ROM_PKABigNumModGetResult \ 921 ((uint32_t (*)(uint8_t *resultBuf, uint32_t length, uint32_t resultPKAMemAddr)) \ 922 ROM_API_PKA_TABLE[3]) 923 924 #define ROM_PKABigNumMultGetResult \ 925 ((uint32_t (*)(uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)) \ 926 ROM_API_PKA_TABLE[4]) 927 928 #define ROM_PKAEccAddGetResult \ 929 ((uint32_t (*)(uint8_t *curvePointX, uint8_t *curvePointY, uint32_t resultPKAMemAddr, uint32_t length)) \ 930 ROM_API_PKA_TABLE[5]) 931 932 #define ROM_PKAEccAddStart \ 933 ((uint32_t (*)(const uint8_t *curvePoint1X, const uint8_t *curvePoint1Y, const uint8_t *curvePoint2X, const uint8_t *curvePoint2Y, const uint8_t *prime, const uint8_t *a, uint32_t length, uint32_t *resultPKAMemAddr)) \ 934 ROM_API_PKA_TABLE[6]) 935 936 #define ROM_PKAEccMultiplyGetResult \ 937 ((uint32_t (*)(uint8_t *curvePointX, uint8_t *curvePointY, uint32_t resultPKAMemAddr, uint32_t length)) \ 938 ROM_API_PKA_TABLE[7]) 939 940 #define ROM_PKAEccMultiplyStart \ 941 ((uint32_t (*)(const uint8_t *scalar, const uint8_t *curvePointX, const uint8_t *curvePointY, const uint8_t *prime, const uint8_t *a, const uint8_t *b, uint32_t length, uint32_t *resultPKAMemAddr)) \ 942 ROM_API_PKA_TABLE[8]) 943 944 #define ROM_PKAGetOpsStatus \ 945 ((uint32_t (*)(void)) \ 946 ROM_API_PKA_TABLE[9]) 947 948 #define ROM_PKABigNumAddStart \ 949 ((uint32_t (*)(const uint8_t *bigNum1, uint32_t bigNum1Length, const uint8_t *bigNum2, uint32_t bigNum2Length, uint32_t *resultPKAMemAddr)) \ 950 ROM_API_PKA_TABLE[10]) 951 952 #define ROM_PKABigNumCmpStart \ 953 ((uint32_t (*)(const uint8_t *bigNum1, const uint8_t *bigNum2, uint32_t length)) \ 954 ROM_API_PKA_TABLE[11]) 955 956 #define ROM_PKABigNumInvModStart \ 957 ((uint32_t (*)(const uint8_t *bigNum, uint32_t bigNumLength, const uint8_t *modulus, uint32_t modulusLength, uint32_t *resultPKAMemAddr)) \ 958 ROM_API_PKA_TABLE[12]) 959 960 #define ROM_PKABigNumModStart \ 961 ((uint32_t (*)(const uint8_t *bigNum, uint32_t bigNumLength, const uint8_t *modulus, uint32_t modulusLength, uint32_t *resultPKAMemAddr)) \ 962 ROM_API_PKA_TABLE[13]) 963 964 #define ROM_PKABigNumMultiplyStart \ 965 ((uint32_t (*)(const uint8_t *multiplicand, uint32_t multiplicandLength, const uint8_t *multiplier, uint32_t multiplierLength, uint32_t *resultPKAMemAddr)) \ 966 ROM_API_PKA_TABLE[14]) 967 968 #define ROM_PKABigNumSubGetResult \ 969 ((uint32_t (*)(uint8_t *resultBuf, uint32_t *resultLength, uint32_t resultPKAMemAddr)) \ 970 ROM_API_PKA_TABLE[15]) 971 972 #define ROM_PKABigNumSubStart \ 973 ((uint32_t (*)(const uint8_t *minuend, uint32_t minuendLength, const uint8_t *subtrahend, uint32_t subtrahendLength, uint32_t *resultPKAMemAddr)) \ 974 ROM_API_PKA_TABLE[16]) 975 976 #define ROM_PKAArrayAllZeros \ 977 ((bool (*)(const uint8_t *array, uint32_t arrayLength)) \ 978 ROM_API_PKA_TABLE[17]) 979 980 #define ROM_PKABigNumDivideGetQuotient \ 981 ((uint32_t (*)(uint8_t *resultBuf, uint32_t *length, uint32_t resultQuotientMemAddr)) \ 982 ROM_API_PKA_TABLE[18]) 983 984 #define ROM_PKABigNumDivideGetRemainder \ 985 ((uint32_t (*)(uint8_t *resultBuf, uint32_t *length, uint32_t resultRemainderMemAddr)) \ 986 ROM_API_PKA_TABLE[19]) 987 988 #define ROM_PKABigNumDivideStart \ 989 ((uint32_t (*)(const uint8_t *dividend, uint32_t dividendLength, const uint8_t *divisor, uint32_t divisorLength, uint32_t *resultQuotientMemAddr, uint32_t *resultRemainderMemAddr)) \ 990 ROM_API_PKA_TABLE[20]) 991 992 #define ROM_PKAEccVerifyPublicKeyWeierstrassStart \ 993 ((uint32_t (*)(const uint8_t *curvePointX, const uint8_t *curvePointY, const uint8_t *prime, const uint8_t *a, const uint8_t *b, const uint8_t *order, uint32_t length)) \ 994 ROM_API_PKA_TABLE[21]) 995 996 #define ROM_PKAZeroOutArray \ 997 ((void (*)(const uint8_t *array, uint32_t arrayLength)) \ 998 ROM_API_PKA_TABLE[22]) 999 1000 #define ROM_PKAEccMontgomeryMultiplyStart \ 1001 ((uint32_t (*)(const uint8_t *scalar, const uint8_t *curvePointX, const uint8_t *prime, const uint8_t *a, uint32_t length, uint32_t *resultPKAMemAddr)) \ 1002 ROM_API_PKA_TABLE[23]) 1003 1004 1005 // SHA2 FUNCTIONS 1006 #define ROM_SHA2ComputeFinalHash \ 1007 ((uint32_t (*)(const uint8_t *message, uint8_t *resultDigest, uint32_t *intermediateDigest, uint32_t totalMsgLength, uint32_t messageLength, uint32_t hashAlgorithm)) \ 1008 ROM_API_SHA2_TABLE[0]) 1009 1010 #define ROM_SHA2ComputeHash \ 1011 ((uint32_t (*)(const uint8_t *message, uint8_t *resultDigest, uint32_t totalMsgLength, uint32_t hashAlgorithm)) \ 1012 ROM_API_SHA2_TABLE[1]) 1013 1014 #define ROM_SHA2ComputeInitialHash \ 1015 ((uint32_t (*)(const uint8_t *message, uint32_t *intermediateDigest, uint32_t hashAlgorithm, uint32_t initialMessageLength)) \ 1016 ROM_API_SHA2_TABLE[2]) 1017 1018 #define ROM_SHA2ComputeIntermediateHash \ 1019 ((uint32_t (*)(const uint8_t *message, uint32_t *intermediateDigest, uint32_t hashAlgorithm, uint32_t intermediateMessageLength)) \ 1020 ROM_API_SHA2_TABLE[3]) 1021 1022 #define ROM_SHA2StartDMAOperation \ 1023 ((void (*)(uint8_t *channel0Addr, uint32_t channel0Length, uint8_t *channel1Addr, uint32_t channel1Length)) \ 1024 ROM_API_SHA2_TABLE[4]) 1025 1026 #define ROM_SHA2WaitForIRQFlags \ 1027 ((uint32_t (*)(uint32_t irqFlags)) \ 1028 ROM_API_SHA2_TABLE[5]) 1029 1030 1031 1032 //***************************************************************************** 1033 // 1034 // Mark the end of the C bindings section for C++ compilers. 1035 // 1036 //***************************************************************************** 1037 #ifdef __cplusplus 1038 } 1039 #endif 1040 1041 #endif // __ROM_H__ 1042