MSP430 DriverLib for MSP430FR2xx_4xx Devices
2.91.13.01
rom_driverlib_fr235x.h
1
//*****************************************************************************
2
//
3
// rom_driverlib_fr235x.h - Macros to facilitate calling functions in ROM for
4
// MSP430FR2355, FR2353, FR2153, FR2155
5
//
6
// Copyright (c) 2017 Texas Instruments Incorporated. All rights reserved.
7
// TI Information - Selective Disclosure
8
//
9
//*****************************************************************************
10
//
11
12
#if defined(__TI_COMPILER_VERSION__)
13
#if __TI_COMPILER_VERSION__ >= 18001001
14
#define __cc_rom __attribute__((call_conv("cc_rom")))
15
#else
16
#error "The cc_rom attribute requires MSP TI COMPILER 18.1.1.LTS or more recent."
17
#endif // __TI_COMPILER_VERSION__ >=
18
#endif // (defined(__TI_COMPILER_VERSION__))18001001
19
20
#if defined(__IAR_SYSTEMS_ICC__) && (__VER__ < 650)
21
#error "The __cc_rom attribute requires IAR version 6.50 or more recent."
22
#endif
23
24
#if __REGISTER_R4__ != __REGISTER_FREE__
25
#error "Incorrect setting for R4, expected it to be free."
26
#endif
27
28
#if __REGISTER_R5__ != __REGISTER_FREE__
29
#error "Incorrect setting for R5, expected it to be free."
30
#endif
31
32
// Suppress type conversion warning
33
#ifdef __TI_COMPILER_VERSION__
34
#pragma diag_suppress 173
35
#endif
36
37
#if (defined(__TI_COMPILER_VERSION__) && !defined(__LARGE_DATA_MODEL__)) || \
38
(defined(__IAR_SYSTEMS_ICC__) && (__DATA_MODEL__!=__DATA_MODEL_LARGE__))
39
#error "Only large data model supported for this ROM."
40
#endif
41
42
#ifndef __ROM_DRIVERLIB_H__
43
#define __ROM_DRIVERLIB_H__
44
45
#if (defined(__TI_COMPILER_VERSION__) && defined(__LARGE_CODE_MODEL__)) || \
46
(defined(__IAR_SYSTEMS_ICC__) && (__CODE_MODEL__==__CODE_MODEL_LARGE__))
47
48
//*****************************************************************************
49
//
50
// Pointers to the main API tables.
51
//
52
//*****************************************************************************
53
#ifndef ROM_TABLE
54
#define ROM_TABLE ((uint32_t *)ROMLIB_START)
55
#endif
56
#define ROM_DRIVERLIB_APITABLE ((uint32_t *)&ROM_TABLE[2])
57
#define ROM_DRIVERLIB_VERSIONL (ROM_DRIVERLIB_APITABLE[0])
58
#define ROM_DRIVERLIB_VERSIONH (ROM_DRIVERLIB_APITABLE[1])
59
#define ROM_ADCTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[2]))
60
#define ROM_CRCTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[3]))
61
#define ROM_CSTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[4]))
62
#define ROM_ECOMPTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[5]))
63
#define ROM_EUSCIASPITABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[6]))
64
#define ROM_EUSCIAUARTTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[7]))
65
#define ROM_EUSCIBI2CTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[8]))
66
#define ROM_EUSCIBSPITABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[9]))
67
#define ROM_FRAMCTLTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[10]))
68
#define ROM_GPIOTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[11]))
69
#define ROM_ICCTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[12]))
70
#define ROM_MPY32TABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[14]))
71
#define ROM_PMMTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[15]))
72
#define ROM_RTCTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[16]))
73
#define ROM_SACTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[17]))
74
#define ROM_SFRTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[18]))
75
#define ROM_SYSCTLTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[19]))
76
#define ROM_TIMER_BTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[22]))
77
#define ROM_TLVTABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[23]))
78
#define ROM_WDTATABLE ((uint32_t *)(ROM_DRIVERLIB_APITABLE[24]))
79
80
#define ROM_DRIVERLIB_getVersion() ((uint32_t)ROM_DRIVERLIB_VERSIONH<<16|\
81
ROM_DRIVERLIB_VERSIONL)
82
#ifndef ROM_getVersion
83
#define ROM_getVersion() ((uint32_t)(ROMLIB_START[0]))
84
#endif
85
86
//*****************************************************************************
87
//
88
// Macros for calling ROM functions in the ADC API.
89
//
90
//*****************************************************************************
91
92
#define ROM_ADC_init \
93
((void ( __cc_rom *)(uint16_t baseAddress, \
94
uint16_t sampleHoldSignalSourceSelect, \
95
uint8_t clockSourceSelect, \
96
uint16_t clockSourceDivider))ROM_ADCTABLE[0])
97
98
#define ROM_ADC_enable \
99
((void ( __cc_rom *)(uint16_t baseAddress))ROM_ADCTABLE[1])
100
101
#define ROM_ADC_disable \
102
((void ( __cc_rom *)(uint16_t baseAddress))ROM_ADCTABLE[2])
103
104
#define ROM_ADC_setupSamplingTimer \
105
((void ( __cc_rom *)(uint16_t baseAddress, \
106
uint16_t clockCycleHoldCount, \
107
uint16_t multipleSamplesEnabled))ROM_ADCTABLE[3])
108
109
#define ROM_ADC_disableSamplingTimer \
110
((void ( __cc_rom *)(uint16_t baseAddress))ROM_ADCTABLE[4])
111
112
#define ROM_ADC_configureMemory \
113
((void ( __cc_rom *)(uint16_t baseAddress, \
114
uint8_t inputSourceSelect, \
115
uint8_t positiveRefVoltageSourceSelect, \
116
uint8_t negativeRefVoltageSourceSelect))ROM_ADCTABLE[5])
117
118
#define ROM_ADC_enableInterrupt \
119
((void ( __cc_rom *)(uint16_t baseAddress, \
120
uint8_t interruptMask))ROM_ADCTABLE[6])
121
122
#define ROM_ADC_disableInterrupt \
123
((void ( __cc_rom *)(uint16_t baseAddress, \
124
uint8_t interruptMask))ROM_ADCTABLE[7])
125
126
#define ROM_ADC_clearInterrupt \
127
((void ( __cc_rom *)(uint16_t baseAddress, \
128
uint8_t interruptFlagMask))ROM_ADCTABLE[8])
129
130
#define ROM_ADC_getInterruptStatus \
131
((uint8_t ( __cc_rom *)(uint16_t baseAddress, \
132
uint8_t interruptFlagMask))ROM_ADCTABLE[9])
133
134
#define ROM_ADC_startConversion \
135
((void ( __cc_rom *)(uint16_t baseAddress, \
136
uint8_t conversionSequenceModeSelect))ROM_ADCTABLE[10])
137
138
#define ROM_ADC_disableConversions \
139
((void ( __cc_rom *)(uint16_t baseAddress, \
140
bool preempt))ROM_ADCTABLE[11])
141
142
#define ROM_ADC_getResults \
143
((int16_t ( __cc_rom *)(uint16_t baseAddress))ROM_ADCTABLE[12])
144
145
#define ROM_ADC_setResolution \
146
((void ( __cc_rom *)(uint16_t baseAddress, \
147
uint8_t resolutionSelect))ROM_ADCTABLE[13])
148
149
#define ROM_ADC_setSampleHoldSignalInversion \
150
((void ( __cc_rom *)(uint16_t baseAddress, \
151
uint16_t invertedSignal))ROM_ADCTABLE[14])
152
153
#define ROM_ADC_setDataReadBackFormat \
154
((void ( __cc_rom *)(uint16_t baseAddress, \
155
uint16_t readBackFormat))ROM_ADCTABLE[15])
156
157
#define ROM_ADC_setReferenceBufferSamplingRate \
158
((void ( __cc_rom *)(uint16_t baseAddress, \
159
uint16_t samplingRateSelect))ROM_ADCTABLE[16])
160
161
#define ROM_ADC_setWindowComp \
162
((void ( __cc_rom *)(uint16_t baseAddress, \
163
uint16_t highThreshold, \
164
uint16_t lowThreshold))ROM_ADCTABLE[17])
165
166
#define ROM_ADC_getMemoryAddressForDMA \
167
((uint32_t ( __cc_rom *)(uint16_t baseAddress))ROM_ADCTABLE[18])
168
169
#define ROM_ADC_isBusy \
170
((uint8_t ( __cc_rom *)(uint16_t baseAddress))ROM_ADCTABLE[19])
171
172
//*****************************************************************************
173
//
174
// Macros for calling ROM functions in the CRC API.
175
//
176
//*****************************************************************************
177
178
#define ROM_CRC_setSeed \
179
((void ( __cc_rom *)(uint16_t baseAddress, \
180
uint16_t seed))ROM_CRCTABLE[0])
181
182
#define ROM_CRC_set16BitData \
183
((void ( __cc_rom *)(uint16_t baseAddress, \
184
uint16_t dataIn))ROM_CRCTABLE[1])
185
186
#define ROM_CRC_set8BitData \
187
((void ( __cc_rom *)(uint16_t baseAddress, \
188
uint8_t dataIn))ROM_CRCTABLE[2])
189
190
#define ROM_CRC_set16BitDataReversed \
191
((void ( __cc_rom *)(uint16_t baseAddress, \
192
uint16_t dataIn))ROM_CRCTABLE[3])
193
194
#define ROM_CRC_set8BitDataReversed \
195
((void ( __cc_rom *)(uint16_t baseAddress, \
196
uint8_t dataIn))ROM_CRCTABLE[4])
197
198
#define ROM_CRC_getData \
199
((uint16_t ( __cc_rom *)(uint16_t baseAddress))ROM_CRCTABLE[5])
200
201
#define ROM_CRC_getResult \
202
((uint16_t ( __cc_rom *)(uint16_t baseAddress))ROM_CRCTABLE[6])
203
204
#define ROM_CRC_getResultBitsReversed \
205
((uint16_t ( __cc_rom *)(uint16_t baseAddress))ROM_CRCTABLE[7])
206
207
//*****************************************************************************
208
//
209
// Macros for calling ROM functions in the CS API.
210
//
211
//*****************************************************************************
212
213
#define ROM_CS_initClockSignal \
214
((void ( __cc_rom *)(uint8_t selectedClockSignal, \
215
uint16_t clockSource, \
216
uint16_t clockSourceDivider))ROM_CSTABLE[1])
217
218
#define ROM_CS_turnOnXT1LF \
219
((void ( __cc_rom *)(uint16_t xt1Drive))ROM_CSTABLE[2])
220
221
#define ROM_CS_bypassXT1 \
222
((void ( __cc_rom *)(void))ROM_CSTABLE[3])
223
224
#define ROM_CS_turnOnXT1LFWithTimeout \
225
((bool ( __cc_rom *)(uint16_t xt1Drive, \
226
uint16_t timeout))ROM_CSTABLE[4])
227
228
#define ROM_CS_bypassXT1WithTimeout \
229
((bool ( __cc_rom *)(uint16_t timeout))ROM_CSTABLE[5])
230
231
#define ROM_CS_turnOffXT1 \
232
((void ( __cc_rom *)(void))ROM_CSTABLE[6])
233
234
#define ROM_CS_turnOnXT1HF \
235
((void ( __cc_rom *)(uint16_t xt1Drive, \
236
uint16_t xt1HFFreq))ROM_CSTABLE[7])
237
238
#define ROM_CS_turnOnXT1HFWithTimeout \
239
((bool ( __cc_rom *)(uint16_t xt1Drive, \
240
uint16_t xt1HFFreq, \
241
uint16_t timeout))ROM_CSTABLE[8])
242
243
#define ROM_CS_turnOnSMCLK \
244
((void ( __cc_rom *)(void))ROM_CSTABLE[9])
245
246
#define ROM_CS_turnOffSMCLK \
247
((void ( __cc_rom *)(void))ROM_CSTABLE[10])
248
249
#define ROM_CS_enableVLOAutoOff \
250
((void ( __cc_rom *)(void))ROM_CSTABLE[11])
251
252
#define ROM_CS_disableVLOAutoOff \
253
((void ( __cc_rom *)(void))ROM_CSTABLE[12])
254
255
#define ROM_CS_initFLLSettle \
256
((bool ( __cc_rom *)(uint16_t fsystem, \
257
uint16_t ratio))ROM_CSTABLE[13])
258
/* Removed due to bug fix for MSPDVRLIB-185
259
#define ROM_CS_initFLL \
260
((bool ( __cc_rom *)(uint16_t fsystem, \
261
uint16_t ratio))ROM_CSTABLE[14])
262
*/
263
/* Removed due to bug fix for MSPDVRLIB-185
264
#define ROM_CS_initFLLLoadTrim \
265
((bool ( __cc_rom *)(uint16_t fsystem, \
266
uint16_t ratio, \
267
CS_initFLLParam *param))ROM_CSTABLE[16])
268
*/
269
#define ROM_CS_enableClockRequest \
270
((void ( __cc_rom *)(uint8_t selectClock))ROM_CSTABLE[17])
271
272
#define ROM_CS_disableClockRequest \
273
((void ( __cc_rom *)(uint8_t selectClock))ROM_CSTABLE[18])
274
275
#define ROM_CS_getFaultFlagStatus \
276
((uint8_t ( __cc_rom *)(uint8_t mask))ROM_CSTABLE[19])
277
278
#define ROM_CS_clearFaultFlag \
279
((void ( __cc_rom *)(uint8_t mask))ROM_CSTABLE[20])
280
281
#define ROM_CS_clearAllOscFlagsWithTimeout \
282
((uint16_t ( __cc_rom *)(uint16_t timeout))ROM_CSTABLE[24])
283
284
#define ROM_CS_enableXT1AutomaticGainControl \
285
((void ( __cc_rom *)(void))ROM_CSTABLE[25])
286
287
#define ROM_CS_disableXT1AutomaticGainControl \
288
((void ( __cc_rom *)(void))ROM_CSTABLE[26])
289
290
#define ROM_CS_enableFLLUnlock \
291
((void ( __cc_rom *)(void))ROM_CSTABLE[27])
292
293
#define ROM_CS_disableFLLUnlock \
294
((void ( __cc_rom *)(void))ROM_CSTABLE[28])
295
296
#define ROM_CS_enableREFOLP \
297
((void ( __cc_rom *)(void))ROM_CSTABLE[29])
298
299
#define ROM_CS_disableREFOLP \
300
((void ( __cc_rom *)(void))ROM_CSTABLE[30])
301
302
#define ROM_CS_getREFOLP \
303
((bool ( __cc_rom *)(void))ROM_CSTABLE[31])
304
305
#define ROM_CS_enableXT1FaultOff \
306
((void ( __cc_rom *)(void))ROM_CSTABLE[32])
307
308
#define ROM_CS_disableXT1FaultOff \
309
((void ( __cc_rom *)(void))ROM_CSTABLE[33])
310
311
#define ROM_CS_getXT1FaultOff \
312
((bool ( __cc_rom *)(void))ROM_CSTABLE[34])
313
314
#define ROM_CS_getREFOReady \
315
((bool ( __cc_rom *)(void))ROM_CSTABLE[35])
316
317
//*****************************************************************************
318
//
319
// Macros for calling ROM functions in the ECOMP API.
320
//
321
//*****************************************************************************
322
323
#define ROM_EComp_init \
324
((void ( __cc_rom *)(uint16_t baseAddress, \
325
EComp_initParam *param))ROM_ECOMPTABLE[0])
326
327
#define ROM_EComp_selectHysteresisMode \
328
((void ( __cc_rom *)(uint16_t baseAddress, \
329
uint16_t hysteresisMode))ROM_ECOMPTABLE[1])
330
331
#define ROM_EComp_selectPowerMode \
332
((void ( __cc_rom *)(uint16_t baseAddress, \
333
uint16_t powerMode))ROM_ECOMPTABLE[2])
334
335
#define ROM_EComp_enable \
336
((void ( __cc_rom *)(uint16_t baseAddress))ROM_ECOMPTABLE[3])
337
338
#define ROM_EComp_disable \
339
((void ( __cc_rom *)(uint16_t baseAddress))ROM_ECOMPTABLE[4])
340
341
#define ROM_EComp_enableInterrupt \
342
((void ( __cc_rom *)(uint16_t baseAddress, \
343
uint16_t interruptMask))ROM_ECOMPTABLE[5])
344
345
#define ROM_EComp_disableInterrupt \
346
((void ( __cc_rom *)(uint16_t baseAddress, \
347
uint16_t interruptMask))ROM_ECOMPTABLE[6])
348
349
#define ROM_EComp_clearInterrupt \
350
((void ( __cc_rom *)(uint16_t baseAddress, \
351
uint16_t interruptFlagMask))ROM_ECOMPTABLE[7])
352
353
#define ROM_EComp_getInterruptStatus \
354
((uint8_t ( __cc_rom *)(uint16_t baseAddress, \
355
uint16_t interruptFlagMask))ROM_ECOMPTABLE[8])
356
357
#define ROM_EComp_setInterruptEdgeDirection \
358
((void ( __cc_rom *)(uint16_t baseAddress, \
359
uint16_t edgeDirection))ROM_ECOMPTABLE[9])
360
361
#define ROM_EComp_toggleInterruptEdgeDirection \
362
((void ( __cc_rom *)(uint16_t baseAddress))ROM_ECOMPTABLE[10])
363
364
#define ROM_EComp_outputValue \
365
((uint8_t ( __cc_rom *)(uint16_t baseAddress))ROM_ECOMPTABLE[11])
366
367
#define ROM_EComp_configureDAC \
368
((void ( __cc_rom *)(uint16_t baseAddress, \
369
EComp_configureDACParam *param))ROM_ECOMPTABLE[12])
370
371
#define ROM_EComp_enableDAC \
372
((void ( __cc_rom *)(uint16_t baseAddress))ROM_ECOMPTABLE[13])
373
374
#define ROM_EComp_disableDAC \
375
((void ( __cc_rom *)(uint16_t baseAddress))ROM_ECOMPTABLE[14])
376
377
//*****************************************************************************
378
//
379
// Macros for calling ROM functions in the EUSCIASPI API.
380
//
381
//*****************************************************************************
382
383
#define ROM_EUSCI_A_SPI_initMaster \
384
((void ( __cc_rom *)(uint16_t baseAddress, \
385
EUSCI_A_SPI_initMasterParam *param))ROM_EUSCIASPITABLE[0])
386
387
#define ROM_EUSCI_A_SPI_select4PinFunctionality \
388
((void ( __cc_rom *)(uint16_t baseAddress, \
389
uint8_t select4PinFunctionality))ROM_EUSCIASPITABLE[1])
390
391
#define ROM_EUSCI_A_SPI_changeMasterClock \
392
((void ( __cc_rom *)(uint16_t baseAddress, \
393
EUSCI_A_SPI_changeMasterClockParam *param))ROM_EUSCIASPITABLE[2])
394
395
#define ROM_EUSCI_A_SPI_initSlave \
396
((void ( __cc_rom *)(uint16_t baseAddress, \
397
EUSCI_A_SPI_initSlaveParam *param))ROM_EUSCIASPITABLE[3])
398
399
#define ROM_EUSCI_A_SPI_changeClockPhasePolarity \
400
((void ( __cc_rom *)(uint16_t baseAddress, \
401
uint16_t clockPhase, \
402
uint16_t clockPolarity))ROM_EUSCIASPITABLE[4])
403
404
#define ROM_EUSCI_A_SPI_transmitData \
405
((void ( __cc_rom *)(uint16_t baseAddress, \
406
uint8_t transmitData))ROM_EUSCIASPITABLE[5])
407
408
#define ROM_EUSCI_A_SPI_receiveData \
409
((uint8_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIASPITABLE[6])
410
411
#define ROM_EUSCI_A_SPI_enableInterrupt \
412
((void ( __cc_rom *)(uint16_t baseAddress, \
413
uint8_t mask))ROM_EUSCIASPITABLE[7])
414
415
#define ROM_EUSCI_A_SPI_disableInterrupt \
416
((void ( __cc_rom *)(uint16_t baseAddress, \
417
uint8_t mask))ROM_EUSCIASPITABLE[8])
418
419
#define ROM_EUSCI_A_SPI_getInterruptStatus \
420
((uint8_t ( __cc_rom *)(uint16_t baseAddress, \
421
uint8_t mask))ROM_EUSCIASPITABLE[9])
422
423
#define ROM_EUSCI_A_SPI_clearInterrupt \
424
((void ( __cc_rom *)(uint16_t baseAddress, \
425
uint8_t mask))ROM_EUSCIASPITABLE[10])
426
427
#define ROM_EUSCI_A_SPI_enable \
428
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIASPITABLE[11])
429
430
#define ROM_EUSCI_A_SPI_disable \
431
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIASPITABLE[12])
432
433
#define ROM_EUSCI_A_SPI_getReceiveBufferAddress \
434
((uint32_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIASPITABLE[13])
435
436
#define ROM_EUSCI_A_SPI_isBusy \
437
((uint16_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIASPITABLE[14])
438
439
//*****************************************************************************
440
//
441
// Macros for calling ROM functions in the EUSCIAUART API.
442
//
443
//*****************************************************************************
444
445
#define ROM_EUSCI_A_UART_init \
446
((bool ( __cc_rom *)(uint16_t baseAddress, \
447
EUSCI_A_UART_initParam *param))ROM_EUSCIAUARTTABLE[0])
448
449
#define ROM_EUSCI_A_UART_transmitData \
450
((void ( __cc_rom *)(uint16_t baseAddress, \
451
uint8_t transmitData))ROM_EUSCIAUARTTABLE[1])
452
453
#define ROM_EUSCI_A_UART_receiveData \
454
((uint8_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIAUARTTABLE[2])
455
456
#define ROM_EUSCI_A_UART_enableInterrupt \
457
((void ( __cc_rom *)(uint16_t baseAddress, \
458
uint8_t mask))ROM_EUSCIAUARTTABLE[3])
459
460
#define ROM_EUSCI_A_UART_disableInterrupt \
461
((void ( __cc_rom *)(uint16_t baseAddress, \
462
uint8_t mask))ROM_EUSCIAUARTTABLE[4])
463
464
#define ROM_EUSCI_A_UART_getInterruptStatus \
465
((uint8_t ( __cc_rom *)(uint16_t baseAddress, \
466
uint8_t mask))ROM_EUSCIAUARTTABLE[5])
467
468
#define ROM_EUSCI_A_UART_clearInterrupt \
469
((void ( __cc_rom *)(uint16_t baseAddress, \
470
uint8_t mask))ROM_EUSCIAUARTTABLE[6])
471
472
#define ROM_EUSCI_A_UART_enable \
473
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIAUARTTABLE[7])
474
475
#define ROM_EUSCI_A_UART_disable \
476
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIAUARTTABLE[8])
477
478
#define ROM_EUSCI_A_UART_queryStatusFlags \
479
((uint8_t ( __cc_rom *)(uint16_t baseAddress, \
480
uint8_t mask))ROM_EUSCIAUARTTABLE[9])
481
482
#define ROM_EUSCI_A_UART_setDormant \
483
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIAUARTTABLE[10])
484
485
#define ROM_EUSCI_A_UART_resetDormant \
486
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIAUARTTABLE[11])
487
488
#define ROM_EUSCI_A_UART_transmitAddress \
489
((void ( __cc_rom *)(uint16_t baseAddress, \
490
uint8_t transmitAddress))ROM_EUSCIAUARTTABLE[12])
491
492
#define ROM_EUSCI_A_UART_transmitBreak \
493
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIAUARTTABLE[13])
494
495
#define ROM_EUSCI_A_UART_getReceiveBufferAddress \
496
((uint32_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIAUARTTABLE[14])
497
498
#define ROM_EUSCI_A_UART_getTransmitBufferAddress \
499
((uint32_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIAUARTTABLE[15])
500
501
#define ROM_EUSCI_A_UART_selectDeglitchTime \
502
((void ( __cc_rom *)(uint16_t baseAddress, \
503
uint16_t deglitchTime))ROM_EUSCIAUARTTABLE[16])
504
505
//*****************************************************************************
506
//
507
// Macros for calling ROM functions in the EUSCIBI2C API.
508
//
509
//*****************************************************************************
510
511
#define ROM_EUSCI_B_I2C_initMaster \
512
((void ( __cc_rom *)(uint16_t baseAddress, \
513
EUSCI_B_I2C_initMasterParam *param))ROM_EUSCIBI2CTABLE[0])
514
515
#define ROM_EUSCI_B_I2C_initSlave \
516
((void ( __cc_rom *)(uint16_t baseAddress, \
517
EUSCI_B_I2C_initSlaveParam *param))ROM_EUSCIBI2CTABLE[1])
518
519
#define ROM_EUSCI_B_I2C_enable \
520
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[2])
521
522
#define ROM_EUSCI_B_I2C_disable \
523
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[3])
524
525
#define ROM_EUSCI_B_I2C_setSlaveAddress \
526
((void ( __cc_rom *)(uint16_t baseAddress, \
527
uint8_t slaveAddress))ROM_EUSCIBI2CTABLE[4])
528
529
#define ROM_EUSCI_B_I2C_setMode \
530
((void ( __cc_rom *)(uint16_t baseAddress, \
531
uint8_t mode))ROM_EUSCIBI2CTABLE[5])
532
533
#define ROM_EUSCI_B_I2C_getMode \
534
((uint8_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[6])
535
536
#define ROM_EUSCI_B_I2C_slavePutData \
537
((void ( __cc_rom *)(uint16_t baseAddress, \
538
uint8_t transmitData))ROM_EUSCIBI2CTABLE[7])
539
540
#define ROM_EUSCI_B_I2C_slaveGetData \
541
((uint8_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[8])
542
543
#define ROM_EUSCI_B_I2C_isBusBusy \
544
((uint16_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[9])
545
546
#define ROM_EUSCI_B_I2C_masterIsStopSent \
547
((uint16_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[10])
548
549
#define ROM_EUSCI_B_I2C_masterReceiveSingleByte \
550
((uint8_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[11])
551
552
#define ROM_EUSCI_B_I2C_masterIsStartSent \
553
((uint16_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[12])
554
555
#define ROM_EUSCI_B_I2C_enableInterrupt \
556
((void ( __cc_rom *)(uint16_t baseAddress, \
557
uint16_t mask))ROM_EUSCIBI2CTABLE[13])
558
559
#define ROM_EUSCI_B_I2C_disableInterrupt \
560
((void ( __cc_rom *)(uint16_t baseAddress, \
561
uint16_t mask))ROM_EUSCIBI2CTABLE[14])
562
563
#define ROM_EUSCI_B_I2C_clearInterrupt \
564
((void ( __cc_rom *)(uint16_t baseAddress, \
565
uint16_t mask))ROM_EUSCIBI2CTABLE[15])
566
567
#define ROM_EUSCI_B_I2C_getInterruptStatus \
568
((uint16_t ( __cc_rom *)(uint16_t baseAddress, \
569
uint16_t mask))ROM_EUSCIBI2CTABLE[16])
570
571
#define ROM_EUSCI_B_I2C_masterSendSingleByte \
572
((void ( __cc_rom *)(uint16_t baseAddress, \
573
uint8_t txData))ROM_EUSCIBI2CTABLE[17])
574
575
#define ROM_EUSCI_B_I2C_masterSendSingleByteWithTimeout \
576
((bool ( __cc_rom *)(uint16_t baseAddress, \
577
uint8_t txData, \
578
uint32_t timeout))ROM_EUSCIBI2CTABLE[18])
579
580
#define ROM_EUSCI_B_I2C_masterSendMultiByteStart \
581
((void ( __cc_rom *)(uint16_t baseAddress, \
582
uint8_t txData))ROM_EUSCIBI2CTABLE[19])
583
584
#define ROM_EUSCI_B_I2C_masterSendMultiByteStartWithTimeout \
585
((bool ( __cc_rom *)(uint16_t baseAddress, \
586
uint8_t txData, \
587
uint32_t timeout))ROM_EUSCIBI2CTABLE[20])
588
589
#define ROM_EUSCI_B_I2C_masterSendMultiByteNext \
590
((void ( __cc_rom *)(uint16_t baseAddress, \
591
uint8_t txData))ROM_EUSCIBI2CTABLE[21])
592
593
#define ROM_EUSCI_B_I2C_masterSendMultiByteNextWithTimeout \
594
((bool ( __cc_rom *)(uint16_t baseAddress, \
595
uint8_t txData, \
596
uint32_t timeout))ROM_EUSCIBI2CTABLE[22])
597
598
#define ROM_EUSCI_B_I2C_masterSendMultiByteFinish \
599
((void ( __cc_rom *)(uint16_t baseAddress, \
600
uint8_t txData))ROM_EUSCIBI2CTABLE[23])
601
602
#define ROM_EUSCI_B_I2C_masterSendMultiByteFinishWithTimeout \
603
((bool ( __cc_rom *)(uint16_t baseAddress, \
604
uint8_t txData, \
605
uint32_t timeout))ROM_EUSCIBI2CTABLE[24])
606
607
#define ROM_EUSCI_B_I2C_masterSendStart \
608
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[25])
609
610
#define ROM_EUSCI_B_I2C_masterSendMultiByteStop \
611
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[26])
612
613
#define ROM_EUSCI_B_I2C_masterReceiveStart \
614
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[28])
615
616
#define ROM_EUSCI_B_I2C_masterReceiveMultiByteNext \
617
((uint8_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[29])
618
619
#define ROM_EUSCI_B_I2C_masterReceiveMultiByteFinish \
620
((uint8_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[30])
621
622
#define ROM_EUSCI_B_I2C_masterReceiveMultiByteFinishWithTimeout \
623
((bool ( __cc_rom *)(uint16_t baseAddress, \
624
uint8_t *txData, \
625
uint32_t timeout))ROM_EUSCIBI2CTABLE[31])
626
627
#define ROM_EUSCI_B_I2C_masterReceiveMultiByteStop \
628
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[32])
629
630
#define ROM_EUSCI_B_I2C_enableMultiMasterMode \
631
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[33])
632
633
#define ROM_EUSCI_B_I2C_disableMultiMasterMode \
634
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[34])
635
636
#define ROM_EUSCI_B_I2C_masterReceiveSingle \
637
((uint8_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[35])
638
639
#define ROM_EUSCI_B_I2C_getReceiveBufferAddress \
640
((uint32_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[36])
641
642
#define ROM_EUSCI_B_I2C_getTransmitBufferAddress \
643
((uint32_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBI2CTABLE[37])
644
645
#define ROM_EUSCI_B_I2C_remapPins \
646
((void ( __cc_rom *)(uint16_t baseAddress, \
647
uint8_t pinsSelect))ROM_EUSCIBI2CTABLE[38])
648
649
//*****************************************************************************
650
//
651
// Macros for calling ROM functions in the EUSCIBSPI API.
652
//
653
//*****************************************************************************
654
655
#define ROM_EUSCI_B_SPI_initMaster \
656
((void ( __cc_rom *)(uint16_t baseAddress, \
657
EUSCI_B_SPI_initMasterParam *param))ROM_EUSCIBSPITABLE[0])
658
659
#define ROM_EUSCI_B_SPI_select4PinFunctionality \
660
((void ( __cc_rom *)(uint16_t baseAddress, \
661
uint8_t select4PinFunctionality))ROM_EUSCIBSPITABLE[1])
662
663
#define ROM_EUSCI_B_SPI_changeMasterClock \
664
((void ( __cc_rom *)(uint16_t baseAddress, \
665
EUSCI_B_SPI_changeMasterClockParam *param))ROM_EUSCIBSPITABLE[2])
666
667
#define ROM_EUSCI_B_SPI_initSlave \
668
((void ( __cc_rom *)(uint16_t baseAddress, \
669
EUSCI_B_SPI_initSlaveParam *param))ROM_EUSCIBSPITABLE[3])
670
671
#define ROM_EUSCI_B_SPI_changeClockPhasePolarity \
672
((void ( __cc_rom *)(uint16_t baseAddress, \
673
uint16_t clockPhase, \
674
uint16_t clockPolarity))ROM_EUSCIBSPITABLE[4])
675
676
#define ROM_EUSCI_B_SPI_transmitData \
677
((void ( __cc_rom *)(uint16_t baseAddress, \
678
uint8_t transmitData))ROM_EUSCIBSPITABLE[5])
679
680
#define ROM_EUSCI_B_SPI_receiveData \
681
((uint8_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBSPITABLE[6])
682
683
#define ROM_EUSCI_B_SPI_enableInterrupt \
684
((void ( __cc_rom *)(uint16_t baseAddress, \
685
uint8_t mask))ROM_EUSCIBSPITABLE[7])
686
687
#define ROM_EUSCI_B_SPI_disableInterrupt \
688
((void ( __cc_rom *)(uint16_t baseAddress, \
689
uint8_t mask))ROM_EUSCIBSPITABLE[8])
690
691
#define ROM_EUSCI_B_SPI_getInterruptStatus \
692
((uint8_t ( __cc_rom *)(uint16_t baseAddress, \
693
uint8_t mask))ROM_EUSCIBSPITABLE[9])
694
695
#define ROM_EUSCI_B_SPI_clearInterrupt \
696
((void ( __cc_rom *)(uint16_t baseAddress, \
697
uint8_t mask))ROM_EUSCIBSPITABLE[10])
698
699
#define ROM_EUSCI_B_SPI_enable \
700
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBSPITABLE[11])
701
702
#define ROM_EUSCI_B_SPI_disable \
703
((void ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBSPITABLE[12])
704
705
#define ROM_EUSCI_B_SPI_getReceiveBufferAddress \
706
((uint32_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBSPITABLE[13])
707
708
#define ROM_EUSCI_B_SPI_getTransmitBufferAddress \
709
((uint32_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBSPITABLE[14])
710
711
#define ROM_EUSCI_B_SPI_isBusy \
712
((uint16_t ( __cc_rom *)(uint16_t baseAddress))ROM_EUSCIBSPITABLE[15])
713
714
#define ROM_EUSCI_B_SPI_remapPins \
715
((void ( __cc_rom *)(uint16_t baseAddress, \
716
uint8_t pinsSelect))ROM_EUSCIBSPITABLE[16])
717
718
//*****************************************************************************
719
//
720
// Macros for calling ROM functions in the FRAMCTL API.
721
//
722
//*****************************************************************************
723
724
#define ROM_FRAMCtl_write8 \
725
((void ( __cc_rom *)(uint8_t *dataPtr, \
726
uint8_t *framPtr, \
727
uint16_t numberOfBytes))ROM_FRAMCTLTABLE[0])
728
729
#define ROM_FRAMCtl_write16 \
730
((void ( __cc_rom *)(uint16_t *dataPtr, \
731
uint16_t *framPtr, \
732
uint16_t numberOfWords))ROM_FRAMCTLTABLE[1])
733
734
#define ROM_FRAMCtl_write32 \
735
((void ( __cc_rom *)(uint32_t *dataPtr, \
736
uint32_t *framPtr, \
737
uint16_t count))ROM_FRAMCTLTABLE[2])
738
739
#define ROM_FRAMCtl_fillMemory32 \
740
((void ( __cc_rom *)(uint32_t value, \
741
uint32_t *framPtr, \
742
uint16_t count))ROM_FRAMCTLTABLE[3])
743
744
#define ROM_FRAMCtl_enableInterrupt \
745
((void ( __cc_rom *)(uint8_t interruptMask))ROM_FRAMCTLTABLE[4])
746
747
#define ROM_FRAMCtl_getInterruptStatus \
748
((uint8_t ( __cc_rom *)(uint16_t interruptFlagMask))ROM_FRAMCTLTABLE[5])
749
750
#define ROM_FRAMCtl_disableInterrupt \
751
((void ( __cc_rom *)(uint16_t interruptMask))ROM_FRAMCTLTABLE[6])
752
753
#define ROM_FRAMCtl_configureWaitStateControl \
754
((void ( __cc_rom *)(uint8_t waitState))ROM_FRAMCTLTABLE[7])
755
756
#define ROM_FRAMCtl_delayPowerUpFromLPM \
757
((void ( __cc_rom *)(uint8_t delayStatus))ROM_FRAMCTLTABLE[8])
758
759
//*****************************************************************************
760
//
761
// Macros for calling ROM functions in the GPIO API.
762
//
763
//*****************************************************************************
764
765
#define ROM_GPIO_setAsOutputPin \
766
((void ( __cc_rom *)(uint8_t selectedPort, \
767
uint16_t selectedPins))ROM_GPIOTABLE[0])
768
769
#define ROM_GPIO_setAsInputPin \
770
((void ( __cc_rom *)(uint8_t selectedPort, \
771
uint16_t selectedPins))ROM_GPIOTABLE[1])
772
773
#define ROM_GPIO_setAsPeripheralModuleFunctionOutputPin \
774
((void ( __cc_rom *)(uint8_t selectedPort, \
775
uint16_t selectedPins, \
776
uint8_t mode))ROM_GPIOTABLE[2])
777
778
#define ROM_GPIO_setAsPeripheralModuleFunctionInputPin \
779
((void ( __cc_rom *)(uint8_t selectedPort, \
780
uint16_t selectedPins, \
781
uint8_t mode))ROM_GPIOTABLE[3])
782
783
#define ROM_GPIO_setOutputHighOnPin \
784
((void ( __cc_rom *)(uint8_t selectedPort, \
785
uint16_t selectedPins))ROM_GPIOTABLE[4])
786
787
#define ROM_GPIO_setOutputLowOnPin \
788
((void ( __cc_rom *)(uint8_t selectedPort, \
789
uint16_t selectedPins))ROM_GPIOTABLE[5])
790
791
#define ROM_GPIO_toggleOutputOnPin \
792
((void ( __cc_rom *)(uint8_t selectedPort, \
793
uint16_t selectedPins))ROM_GPIOTABLE[6])
794
795
#define ROM_GPIO_setAsInputPinWithPullDownResistor \
796
((void ( __cc_rom *)(uint8_t selectedPort, \
797
uint16_t selectedPins))ROM_GPIOTABLE[7])
798
799
#define ROM_GPIO_setAsInputPinWithPullUpResistor \
800
((void ( __cc_rom *)(uint8_t selectedPort, \
801
uint16_t selectedPins))ROM_GPIOTABLE[8])
802
803
#define ROM_GPIO_getInputPinValue \
804
((uint8_t ( __cc_rom *)(uint8_t selectedPort, \
805
uint16_t selectedPins))ROM_GPIOTABLE[9])
806
807
#define ROM_GPIO_enableInterrupt \
808
((void ( __cc_rom *)(uint8_t selectedPort, \
809
uint16_t selectedPins))ROM_GPIOTABLE[10])
810
811
#define ROM_GPIO_disableInterrupt \
812
((void ( __cc_rom *)(uint8_t selectedPort, \
813
uint16_t selectedPins))ROM_GPIOTABLE[11])
814
815
#define ROM_GPIO_getInterruptStatus \
816
((uint16_t ( __cc_rom *)(uint8_t selectedPort, \
817
uint16_t selectedPins))ROM_GPIOTABLE[12])
818
819
#define ROM_GPIO_clearInterrupt \
820
((void ( __cc_rom *)(uint8_t selectedPort, \
821
uint16_t selectedPins))ROM_GPIOTABLE[13])
822
823
#define ROM_GPIO_selectInterruptEdge \
824
((void ( __cc_rom *)(uint8_t selectedPort, \
825
uint16_t selectedPins, \
826
uint8_t edgeSelect))ROM_GPIOTABLE[14])
827
828
//*****************************************************************************
829
//
830
// Macros for calling ROM functions in the ICC API.
831
//
832
//*****************************************************************************
833
834
#define ROM_ICC_enable \
835
((void ( __cc_rom *)(void))ROM_ICCTABLE[0])
836
837
#define ROM_ICC_disable \
838
((void ( __cc_rom *)(void))ROM_ICCTABLE[1])
839
840
#define ROM_ICC_setInterruptLevel \
841
((void ( __cc_rom *)(uint32_t ILSRmask, \
842
uint8_t interruptLevel))ROM_ICCTABLE[2])
843
844
#define ROM_ICC_getInterruptLevel \
845
((uint8_t ( __cc_rom *)(uint32_t interruptSource))ROM_ICCTABLE[3])
846
847
#define ROM_ICC_isVirtualStackEmpty \
848
((bool ( __cc_rom *)(void))ROM_ICCTABLE[4])
849
850
#define ROM_ICC_isVirtualStackFull \
851
((bool ( __cc_rom *)(void))ROM_ICCTABLE[5])
852
853
#define ROM_ICC_getCurrentICM \
854
((uint8_t ( __cc_rom *)(void))ROM_ICCTABLE[6])
855
856
#define ROM_ICC_getMVSStackPointer \
857
((uint8_t ( __cc_rom *)(void))ROM_ICCTABLE[7])
858
859
#define ROM_ICC_getICM3 \
860
((uint8_t ( __cc_rom *)(void))ROM_ICCTABLE[8])
861
862
#define ROM_ICC_getICM2 \
863
((uint8_t ( __cc_rom *)(void))ROM_ICCTABLE[9])
864
865
#define ROM_ICC_getICM1 \
866
((uint8_t ( __cc_rom *)(void))ROM_ICCTABLE[10])
867
868
#define ROM_ICC_getICM0 \
869
((uint8_t ( __cc_rom *)(void))ROM_ICCTABLE[11])
870
871
//*****************************************************************************
872
//
873
// Macros for calling ROM functions in the MPY32 API.
874
//
875
//*****************************************************************************
876
877
#define ROM_MPY32_setWriteDelay \
878
((void ( __cc_rom *)(uint16_t writeDelaySelect))ROM_MPY32TABLE[0])
879
880
#define ROM_MPY32_enableSaturationMode \
881
((void ( __cc_rom *)(void))ROM_MPY32TABLE[1])
882
883
#define ROM_MPY32_disableSaturationMode \
884
((void ( __cc_rom *)(void))ROM_MPY32TABLE[2])
885
886
#define ROM_MPY32_getSaturationMode \
887
((uint8_t ( __cc_rom *)(void))ROM_MPY32TABLE[3])
888
889
#define ROM_MPY32_enableFractionalMode \
890
((void ( __cc_rom *)(void))ROM_MPY32TABLE[4])
891
892
#define ROM_MPY32_disableFractionalMode \
893
((void ( __cc_rom *)(void))ROM_MPY32TABLE[5])
894
895
#define ROM_MPY32_getFractionalMode \
896
((uint8_t ( __cc_rom *)(void))ROM_MPY32TABLE[6])
897
898
#define ROM_MPY32_setOperandOne8Bit \
899
((void ( __cc_rom *)(uint8_t multiplicationType, \
900
uint8_t operand))ROM_MPY32TABLE[7])
901
902
#define ROM_MPY32_setOperandOne16Bit \
903
((void ( __cc_rom *)(uint8_t multiplicationType, \
904
uint16_t operand))ROM_MPY32TABLE[8])
905
906
#define ROM_MPY32_setOperandTwo8Bit \
907
((void ( __cc_rom *)(uint8_t operand))ROM_MPY32TABLE[11])
908
909
#define ROM_MPY32_setOperandTwo16Bit \
910
((void ( __cc_rom *)(uint16_t operand))ROM_MPY32TABLE[12])
911
912
#define ROM_MPY32_setOperandTwo24Bit \
913
((void ( __cc_rom *)(uint32_t operand))ROM_MPY32TABLE[13])
914
915
#define ROM_MPY32_setOperandTwo32Bit \
916
((void ( __cc_rom *)(uint32_t operand))ROM_MPY32TABLE[14])
917
918
#define ROM_MPY32_getResult \
919
((uint64_t ( __cc_rom *)(void))ROM_MPY32TABLE[15])
920
921
#define ROM_MPY32_getSumExtension \
922
((uint16_t ( __cc_rom *)(void))ROM_MPY32TABLE[16])
923
924
#define ROM_MPY32_getCarryBitValue \
925
((uint16_t ( __cc_rom *)(void))ROM_MPY32TABLE[17])
926
927
#define ROM_MPY32_clearCarryBitValue \
928
((void ( __cc_rom *)(void))ROM_MPY32TABLE[18])
929
930
#define ROM_MPY32_preloadResult \
931
((void ( __cc_rom *)(uint64_t result))ROM_MPY32TABLE[19])
932
933
//*****************************************************************************
934
//
935
// Macros for calling ROM functions in the PMM API.
936
//
937
//*****************************************************************************
938
939
#define ROM_PMM_enableSVSH \
940
((void ( __cc_rom *)(void))ROM_PMMTABLE[0])
941
942
#define ROM_PMM_disableSVSH \
943
((void ( __cc_rom *)(void))ROM_PMMTABLE[1])
944
945
#define ROM_PMM_turnOnRegulator \
946
((void ( __cc_rom *)(void))ROM_PMMTABLE[2])
947
948
#define ROM_PMM_turnOffRegulator \
949
((void ( __cc_rom *)(void))ROM_PMMTABLE[3])
950
951
#define ROM_PMM_trigPOR \
952
((void ( __cc_rom *)(void))ROM_PMMTABLE[4])
953
954
#define ROM_PMM_trigBOR \
955
((void ( __cc_rom *)(void))ROM_PMMTABLE[5])
956
957
#define ROM_PMM_clearInterrupt \
958
((void ( __cc_rom *)(uint16_t mask))ROM_PMMTABLE[6])
959
960
#define ROM_PMM_getInterruptStatus \
961
((uint16_t ( __cc_rom *)(uint16_t mask))ROM_PMMTABLE[7])
962
963
#define ROM_PMM_unlockLPM5 \
964
((void ( __cc_rom *)(void))ROM_PMMTABLE[8])
965
966
#define ROM_PMM_getBandgapMode \
967
((uint16_t ( __cc_rom *)(void))ROM_PMMTABLE[9])
968
969
#define ROM_PMM_isBandgapActive \
970
((uint16_t ( __cc_rom *)(void))ROM_PMMTABLE[10])
971
972
#define ROM_PMM_isRefGenActive \
973
((uint16_t ( __cc_rom *)(void))ROM_PMMTABLE[11])
974
975
#define ROM_PMM_getBufferedBandgapVoltageStatus \
976
((uint16_t ( __cc_rom *)(void))ROM_PMMTABLE[12])
977
978
#define ROM_PMM_getVariableReferenceVoltageStatus \
979
((uint16_t ( __cc_rom *)(void))ROM_PMMTABLE[13])
980
981
#define ROM_PMM_disableTempSensor \
982
((void ( __cc_rom *)(void))ROM_PMMTABLE[14])
983
984
#define ROM_PMM_enableTempSensor \
985
((void ( __cc_rom *)(void))ROM_PMMTABLE[15])
986
987
#define ROM_PMM_disableExternalReference \
988
((void ( __cc_rom *)(void))ROM_PMMTABLE[16])
989
990
#define ROM_PMM_enableExternalReference \
991
((void ( __cc_rom *)(void))ROM_PMMTABLE[17])
992
993
#define ROM_PMM_disableInternalReference \
994
((void ( __cc_rom *)(void))ROM_PMMTABLE[18])
995
996
#define ROM_PMM_enableInternalReference \
997
((void ( __cc_rom *)(void))ROM_PMMTABLE[19])
998
999
#define ROM_PMM_selectVoltageReference \
1000
((void ( __cc_rom *)(uint8_t refV))ROM_PMMTABLE[20])
1001
1002
#define ROM_PMM_setPowerMode \
1003
((void ( __cc_rom *)(uint8_t mode))ROM_PMMTABLE[21])
1004
1005
//*****************************************************************************
1006
//
1007
// Macros for calling ROM functions in the RTC API.
1008
//
1009
//*****************************************************************************
1010
1011
#define ROM_RTC_init \
1012
((void ( __cc_rom *)(uint16_t baseAddress, \
1013
uint16_t modulo, \
1014
uint16_t clockPredivider))ROM_RTCTABLE[0])
1015
1016
#define ROM_RTC_start \
1017
((void ( __cc_rom *)(uint16_t baseAddress, \
1018
uint16_t clockSource))ROM_RTCTABLE[1])
1019
1020
#define ROM_RTC_stop \
1021
((void ( __cc_rom *)(uint16_t baseAddress))ROM_RTCTABLE[2])
1022
1023
#define ROM_RTC_setModulo \
1024
((void ( __cc_rom *)(uint16_t baseAddress, \
1025
uint16_t modulo))ROM_RTCTABLE[3])
1026
1027
#define ROM_RTC_enableInterrupt \
1028
((void ( __cc_rom *)(uint16_t baseAddress, \
1029
uint8_t interruptMask))ROM_RTCTABLE[4])
1030
1031
#define ROM_RTC_disableInterrupt \
1032
((void ( __cc_rom *)(uint16_t baseAddress, \
1033
uint8_t interruptMask))ROM_RTCTABLE[5])
1034
1035
#define ROM_RTC_getInterruptStatus \
1036
((uint8_t ( __cc_rom *)(uint16_t baseAddress, \
1037
uint8_t interruptFlagMask))ROM_RTCTABLE[6])
1038
1039
#define ROM_RTC_clearInterrupt \
1040
((void ( __cc_rom *)(uint16_t baseAddress, \
1041
int8_t interruptFlagMask))ROM_RTCTABLE[7])
1042
1043
//*****************************************************************************
1044
//
1045
// Macros for calling ROM functions in the SAC API.
1046
//
1047
//*****************************************************************************
1048
1049
// The following devices in this family do not have this module
1050
#if !defined(__MSP430FR2153__) && !defined(__MSP430FR2155__)
1051
#define ROM_SAC_OA_init \
1052
((void ( __cc_rom *)(uint16_t baseAddress, \
1053
uint16_t positiveInput, \
1054
uint16_t negativeInput))ROM_SACTABLE[0])
1055
1056
#define ROM_SAC_OA_selectPowerMode \
1057
((void ( __cc_rom *)(uint16_t baseAddress, \
1058
uint16_t powerMode))ROM_SACTABLE[1])
1059
1060
#define ROM_SAC_OA_enable \
1061
((void ( __cc_rom *)(uint16_t baseAddress))ROM_SACTABLE[2])
1062
1063
#define ROM_SAC_OA_disable \
1064
((void ( __cc_rom *)(uint16_t baseAddress))ROM_SACTABLE[3])
1065
1066
#define ROM_SAC_enable \
1067
((void ( __cc_rom *)(uint16_t baseAddress))ROM_SACTABLE[4])
1068
1069
#define ROM_SAC_disable \
1070
((void ( __cc_rom *)(uint16_t baseAddress))ROM_SACTABLE[5])
1071
1072
#define ROM_SAC_PGA_setMode \
1073
((void ( __cc_rom *)(uint16_t baseAddress, \
1074
uint8_t mode))ROM_SACTABLE[6])
1075
1076
#define ROM_SAC_PGA_setGain \
1077
((void ( __cc_rom *)(uint16_t baseAddress, \
1078
uint8_t gain))ROM_SACTABLE[7])
1079
1080
#define ROM_SAC_DAC_enable \
1081
((void ( __cc_rom *)(uint16_t baseAddress))ROM_SACTABLE[8])
1082
1083
#define ROM_SAC_DAC_disable \
1084
((void ( __cc_rom *)(uint16_t baseAddress))ROM_SACTABLE[9])
1085
1086
#define ROM_SAC_DAC_interruptEnable \
1087
((void ( __cc_rom *)(uint16_t baseAddress))ROM_SACTABLE[10])
1088
1089
#define ROM_SAC_DAC_interruptDisable \
1090
((void ( __cc_rom *)(uint16_t baseAddress))ROM_SACTABLE[11])
1091
1092
#define ROM_SAC_DAC_DMARequestEnable \
1093
((void ( __cc_rom *)(uint16_t baseAddress))ROM_SACTABLE[12])
1094
1095
#define ROM_SAC_DAC_DMARequestDisable \
1096
((void ( __cc_rom *)(uint16_t baseAddress))ROM_SACTABLE[13])
1097
1098
#define ROM_SAC_DAC_selectLoad \
1099
((void ( __cc_rom *)(uint16_t baseAddress, \
1100
uint16_t load))ROM_SACTABLE[14])
1101
1102
#define ROM_SAC_DAC_selectRefVoltage \
1103
((void ( __cc_rom *)(uint16_t baseAddress, \
1104
uint16_t reference))ROM_SACTABLE[15])
1105
1106
#define ROM_SAC_DAC_getData \
1107
((uint16_t ( __cc_rom *)(uint16_t baseAddress))ROM_SACTABLE[16])
1108
1109
#define ROM_SAC_DAC_setData \
1110
((void ( __cc_rom *)(uint16_t baseAddress, \
1111
uint16_t data))ROM_SACTABLE[17])
1112
1113
#define ROM_SAC_DAC_getIFG \
1114
((bool ( __cc_rom *)(uint16_t baseAddress))ROM_SACTABLE[18])
1115
1116
#define ROM_SAC_DAC_clearIFG \
1117
((void ( __cc_rom *)(uint16_t baseAddress))ROM_SACTABLE[19])
1118
1119
#define ROM_SAC_getInterruptVector \
1120
((uint16_t ( __cc_rom *)(uint16_t baseAddress))ROM_SACTABLE[20])
1121
#endif // !defined __MSP430FR2153__ __MSP430FR2155__
1122
1123
//*****************************************************************************
1124
//
1125
// Macros for calling ROM functions in the SFR API.
1126
//
1127
//*****************************************************************************
1128
1129
#define ROM_SFR_enableInterrupt \
1130
((void ( __cc_rom *)(uint8_t interruptMask))ROM_SFRTABLE[0])
1131
1132
#define ROM_SFR_disableInterrupt \
1133
((void ( __cc_rom *)(uint8_t interruptMask))ROM_SFRTABLE[1])
1134
1135
#define ROM_SFR_getInterruptStatus \
1136
((uint8_t ( __cc_rom *)(uint8_t interruptFlagMask))ROM_SFRTABLE[2])
1137
1138
#define ROM_SFR_clearInterrupt \
1139
((void ( __cc_rom *)(uint8_t interruptFlagMask))ROM_SFRTABLE[3])
1140
1141
#define ROM_SFR_setResetPinPullResistor \
1142
((void ( __cc_rom *)(uint16_t pullResistorSetup))ROM_SFRTABLE[4])
1143
1144
#define ROM_SFR_setNMIEdge \
1145
((void ( __cc_rom *)(uint16_t edgeDirection))ROM_SFRTABLE[5])
1146
1147
#define ROM_SFR_setResetNMIPinFunction \
1148
((void ( __cc_rom *)(uint8_t resetPinFunction))ROM_SFRTABLE[6])
1149
1150
//*****************************************************************************
1151
//
1152
// Macros for calling ROM functions in the SYSCTL API.
1153
//
1154
//*****************************************************************************
1155
1156
#define ROM_SysCtl_enableDedicatedJTAGPins \
1157
((void ( __cc_rom *)(void))ROM_SYSCTLTABLE[0])
1158
1159
#define ROM_SysCtl_getBSLEntryIndication \
1160
((uint8_t ( __cc_rom *)(void))ROM_SYSCTLTABLE[1])
1161
1162
#define ROM_SysCtl_enablePMMAccessProtect \
1163
((void ( __cc_rom *)(void))ROM_SYSCTLTABLE[2])
1164
1165
#define ROM_SysCtl_enableRAMBasedInterruptVectors \
1166
((void ( __cc_rom *)(void))ROM_SYSCTLTABLE[3])
1167
1168
#define ROM_SysCtl_disableRAMBasedInterruptVectors \
1169
((void ( __cc_rom *)(void))ROM_SYSCTLTABLE[4])
1170
1171
#define ROM_SysCtl_enableBSLProtect \
1172
((void ( __cc_rom *)(void))ROM_SYSCTLTABLE[5])
1173
1174
#define ROM_SysCtl_disableBSLProtect \
1175
((void ( __cc_rom *)(void))ROM_SYSCTLTABLE[6])
1176
1177
#define ROM_SysCtl_enableBSLMemory \
1178
((void ( __cc_rom *)(void))ROM_SYSCTLTABLE[7])
1179
1180
#define ROM_SysCtl_disableBSLMemory \
1181
((void ( __cc_rom *)(void))ROM_SYSCTLTABLE[8])
1182
1183
#define ROM_SysCtl_setRAMAssignedToBSL \
1184
((void ( __cc_rom *)(uint8_t BSLRAMAssignment))ROM_SYSCTLTABLE[9])
1185
1186
#define ROM_SysCtl_initJTAGMailbox \
1187
((void ( __cc_rom *)(uint8_t mailboxSizeSelect, \
1188
uint8_t autoClearInboxFlagSelect))ROM_SYSCTLTABLE[10])
1189
1190
#define ROM_SysCtl_getJTAGMailboxFlagStatus \
1191
((uint8_t ( __cc_rom *)(uint8_t mailboxFlagMask))ROM_SYSCTLTABLE[11])
1192
1193
#define ROM_SysCtl_clearJTAGMailboxFlagStatus \
1194
((void ( __cc_rom *)(uint8_t mailboxFlagMask))ROM_SYSCTLTABLE[12])
1195
1196
#define ROM_SysCtl_getJTAGInboxMessage16Bit \
1197
((uint16_t ( __cc_rom *)(uint8_t inboxSelect))ROM_SYSCTLTABLE[13])
1198
1199
#define ROM_SysCtl_getJTAGInboxMessage32Bit \
1200
((uint32_t ( __cc_rom *)(void))ROM_SYSCTLTABLE[14])
1201
1202
#define ROM_SysCtl_setJTAGOutgoingMessage16Bit \
1203
((void ( __cc_rom *)(uint8_t outboxSelect, \
1204
uint16_t outgoingMessage))ROM_SYSCTLTABLE[15])
1205
1206
#define ROM_SysCtl_setJTAGOutgoingMessage32Bit \
1207
((void ( __cc_rom *)(uint32_t outgoingMessage))ROM_SYSCTLTABLE[16])
1208
1209
#define ROM_SysCtl_protectFRAMWrite \
1210
((void ( __cc_rom *)(uint8_t writeProtect))ROM_SYSCTLTABLE[17])
1211
1212
#define ROM_SysCtl_enableFRAMWrite \
1213
((void ( __cc_rom *)(uint8_t writeEnable))ROM_SYSCTLTABLE[18])
1214
1215
#define ROM_SysCtl_setInfraredConfig \
1216
((void ( __cc_rom *)(uint8_t dataSource, \
1217
uint8_t mode, \
1218
uint8_t polarity))ROM_SYSCTLTABLE[19])
1219
1220
#define ROM_SysCtl_enableInfrared \
1221
((void ( __cc_rom *)(void))ROM_SYSCTLTABLE[20])
1222
1223
#define ROM_SysCtl_disableInfrared \
1224
((void ( __cc_rom *)(void))ROM_SYSCTLTABLE[21])
1225
1226
#define ROM_SysCtl_getInfraredData \
1227
((uint8_t ( __cc_rom *)(void))ROM_SYSCTLTABLE[22])
1228
1229
#define ROM_SysCtl_setFRWPOA \
1230
((void ( __cc_rom *)(uint8_t offsetAddress))ROM_SYSCTLTABLE[23])
1231
1232
#define ROM_SysCtl_setHARTCLK \
1233
((void ( __cc_rom *)(uint8_t clockSource))ROM_SYSCTLTABLE[24])
1234
1235
#define ROM_SysCtl_setHARTMOD \
1236
((void ( __cc_rom *)(uint8_t mode))ROM_SYSCTLTABLE[25])
1237
1238
//*****************************************************************************
1239
//
1240
// Macros for calling ROM functions in the TIMERB API.
1241
//
1242
//*****************************************************************************
1243
1244
#define ROM_Timer_B_startCounter \
1245
((void ( __cc_rom *)(uint16_t baseAddress, \
1246
uint16_t timerMode))ROM_TIMER_BTABLE[0])
1247
1248
#define ROM_Timer_B_initContinuousMode \
1249
((void ( __cc_rom *)(uint16_t baseAddress, \
1250
Timer_B_initContinuousModeParam *param))ROM_TIMER_BTABLE[1])
1251
1252
#define ROM_Timer_B_initUpMode \
1253
((void ( __cc_rom *)(uint16_t baseAddress, \
1254
Timer_B_initUpModeParam *param))ROM_TIMER_BTABLE[2])
1255
1256
#define ROM_Timer_B_initUpDownMode \
1257
((void ( __cc_rom *)(uint16_t baseAddress, \
1258
Timer_B_initUpDownModeParam *param))ROM_TIMER_BTABLE[3])
1259
1260
#define ROM_Timer_B_initCaptureMode \
1261
((void ( __cc_rom *)(uint16_t baseAddress, \
1262
Timer_B_initCaptureModeParam *param))ROM_TIMER_BTABLE[4])
1263
1264
#define ROM_Timer_B_initCompareMode \
1265
((void ( __cc_rom *)(uint16_t baseAddress, \
1266
Timer_B_initCompareModeParam *param))ROM_TIMER_BTABLE[5])
1267
1268
#define ROM_Timer_B_enableInterrupt \
1269
((void ( __cc_rom *)(uint16_t baseAddress))ROM_TIMER_BTABLE[6])
1270
1271
#define ROM_Timer_B_disableInterrupt \
1272
((void ( __cc_rom *)(uint16_t baseAddress))ROM_TIMER_BTABLE[7])
1273
1274
#define ROM_Timer_B_getInterruptStatus \
1275
((uint32_t ( __cc_rom *)(uint16_t baseAddress))ROM_TIMER_BTABLE[8])
1276
1277
#define ROM_Timer_B_enableCaptureCompareInterrupt \
1278
((void ( __cc_rom *)(uint16_t baseAddress, \
1279
uint16_t captureCompareRegister))ROM_TIMER_BTABLE[9])
1280
1281
#define ROM_Timer_B_disableCaptureCompareInterrupt \
1282
((void ( __cc_rom *)(uint16_t baseAddress, \
1283
uint16_t captureCompareRegister))ROM_TIMER_BTABLE[10])
1284
1285
#define ROM_Timer_B_getCaptureCompareInterruptStatus \
1286
((uint32_t ( __cc_rom *)(uint16_t baseAddress, \
1287
uint16_t captureCompareRegister, \
1288
uint16_t mask))ROM_TIMER_BTABLE[11])
1289
1290
#define ROM_Timer_B_clear \
1291
((void ( __cc_rom *)(uint16_t baseAddress))ROM_TIMER_BTABLE[12])
1292
1293
#define ROM_Timer_B_getSynchronizedCaptureCompareInput \
1294
((uint8_t ( __cc_rom *)(uint16_t baseAddress, \
1295
uint16_t captureCompareRegister, \
1296
uint16_t synchronized))ROM_TIMER_BTABLE[13])
1297
1298
#define ROM_Timer_B_getOutputForOutputModeOutBitValue \
1299
((uint8_t ( __cc_rom *)(uint16_t baseAddress, \
1300
uint16_t captureCompareRegister))ROM_TIMER_BTABLE[14])
1301
1302
#define ROM_Timer_B_getCaptureCompareCount \
1303
((uint16_t ( __cc_rom *)(uint16_t baseAddress, \
1304
uint16_t captureCompareRegister))ROM_TIMER_BTABLE[15])
1305
1306
#define ROM_Timer_B_setOutputForOutputModeOutBitValue \
1307
((void ( __cc_rom *)(uint16_t baseAddress, \
1308
uint16_t captureCompareRegister, \
1309
uint8_t outputModeOutBitValue))ROM_TIMER_BTABLE[16])
1310
1311
#define ROM_Timer_B_outputPWM \
1312
((void ( __cc_rom *)(uint16_t baseAddress, \
1313
Timer_B_outputPWMParam *param))ROM_TIMER_BTABLE[17])
1314
1315
#define ROM_Timer_B_stop \
1316
((void ( __cc_rom *)(uint16_t baseAddress))ROM_TIMER_BTABLE[18])
1317
1318
#define ROM_Timer_B_setCompareValue \
1319
((void ( __cc_rom *)(uint16_t baseAddress, \
1320
uint16_t compareRegister, \
1321
uint16_t compareValue))ROM_TIMER_BTABLE[19])
1322
1323
#define ROM_Timer_B_clearTimerInterrupt \
1324
((void ( __cc_rom *)(uint16_t baseAddress))ROM_TIMER_BTABLE[20])
1325
1326
#define ROM_Timer_B_clearCaptureCompareInterrupt \
1327
((void ( __cc_rom *)(uint16_t baseAddress, \
1328
uint16_t captureCompareRegister))ROM_TIMER_BTABLE[21])
1329
1330
#define ROM_Timer_B_selectCounterLength \
1331
((void ( __cc_rom *)(uint16_t baseAddress, \
1332
uint16_t counterLength))ROM_TIMER_BTABLE[22])
1333
1334
#define ROM_Timer_B_selectLatchingGroup \
1335
((void ( __cc_rom *)(uint16_t baseAddress, \
1336
uint16_t groupLatch))ROM_TIMER_BTABLE[23])
1337
1338
#define ROM_Timer_B_initCompareLatchLoadEvent \
1339
((void ( __cc_rom *)(uint16_t baseAddress, \
1340
uint16_t compareRegister, \
1341
uint16_t compareLatchLoadEvent))ROM_TIMER_BTABLE[24])
1342
1343
#define ROM_Timer_B_getCounterValue \
1344
((uint16_t ( __cc_rom *)(uint16_t baseAddress))ROM_TIMER_BTABLE[25])
1345
1346
#define ROM_Timer_B_setOutputMode \
1347
((void ( __cc_rom *)(uint16_t baseAddress, \
1348
uint16_t compareRegister, \
1349
uint16_t compareOutputMode))ROM_TIMER_BTABLE[26])
1350
1351
#define ROM_Timer_B_selectOutputHighImpedanceTrigger \
1352
((void ( __cc_rom *)(uint16_t baseAddress, \
1353
uint8_t triggerSelect))ROM_TIMER_BTABLE[27])
1354
1355
//*****************************************************************************
1356
//
1357
// Macros for calling ROM functions in the TLV API.
1358
//
1359
//*****************************************************************************
1360
1361
#define ROM_TLV_getInfo \
1362
((void ( __cc_rom *)(uint8_t tag, \
1363
uint8_t instance, \
1364
uint8_t *length, \
1365
uint16_t **data_address))ROM_TLVTABLE[0])
1366
1367
#define ROM_TLV_getDeviceType \
1368
((uint16_t ( __cc_rom *)(void))ROM_TLVTABLE[1])
1369
1370
#define ROM_TLV_getMemory \
1371
((uint16_t ( __cc_rom *)(uint8_t instance))ROM_TLVTABLE[2])
1372
1373
#define ROM_TLV_getPeripheral \
1374
((uint16_t ( __cc_rom *)(uint8_t tag, \
1375
uint8_t instance))ROM_TLVTABLE[3])
1376
1377
#define ROM_TLV_getInterrupt \
1378
((uint8_t ( __cc_rom *)(uint8_t tag))ROM_TLVTABLE[4])
1379
1380
//*****************************************************************************
1381
//
1382
// Macros for calling ROM functions in the WDTA API.
1383
//
1384
//*****************************************************************************
1385
1386
#define ROM_WDT_A_hold \
1387
((void ( __cc_rom *)(uint16_t baseAddress))ROM_WDTATABLE[0])
1388
1389
#define ROM_WDT_A_start \
1390
((void ( __cc_rom *)(uint16_t baseAddress))ROM_WDTATABLE[1])
1391
1392
#define ROM_WDT_A_resetTimer \
1393
((void ( __cc_rom *)(uint16_t baseAddress))ROM_WDTATABLE[2])
1394
1395
#define ROM_WDT_A_initWatchdogTimer \
1396
((void ( __cc_rom *)(uint16_t baseAddress, \
1397
uint8_t clockSelect, \
1398
uint8_t clockDivider))ROM_WDTATABLE[3])
1399
1400
#define ROM_WDT_A_initIntervalTimer \
1401
((void ( __cc_rom *)(uint16_t baseAddress, \
1402
uint8_t clockSelect, \
1403
uint8_t clockDivider))ROM_WDTATABLE[4])
1404
1405
#else
1406
#error "Small code model is not supported because ROM lives above 64k memory."
1407
#endif
1408
1409
#endif // __ROM_DRIVERLIB_H__
1410
Copyright 2020, Texas Instruments Incorporated