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