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