CC13xx Driver Library
rom.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: rom.h
3 * Revised: 2015-08-27 14:16:05 +0200 (Thu, 27 Aug 2015)
4 * Revision: 44479
5 *
6 * Description: Prototypes for the ROM utility functions.
7 *
8 * Copyright (c) 2015, 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 //
59 // Start address of the ROM hard API access table (located after the ROM FW rev field)
60 //
61 #define ROM_HAPI_TABLE_ADDR 0x10000048
62 
63 //
64 // ROM Hard-API function interface types
65 //
66 typedef uint32_t (* FPTR_CRC32_T) ( uint8_t* /* pui8Data */,\
67  uint32_t /* ui32ByteCount */,\
68  uint32_t /* ui32RepeatCount */);
69 
70 typedef uint32_t (* FPTR_GETFLSIZE_T) ( void );
71 
72 typedef uint32_t (* FPTR_GETCHIPID_T) ( void );
73 
74 typedef uint32_t (* FPTR_RESERVED1_T) ( uint32_t );
75 
76 typedef uint32_t (* FPTR_RESERVED2_T) ( void );
77 
78 typedef uint32_t (* FPTR_RESERVED3_T) ( uint8_t* ,\
79  uint32_t ,\
80  uint32_t );
81 typedef void (* FPTR_RESETDEV_T) ( void );
82 
83 typedef uint32_t (* FPTR_FLETCHER32_T) ( uint16_t* /* pui16Data */,\
84  uint16_t /* ui16WordCount */,\
85  uint16_t /* ui16RepeatCount */);
86 
87 typedef uint32_t (* FPTR_MINVAL_T) ( uint32_t* /* ulpDataBuffer */,\
88  uint32_t /* ui32DataCount */);
89 
90 typedef uint32_t (* FPTR_MAXVAL_T) ( uint32_t* /* pui32DataBuffer */,\
91  uint32_t /* ui32DataCount */);
92 
93 typedef uint32_t (* FPTR_MEANVAL_T) ( uint32_t* /* pui32DataBuffer */,\
94  uint32_t /* ui32DataCount */);
95 
96 typedef uint32_t (* FPTR_STDDVAL_T) ( uint32_t* /* pui32DataBuffer */,\
97  uint32_t /* ui32DataCount */);
98 
99 typedef void (* FPTR_HFSOURCESAFESWITCH_T) ( void );
100 
101 typedef void (* FPTR_RESERVED4_T) ( uint32_t );
102 
103 typedef void (* FPTR_RESERVED5_T) ( uint32_t );
104 
105 typedef void (* FPTR_COMPAIN_T) ( uint8_t /* ut8Signal */);
106 
107 typedef void (* FPTR_COMPAREF_T) ( uint8_t /* ut8Signal */);
108 
109 typedef void (* FPTR_ADCCOMPBIN_T) ( uint8_t /* ut8Signal */);
110 
111 typedef void (* FPTR_COMPBREF_T) ( uint8_t /* ut8Signal */);
112 
113 extern uint32_t MemBusWrkAroundHapiProgramFlash(uint8_t *pui8DataBuffer,
114  uint32_t ui32Address,
115  uint32_t ui32Count);
116 
117 extern uint32_t MemBusWrkAroundHapiEraseSector(uint32_t ui32Address);
118 
119 //
120 // ROM Hard-API access table type
121 //
122 typedef struct
123 {
143 } HARD_API_T;
144 
145 //
146 // Pointer to the ROM HAPI table
147 //
148 #define P_HARD_API ((HARD_API_T*) ROM_HAPI_TABLE_ADDR)
149 
150 //
151 // Add wrapper around the Hapi functions needing the "bus arbitration issue" workaround
152 //
153 extern void SafeHapiAuxAdiSelect( FPTR_VOID_UINT8_T fPtr, uint8_t ut8Signal );
154 
155 #define HapiCrc32(a,b,c) P_HARD_API->Crc32(a,b,c)
156 #define HapiGetFlashSize() P_HARD_API->FlashGetSize()
157 #define HapiGetChipId() P_HARD_API->GetChipId()
158 #define HapiSectorErase(a) MemBusWrkAroundHapiEraseSector(a)
159 #define HapiProgramFlash(a,b,c) MemBusWrkAroundHapiProgramFlash(a,b,c)
160 #define HapiResetDevice() P_HARD_API->ResetDevice()
161 #define HapiFletcher32(a,b,c) P_HARD_API->Fletcher32(a,b,c)
162 #define HapiMinValue(a,b) P_HARD_API->MinValue(a,b)
163 #define HapiMaxValue(a,b) P_HARD_API->MaxValue(a,b)
164 #define HapiMeanValue(a,b) P_HARD_API->MeanValue(a,b)
165 #define HapiStandDeviationValue(a,b) P_HARD_API->StandDeviationValue(a,b)
166 #define HapiHFSourceSafeSwitch() P_HARD_API->HFSourceSafeSwitch()
167 #define HapiSelectCompAInput(a) SafeHapiAuxAdiSelect( P_HARD_API->SelectCompAInput , a )
168 #define HapiSelectCompARef(a) SafeHapiAuxAdiSelect( P_HARD_API->SelectCompARef , a )
169 #define HapiSelectADCCompBInput(a) SafeHapiAuxAdiSelect( P_HARD_API->SelectADCCompBInput, a )
170 #define HapiSelectCompBRef(a) SafeHapiAuxAdiSelect( P_HARD_API->SelectCompBRef , a )
171 
172 //
173 // Defines for input parameter to the HapiSelectCompAInput function.
174 // The define values can not be changed!
175 //
176 #define COMPA_IN_NC 0x00
177 #define COMPA_IN_AUXIO7 0x09
178 #define COMPA_IN_AUXIO6 0x0A
179 #define COMPA_IN_AUXIO5 0x0B
180 #define COMPA_IN_AUXIO4 0x0C
181 #define COMPA_IN_AUXIO3 0x0D
182 #define COMPA_IN_AUXIO2 0x0E
183 #define COMPA_IN_AUXIO1 0x0F
184 #define COMPA_IN_AUXIO0 0x10
185 
186 //
187 // Defines for input parameter to the HapiSelectCompARef function.
188 // The define values can not be changed!
189 //
190 #define COMPA_REF_NC 0x00
191 #define COMPA_REF_DCOUPL 0x01
192 #define COMPA_REF_VSS 0x02
193 #define COMPA_REF_VDDS 0x03
194 #define COMPA_REF_ADCVREFP 0x04
195 #define COMPA_REF_AUXIO7 0x09
196 #define COMPA_REF_AUXIO6 0x0A
197 #define COMPA_REF_AUXIO5 0x0B
198 #define COMPA_REF_AUXIO4 0x0C
199 #define COMPA_REF_AUXIO3 0x0D
200 #define COMPA_REF_AUXIO2 0x0E
201 #define COMPA_REF_AUXIO1 0x0F
202 #define COMPA_REF_AUXIO0 0x10
203 
204 //
205 // Defines for input parameter to the HapiSelectADCCompBInput function.
206 // The define values can not be changed!
207 //
208 #define ADC_COMPB_IN_NC 0x00
209 #define ADC_COMPB_IN_DCOUPL 0x03
210 #define ADC_COMPB_IN_VSS 0x04
211 #define ADC_COMPB_IN_VDDS 0x05
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 
221 //
222 // Defines for input parameter to the HapiSelectCompBRef function.
223 // The define values can not be changed!
224 //
225 #define COMPB_REF_NC 0x00
226 #define COMPB_REF_DCOUPL 0x01
227 #define COMPB_REF_VSS 0x02
228 #define COMPB_REF_VDDS 0x03
229 
230 #endif // __HAPI_H_
231 
232 //*****************************************************************************
233 //
234 // Pointers to the main API tables.
235 //
236 //*****************************************************************************
237 #define ROM_APITABLE ((uint32_t *)0x10000180)
238 #define ROM_VERSION (ROM_APITABLE[0])
239 #define ROM_AON_EVENTTABLE ((uint32_t *)(ROM_APITABLE[1]))
240 #define ROM_AON_IOCTABLE ((uint32_t *)(ROM_APITABLE[2]))
241 #define ROM_AON_RTCTABLE ((uint32_t *)(ROM_APITABLE[3]))
242 #define ROM_AON_WUCTABLE ((uint32_t *)(ROM_APITABLE[4]))
243 #define ROM_AUX_CTRLTABLE ((uint32_t *)(ROM_APITABLE[5]))
244 #define ROM_AUX_TDCTABLE ((uint32_t *)(ROM_APITABLE[6]))
245 #define ROM_AUX_TIMERTABLE ((uint32_t *)(ROM_APITABLE[7]))
246 #define ROM_AUX_WUCTABLE ((uint32_t *)(ROM_APITABLE[8]))
247 #define ROM_DDITABLE ((uint32_t *)(ROM_APITABLE[9]))
248 #define ROM_FLASHTABLE ((uint32_t *)(ROM_APITABLE[10]))
249 #define ROM_I2CTABLE ((uint32_t *)(ROM_APITABLE[11]))
250 #define ROM_INTERRUPTTABLE ((uint32_t *)(ROM_APITABLE[12]))
251 #define ROM_IOCTABLE ((uint32_t *)(ROM_APITABLE[13]))
252 #define ROM_PRCMTABLE ((uint32_t *)(ROM_APITABLE[14]))
253 #define ROM_SMPHTABLE ((uint32_t *)(ROM_APITABLE[15]))
254 #define ROM_SPISTABLE ((uint32_t *)(ROM_APITABLE[16]))
255 #define ROM_SSITABLE ((uint32_t *)(ROM_APITABLE[17]))
256 #define ROM_TIMERTABLE ((uint32_t *)(ROM_APITABLE[18]))
257 #define ROM_TRNGTABLE ((uint32_t *)(ROM_APITABLE[19]))
258 #define ROM_UARTTABLE ((uint32_t *)(ROM_APITABLE[20]))
259 #define ROM_UDMATABLE ((uint32_t *)(ROM_APITABLE[21]))
260 #define ROM_VIMSTABLE ((uint32_t *)(ROM_APITABLE[22]))
261 
262 //*****************************************************************************
263 //
264 // Macros for calling ROM functions in the AON_EVENT API.
265 //
266 //*****************************************************************************
267 #define ROM_AONEventMcuWakeUpSet \
268  ((void (*)(uint32_t ui32MCUWUEvent, \
269  uint32_t ui32EventSrc))ROM_AON_EVENTTABLE[0])
270 
271 #define ROM_AONEventMcuWakeUpGet \
272  ((uint32_t (*)(uint32_t ui32MCUWUEvent))ROM_AON_EVENTTABLE[1])
273 
274 #define ROM_AONEventAuxWakeUpSet \
275  ((void (*)(uint32_t ui32AUXWUEvent, \
276  uint32_t ui32EventSrc))ROM_AON_EVENTTABLE[2])
277 
278 #define ROM_AONEventAuxWakeUpGet \
279  ((uint32_t (*)(uint32_t ui32AUXWUEvent))ROM_AON_EVENTTABLE[3])
280 
281 #define ROM_AONEventMcuSet \
282  ((void (*)(uint32_t ui32MCUEvent, \
283  uint32_t ui32EventSrc))ROM_AON_EVENTTABLE[4])
284 
285 #define ROM_AONEventMcuGet \
286  ((uint32_t (*)(uint32_t ui32MCUEvent))ROM_AON_EVENTTABLE[5])
287 
288 //*****************************************************************************
289 //
290 // Macros for calling ROM functions in the AON_IOC API.
291 //
292 //*****************************************************************************
293 
294 //*****************************************************************************
295 //
296 // Macros for calling ROM functions in the AON_RTC API.
297 //
298 //*****************************************************************************
299 
300 //*****************************************************************************
301 //
302 // Macros for calling ROM functions in the AON_WUC API.
303 //
304 //*****************************************************************************
305 
306 #define ROM_AONWUCAuxReset \
307  ((void (*)(void))ROM_AON_WUCTABLE[3])
308 
309 #define ROM_AONWUCRechargeCtrlConfigSet \
310  ((void (*)(bool bAdaptEnable, \
311  uint32_t ui32AdaptRate, \
312  uint32_t ui32Period, \
313  uint32_t ui32MaxPeriod))ROM_AON_WUCTABLE[4])
314 
315 #define ROM_AONWUCOscConfig \
316  ((void (*)(uint32_t ui32Period))ROM_AON_WUCTABLE[5])
317 
318 
319 //*****************************************************************************
320 //
321 // Macros for calling ROM functions in the AUX_TDC API.
322 //
323 //*****************************************************************************
324 #define ROM_AUXTDCConfigSet \
325  ((void (*)(uint32_t ui32Base, \
326  uint32_t ui32StartCondition, \
327  uint32_t ui32StopCondition))ROM_AUX_TDCTABLE[0])
328 
329 #define ROM_AUXTDCMeasurementDone \
330  ((uint32_t (*)(uint32_t ui32Base))ROM_AUX_TDCTABLE[1])
331 
332 //*****************************************************************************
333 //
334 // Macros for calling ROM functions in the AUX_TIMER API.
335 //
336 //*****************************************************************************
337 #define ROM_AUXTimerConfigure \
338  ((void (*)(uint32_t ui32Timer, \
339  uint32_t ui32Config))ROM_AUX_TIMERTABLE[0])
340 
341 #define ROM_AUXTimerStart \
342  ((void (*)(uint32_t ui32Timer))ROM_AUX_TIMERTABLE[1])
343 
344 #define ROM_AUXTimerStop \
345  ((void (*)(uint32_t ui32Timer))ROM_AUX_TIMERTABLE[2])
346 
347 #define ROM_AUXTimerPrescaleSet \
348  ((void (*)(uint32_t ui32Timer, \
349  uint32_t ui32PrescaleDiv))ROM_AUX_TIMERTABLE[3])
350 
351 #define ROM_AUXTimerPrescaleGet \
352  ((uint32_t (*)(uint32_t ui32Timer))ROM_AUX_TIMERTABLE[4])
353 
354 //*****************************************************************************
355 //
356 // Macros for calling ROM functions in the AUX_WUC API.
357 //
358 //*****************************************************************************
359 #define ROM_AUXWUCClockEnable \
360  ((void (*)(uint32_t ui32Clocks))ROM_AUX_WUCTABLE[0])
361 
362 #define ROM_AUXWUCClockDisable \
363  ((void (*)(uint32_t ui32Clocks))ROM_AUX_WUCTABLE[1])
364 
365 #define ROM_AUXWUCClockStatus \
366  ((uint32_t (*)(uint32_t ui32Clocks))ROM_AUX_WUCTABLE[2])
367 
368 #define ROM_AUXWUCPowerCtrl \
369  ((void (*)(uint32_t ui32PowerMode))ROM_AUX_WUCTABLE[3])
370 
371 //*****************************************************************************
372 //
373 // Macros for calling ROM functions in the DDI API.
374 //
375 //*****************************************************************************
376 #define ROM_DDI16BitWrite \
377  ((void (*)(uint32_t ui32Base, \
378  uint32_t ui32Reg, \
379  uint32_t ui32Mask, \
380  uint32_t ui32WrData))ROM_DDITABLE[0])
381 
382 #define ROM_DDI16BitfieldWrite \
383  ((void (*)(uint32_t ui32Base, \
384  uint32_t ui32Reg, \
385  uint32_t ui32Mask, \
386  uint32_t ui32Shift, \
387  uint16_t ui32Data))ROM_DDITABLE[1])
388 
389 #define ROM_DDI16BitRead \
390  ((uint16_t (*)(uint32_t ui32Base, \
391  uint32_t ui32Reg, \
392  uint32_t ui32Mask))ROM_DDITABLE[2])
393 
394 #define ROM_DDI16BitfieldRead \
395  ((uint16_t (*)(uint32_t ui32Base, \
396  uint32_t ui32Reg, \
397  uint32_t ui32Mask, \
398  uint32_t ui32Shift))ROM_DDITABLE[3])
399 
400 //*****************************************************************************
401 //
402 // Macros for calling ROM functions in the FLASH API.
403 //
404 //*****************************************************************************
405 
406 #define ROM_FlashPowerModeGet \
407  ((uint32_t (*)(void))ROM_FLASHTABLE[1])
408 
409 #define ROM_FlashProtectionSet \
410  ((void (*)(uint32_t ui32SectorAddress, \
411  uint32_t ui32ProtectMode))ROM_FLASHTABLE[2])
412 
413 #define ROM_FlashProtectionGet \
414  ((uint32_t (*)(uint32_t ui32SectorAddress))ROM_FLASHTABLE[3])
415 
416 #define ROM_FlashProtectionSave \
417  ((uint32_t (*)(uint32_t ui32SectorAddress))ROM_FLASHTABLE[4])
418 
419 #define ROM_FlashEfuseReadRow \
420  ((bool (*)(uint32_t *pui32EfuseData, \
421  uint32_t ui32RowAddress))ROM_FLASHTABLE[8])
422 
423 #define ROM_FlashDisableSectorsForWrite \
424  ((void (*)(void))ROM_FLASHTABLE[9])
425 
426 //*****************************************************************************
427 //
428 // Macros for calling ROM functions in the I2C API.
429 //
430 //*****************************************************************************
431 #define ROM_I2CMasterInitExpClk \
432  ((void (*)(uint32_t ui32Base, \
433  uint32_t ui32I2CClk, \
434  bool bFast))ROM_I2CTABLE[0])
435 
436 #define ROM_I2CMasterErr \
437  ((uint32_t (*)(uint32_t ui32Base))ROM_I2CTABLE[1])
438 
439 //*****************************************************************************
440 //
441 // Macros for calling ROM functions in the INTERRUPT API.
442 //
443 //*****************************************************************************
444 #define ROM_IntPriorityGroupingSet \
445  ((void (*)(uint32_t ui32Bits))ROM_INTERRUPTTABLE[0])
446 
447 #define ROM_IntPriorityGroupingGet \
448  ((uint32_t (*)(void))ROM_INTERRUPTTABLE[1])
449 
450 #define ROM_IntPrioritySet \
451  ((void (*)(uint32_t ui32Interrupt, \
452  uint8_t ui8Priority))ROM_INTERRUPTTABLE[2])
453 
454 #define ROM_IntPriorityGet \
455  ((int32_t (*)(uint32_t ui32Interrupt))ROM_INTERRUPTTABLE[3])
456 
457 #define ROM_IntEnable \
458  ((void (*)(uint32_t ui32Interrupt))ROM_INTERRUPTTABLE[4])
459 
460 #define ROM_IntDisable \
461  ((void (*)(uint32_t ui32Interrupt))ROM_INTERRUPTTABLE[5])
462 
463 #define ROM_IntPendSet \
464  ((void (*)(uint32_t ui32Interrupt))ROM_INTERRUPTTABLE[6])
465 
466 #define ROM_IntPendGet \
467  ((bool (*)(uint32_t ui32Interrupt))ROM_INTERRUPTTABLE[7])
468 
469 #define ROM_IntPendClear \
470  ((void (*)(uint32_t ui32Interrupt))ROM_INTERRUPTTABLE[8])
471 
472 //*****************************************************************************
473 //
474 // Macros for calling ROM functions in the IOC API.
475 //
476 //*****************************************************************************
477 #define ROM_IOCPortConfigureSet \
478  ((void (*)(uint32_t ui32IOId, \
479  uint32_t ui32PortId, \
480  uint32_t ui32IOConfig))ROM_IOCTABLE[0])
481 
482 #define ROM_IOCPortConfigureGet \
483  ((uint32_t (*)(uint32_t ui32IOId))ROM_IOCTABLE[1])
484 
485 #define ROM_IOCIOShutdownSet \
486  ((void (*)(uint32_t ui32IOId, \
487  uint32_t ui32IOShutdown))ROM_IOCTABLE[2])
488 
489 
490 #define ROM_IOCIOModeSet \
491  ((void (*)(uint32_t ui32IOId, \
492  uint32_t ui32IOMode))ROM_IOCTABLE[4])
493 
494 #define ROM_IOCIOIntSet \
495  ((void (*)(uint32_t ui32IOId, \
496  uint32_t ui32Int, \
497  uint32_t ui32EdgeDet))ROM_IOCTABLE[5])
498 
499 #define ROM_IOCIOPortPullSet \
500  ((void (*)(uint32_t ui32IOId, \
501  uint32_t ui32Pull))ROM_IOCTABLE[6])
502 
503 #define ROM_IOCIOHystSet \
504  ((void (*)(uint32_t ui32IOId, \
505  uint32_t ui32Hysteresis))ROM_IOCTABLE[7])
506 
507 #define ROM_IOCIOInputSet \
508  ((void (*)(uint32_t ui32IOId, \
509  uint32_t ui32Input))ROM_IOCTABLE[8])
510 
511 #define ROM_IOCIOSlewCtrlSet \
512  ((void (*)(uint32_t ui32IOId, \
513  uint32_t ui32SlewEnable))ROM_IOCTABLE[9])
514 
515 #define ROM_IOCIODrvStrengthSet \
516  ((void (*)(uint32_t ui32IOId, \
517  uint32_t ui32IOCurrent, \
518  uint32_t ui32DrvStrength))ROM_IOCTABLE[10])
519 
520 #define ROM_IOCIOPortIdSet \
521  ((void (*)(uint32_t ui32IOId, \
522  uint32_t ui32PortId))ROM_IOCTABLE[11])
523 
524 #define ROM_IOCIntEnable \
525  ((void (*)(uint32_t ui32IOId))ROM_IOCTABLE[12])
526 
527 #define ROM_IOCIntDisable \
528  ((void (*)(uint32_t ui32IOId))ROM_IOCTABLE[13])
529 
530 #define ROM_IOCPinTypeGpioInput \
531  ((void (*)(uint32_t ui32IOId))ROM_IOCTABLE[14])
532 
533 #define ROM_IOCPinTypeGpioOutput \
534  ((void (*)(uint32_t ui32IOId))ROM_IOCTABLE[15])
535 
536 #define ROM_IOCPinTypeUart \
537  ((void (*)(uint32_t ui32Base, \
538  uint32_t ui32Rx, \
539  uint32_t ui32Tx, \
540  uint32_t ui32Cts, \
541  uint32_t ui32Rts))ROM_IOCTABLE[16])
542 
543 #define ROM_IOCPinTypeSsiMaster \
544  ((void (*)(uint32_t ui32Base, \
545  uint32_t ui32Rx, \
546  uint32_t ui32Tx, \
547  uint32_t ui32Fss, \
548  uint32_t ui32Clk))ROM_IOCTABLE[17])
549 
550 #define ROM_IOCPinTypeSsiSlave \
551  ((void (*)(uint32_t ui32Base, \
552  uint32_t ui32Rx, \
553  uint32_t ui32Tx, \
554  uint32_t ui32Fss, \
555  uint32_t ui32Clk))ROM_IOCTABLE[18])
556 
557 #define ROM_IOCPinTypeI2c \
558  ((void (*)(uint32_t ui32Base, \
559  uint32_t ui32Data, \
560  uint32_t ui32Clk))ROM_IOCTABLE[19])
561 
562 #define ROM_IOCPinTypeSpis \
563  ((void (*)(uint32_t ui32Rx, \
564  uint32_t ui32Tx, \
565  uint32_t ui32Fss, \
566  uint32_t ui32Clk))ROM_IOCTABLE[20])
567 
568 #define ROM_IOCPinTypeAux \
569  ((void (*)(uint32_t ui32IOId))ROM_IOCTABLE[21])
570 
571 //*****************************************************************************
572 //
573 // Macros for calling ROM functions in the PRCM API.
574 //
575 //*****************************************************************************
576 #define ROM_PRCMInfClockConfigureSet \
577  ((void (*)(uint32_t ui32ClkDiv, \
578  uint32_t ui32PowerMode))ROM_PRCMTABLE[0])
579 
580 #define ROM_PRCMInfClockConfigureGet \
581  ((uint32_t (*)(uint32_t ui32PowerMode))ROM_PRCMTABLE[1])
582 
583 
584 #define ROM_PRCMAudioClockConfigSet \
585  ((void (*)(uint32_t ui32ClkConfig, \
586  uint32_t ui32SampleRate))ROM_PRCMTABLE[4])
587 
588 #define ROM_PRCMPowerDomainOn \
589  ((void (*)(uint32_t ui32Domains))ROM_PRCMTABLE[5])
590 
591 #define ROM_PRCMPowerDomainOff \
592  ((void (*)(uint32_t ui32Domains))ROM_PRCMTABLE[6])
593 
594 #define ROM_PRCMPeripheralRunEnable \
595  ((void (*)(uint32_t ui32Peripheral))ROM_PRCMTABLE[7])
596 
597 #define ROM_PRCMPeripheralRunDisable \
598  ((void (*)(uint32_t ui32Peripheral))ROM_PRCMTABLE[8])
599 
600 #define ROM_PRCMPeripheralSleepEnable \
601  ((void (*)(uint32_t ui32Peripheral))ROM_PRCMTABLE[9])
602 
603 #define ROM_PRCMPeripheralSleepDisable \
604  ((void (*)(uint32_t ui32Peripheral))ROM_PRCMTABLE[10])
605 
606 #define ROM_PRCMPeripheralDeepSleepEnable \
607  ((void (*)(uint32_t ui32Peripheral))ROM_PRCMTABLE[11])
608 
609 #define ROM_PRCMPeripheralDeepSleepDisable \
610  ((void (*)(uint32_t ui32Peripheral))ROM_PRCMTABLE[12])
611 
612 #define ROM_PRCMPowerDomainStatus \
613  ((uint32_t (*)(uint32_t ui32Domains))ROM_PRCMTABLE[13])
614 
615 #define ROM_PRCMDeepSleep \
616  ((void (*)(void))ROM_PRCMTABLE[14])
617 
618 
619 //*****************************************************************************
620 //
621 // Macros for calling ROM functions in the SMPH API.
622 //
623 //*****************************************************************************
624 #define ROM_SMPHAcquire \
625  ((void (*)(uint32_t ui32Semaphore))ROM_SMPHTABLE[0])
626 
627 
628 //*****************************************************************************
629 //
630 // Macros for calling ROM functions in the SSI API.
631 //
632 //*****************************************************************************
633 #define ROM_SSIConfigSetExpClk \
634  ((void (*)(uint32_t ui32Base, \
635  uint32_t ui32SSIClk, \
636  uint32_t ui32Protocol, \
637  uint32_t ui32Mode, \
638  uint32_t ui32BitRate, \
639  uint32_t ui32DataWidth))ROM_SSITABLE[0])
640 
641 #define ROM_SSIDataPut \
642  ((void (*)(uint32_t ui32Base, \
643  uint32_t ui32Data))ROM_SSITABLE[1])
644 
645 #define ROM_SSIDataPutNonBlocking \
646  ((int32_t (*)(uint32_t ui32Base, \
647  uint32_t ui32Data))ROM_SSITABLE[2])
648 
649 #define ROM_SSIDataGet \
650  ((void (*)(uint32_t ui32Base, \
651  uint32_t *pui32Data))ROM_SSITABLE[3])
652 
653 #define ROM_SSIDataGetNonBlocking \
654  ((int32_t (*)(uint32_t ui32Base, \
655  uint32_t *pui32Data))ROM_SSITABLE[4])
656 
657 //*****************************************************************************
658 //
659 // Macros for calling ROM functions in the TIMER API.
660 //
661 //*****************************************************************************
662 #define ROM_TimerConfigure \
663  ((void (*)(uint32_t ui32Base, \
664  uint32_t ui32Config))ROM_TIMERTABLE[0])
665 
666 #define ROM_TimerLevelControl \
667  ((void (*)(uint32_t ui32Base, \
668  uint32_t ui32Timer, \
669  bool bInvert))ROM_TIMERTABLE[1])
670 
671 #define ROM_TimerStallControl \
672  ((void (*)(uint32_t ui32Base, \
673  uint32_t ui32Timer, \
674  bool bStall))ROM_TIMERTABLE[3])
675 
676 #define ROM_TimerWaitOnTriggerControl \
677  ((void (*)(uint32_t ui32Base, \
678  uint32_t ui32Timer, \
679  bool bWait))ROM_TIMERTABLE[4])
680 
681 //*****************************************************************************
682 //
683 // Macros for calling ROM functions in the TRNG API.
684 //
685 //*****************************************************************************
686 
687 #define ROM_TRNGNumberGet \
688  ((uint32_t (*)(uint32_t ui32Word))ROM_TRNGTABLE[1])
689 
690 //*****************************************************************************
691 //
692 // Macros for calling ROM functions in the UART API.
693 //
694 //*****************************************************************************
695 #define ROM_UARTFIFOLevelGet \
696  ((void (*)(uint32_t ui32Base, \
697  uint32_t *pui32TxLevel, \
698  uint32_t *pui32RxLevel))ROM_UARTTABLE[0])
699 
700 #define ROM_UARTConfigSetExpClk \
701  ((void (*)(uint32_t ui32Base, \
702  uint32_t ui32UARTClk, \
703  uint32_t ui32Baud, \
704  uint32_t ui32Config))ROM_UARTTABLE[1])
705 
706 #define ROM_UARTConfigGetExpClk \
707  ((void (*)(uint32_t ui32Base, \
708  uint32_t ui32UARTClk, \
709  uint32_t *pui32Baud, \
710  uint32_t *pui32Config))ROM_UARTTABLE[2])
711 
712 #define ROM_UARTDisable \
713  ((void (*)(uint32_t ui32Base))ROM_UARTTABLE[3])
714 
715 #define ROM_UARTCharGetNonBlocking \
716  ((int32_t (*)(uint32_t ui32Base))ROM_UARTTABLE[4])
717 
718 #define ROM_UARTCharGet \
719  ((int32_t (*)(uint32_t ui32Base))ROM_UARTTABLE[5])
720 
721 #define ROM_UARTCharPutNonBlocking \
722  ((bool (*)(uint32_t ui32Base, \
723  uint8_t ui8Data))ROM_UARTTABLE[6])
724 
725 #define ROM_UARTCharPut \
726  ((void (*)(uint32_t ui32Base, \
727  uint8_t ui8Data))ROM_UARTTABLE[7])
728 
729 //*****************************************************************************
730 //
731 // Macros for calling ROM functions in the UDMA API.
732 //
733 //*****************************************************************************
734 #define ROM_uDMAChannelAttributeEnable \
735  ((void (*)(uint32_t ui32Base, \
736  uint32_t ui32ChannelNum, \
737  uint32_t ui32Attr))ROM_UDMATABLE[0])
738 
739 #define ROM_uDMAChannelAttributeDisable \
740  ((void (*)(uint32_t ui32Base, \
741  uint32_t ui32ChannelNum, \
742  uint32_t ui32Attr))ROM_UDMATABLE[1])
743 
744 #define ROM_uDMAChannelAttributeGet \
745  ((uint32_t (*)(uint32_t ui32Base, \
746  uint32_t ui32ChannelNum))ROM_UDMATABLE[2])
747 
748 #define ROM_uDMAChannelControlSet \
749  ((void (*)(uint32_t ui32Base, \
750  uint32_t ui32ChannelStructIndex, \
751  uint32_t ui32Control))ROM_UDMATABLE[3])
752 
753 #define ROM_uDMAChannelScatterGatherSet \
754  ((void (*)(uint32_t ui32Base, \
755  uint32_t ui32ChannelNum, \
756  uint32_t ui32TaskCount, \
757  void *pvTaskList, \
758  uint32_t ui32IsPeriphSG))ROM_UDMATABLE[5])
759 
760 #define ROM_uDMAChannelSizeGet \
761  ((uint32_t (*)(uint32_t ui32Base, \
762  uint32_t ui32ChannelStructIndex))ROM_UDMATABLE[6])
763 
764 #define ROM_uDMAChannelModeGet \
765  ((uint32_t (*)(uint32_t ui32Base, \
766  uint32_t ui32ChannelStructIndex))ROM_UDMATABLE[7])
767 
768 //*****************************************************************************
769 //
770 // Macros for calling ROM functions in the VIMS API.
771 //
772 //*****************************************************************************
773 #define ROM_VIMSConfigure \
774  ((void (*)(uint32_t ui32Base, \
775  bool bRoundRobin, \
776  bool bPrefetch))ROM_VIMSTABLE[0])
777 
778 #define ROM_VIMSModeSet \
779  ((void (*)(uint32_t ui32Base, \
780  uint32_t ui32Mode))ROM_VIMSTABLE[1])
781 
782 //*****************************************************************************
783 //
784 // Mark the end of the C bindings section for C++ compilers.
785 //
786 //*****************************************************************************
787 #ifdef __cplusplus
788 }
789 #endif
790 
791 #endif // __ROM_H__
FPTR_RESERVED2_T ReservedLocation2
Definition: rom.h:128
FPTR_RESERVED5_T ReservedLocation5
Definition: rom.h:137
FPTR_GETCHIPID_T GetChipId
Definition: rom.h:126
FPTR_STDDVAL_T StandDeviationValue
Definition: rom.h:135
uint32_t(* FPTR_MEANVAL_T)(uint32_t *, uint32_t)
Definition: rom.h:93
uint32_t MemBusWrkAroundHapiProgramFlash(uint8_t *pui8DataBuffer, uint32_t ui32Address, uint32_t ui32Count)
Definition: flash.c:715
void(* FPTR_RESERVED5_T)(uint32_t)
Definition: rom.h:103
void(* FPTR_ADCCOMPBIN_T)(uint8_t)
Definition: rom.h:109
FPTR_CRC32_T Crc32
Definition: rom.h:124
FPTR_RESETDEV_T ResetDevice
Definition: rom.h:130
void(* FPTR_COMPAIN_T)(uint8_t)
Definition: rom.h:105
void SafeHapiAuxAdiSelect(FPTR_VOID_UINT8_T fPtr, uint8_t ut8Signal)
Definition: adi.c:53
FPTR_MINVAL_T MinValue
Definition: rom.h:132
FPTR_FLETCHER32_T Fletcher32
Definition: rom.h:131
uint32_t(* FPTR_STDDVAL_T)(uint32_t *, uint32_t)
Definition: rom.h:96
uint32_t(* FPTR_GETFLSIZE_T)(void)
Definition: rom.h:70
FPTR_GETFLSIZE_T FlashGetSize
Definition: rom.h:125
FPTR_HFSOURCESAFESWITCH_T HFSourceSafeSwitch
Definition: rom.h:138
FPTR_COMPBREF_T SelectCompBRef
Definition: rom.h:142
uint32_t(* FPTR_RESERVED3_T)(uint8_t *, uint32_t, uint32_t)
Definition: rom.h:78
uint32_t MemBusWrkAroundHapiEraseSector(uint32_t ui32Address)
Definition: flash.c:745
uint32_t(* FPTR_RESERVED2_T)(void)
Definition: rom.h:76
uint32_t(* FPTR_FLETCHER32_T)(uint16_t *, uint16_t, uint16_t)
Definition: rom.h:83
uint32_t(* FPTR_MINVAL_T)(uint32_t *, uint32_t)
Definition: rom.h:87
uint32_t(* FPTR_GETCHIPID_T)(void)
Definition: rom.h:72
void(* FPTR_RESETDEV_T)(void)
Definition: rom.h:81
void(* FPTR_COMPBREF_T)(uint8_t)
Definition: rom.h:111
FPTR_COMPAREF_T SelectCompARef
Definition: rom.h:140
uint32_t(* FPTR_RESERVED1_T)(uint32_t)
Definition: rom.h:74
FPTR_COMPAIN_T SelectCompAInput
Definition: rom.h:139
uint32_t(* FPTR_CRC32_T)(uint8_t *, uint32_t, uint32_t)
Definition: rom.h:66
void(* FPTR_COMPAREF_T)(uint8_t)
Definition: rom.h:107
FPTR_ADCCOMPBIN_T SelectADCCompBInput
Definition: rom.h:141
uint32_t(* FPTR_MAXVAL_T)(uint32_t *, uint32_t)
Definition: rom.h:90
void(* FPTR_HFSOURCESAFESWITCH_T)(void)
Definition: rom.h:99
FPTR_MEANVAL_T MeanValue
Definition: rom.h:134
FPTR_RESERVED1_T ReservedLocation1
Definition: rom.h:127
void(* FPTR_RESERVED4_T)(uint32_t)
Definition: rom.h:101
FPTR_RESERVED3_T ReservedLocation3
Definition: rom.h:129
FPTR_MAXVAL_T MaxValue
Definition: rom.h:133
FPTR_RESERVED4_T ReservedLocation4
Definition: rom.h:136