iLLD_TC27xC
1.0
IfxMsc_Msc.h
Go to the documentation of this file.
1
/**
2
* \file IfxMsc_Msc.h
3
* \brief MSC MSC details
4
* \ingroup IfxLld_Msc
5
*
6
* \version iLLD_0_1_0_10
7
* \copyright Copyright (c) 2013 Infineon Technologies AG. All rights reserved.
8
*
9
*
10
* IMPORTANT NOTICE
11
*
12
*
13
* Infineon Technologies AG (Infineon) is supplying this file for use
14
* exclusively with Infineon's microcontroller products. This file can be freely
15
* distributed within development tools that are supporting such microcontroller
16
* products.
17
*
18
* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
19
* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
20
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
21
* INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
22
* OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
23
*
24
* \defgroup IfxLld_Msc_Msc_Usage How to use the MSC Interface driver?
25
* \ingroup IfxLld_Msc
26
*
27
* The MSC interface driver provides a default MSC configuration
28
*
29
*
30
*
31
* In the following sections it will be described, how to integrate the driver into the application framework.
32
*
33
* \section IfxLld_Msc_Msc_Preparation Preparation
34
* \subsection IfxLld_Msc_Msc_Include Include Files
35
*
36
* Include following header file into your C code:
37
* \code
38
* #include <Msc/Msc/IfxMsc_Msc.h>
39
* #include <msc_commands.h>
40
* \endcode
41
*
42
* \subsection IfxLld_Msc_Msc_Variables Variables
43
*
44
* Declare the MSC handle as global variable in your C code:
45
*
46
* \code
47
* // MSC handle
48
* static IfxMsc_Msc msc;
49
*
50
* // IO Pins
51
* static const IfxMsc_Msc_Io IfxMsc_PinMap[IFXMSC_COUNT] = {
52
* {
53
* { &IfxMsc0_FCLP_P13_1_OUT, IfxPort_OutputMode_pushPull },
54
* { &IfxMsc0_FCLN_P13_0_OUT, IfxPort_OutputMode_pushPull },
55
* { &IfxMsc0_SOP_P13_3_OUT, IfxPort_OutputMode_pushPull },
56
* { &IfxMsc0_SON_P13_2_OUT, IfxPort_OutputMode_pushPull },
57
* { &IfxMsc0_EN0_P10_3_OUT, IfxPort_OutputMode_pushPull },
58
* { &IfxMsc0_EN1_P11_2_OUT, IfxPort_OutputMode_pushPull },
59
* { &IfxMsc0_SDI0_P11_10_IN, IfxPort_InputMode_pullUp },
60
* { &IfxMsc0_INJ0_P00_0_IN, IfxPort_InputMode_pullUp },
61
* { &IfxMsc0_INJ1_P10_5_IN, IfxPort_InputMode_pullUp },
62
* IfxPort_PadDriver_cmosAutomotiveSpeed3
63
* },
64
*
65
* #if IFXMSC_COUNT >= 2
66
* {
67
* { &IfxMsc1_FCLP_P22_1_OUT, IfxPort_OutputMode_pushPull },
68
* { &IfxMsc1_FCLN_P22_0_OUT, IfxPort_OutputMode_pushPull },
69
* { &IfxMsc1_SOP_P22_3_OUT, IfxPort_OutputMode_pushPull },
70
* { &IfxMsc1_SON_P22_2_OUT, IfxPort_OutputMode_pushPull },
71
* { &IfxMsc1_EN0_P23_4_OUT, IfxPort_OutputMode_pushPull },
72
* { &IfxMsc1_EN1_P23_5_OUT, IfxPort_OutputMode_pushPull },
73
* { &IfxMsc1_SDI0_P23_1_IN, IfxPort_InputMode_pullUp },
74
* { &IfxMsc1_INJ0_P23_3_IN, IfxPort_InputMode_pullUp },
75
* { &IfxMsc1_INJ1_P33_13_IN, IfxPort_InputMode_pullUp },
76
* IfxPort_PadDriver_cmosAutomotiveSpeed3
77
* },
78
* #endif
79
*
80
* \endcode
81
*
82
* \subsection IfxLld_Msc_Msc_Init Module Initialisation
83
*
84
* The module initialisation can be done as followed:
85
* \code
86
* // create configuration (same is used for all MSCs)
87
* IfxMsc_Msc_Config mscConfig;
88
* IfxMsc_Msc_initModuleConfig(&mscConfig, &MODULE_MSC0);
89
*
90
* // increase baudrate for faster simulation:
91
* mscConfig.clockConfig.baudrate = 25000000;
92
* mscConfig.clockConfig.dividerMode = IfxMsc_DividerMode_fractional;
93
*
94
* // FCL only activated on transfers
95
* mscConfig.outputControlConfig.fclClockControl = IfxMsc_FclClockControlEnabled_activePhaseOnly;
96
*
97
* // in this case we also don't need a selection bit
98
* mscConfig.downstreamConfig.srlActivePhaseSelection = IfxMsc_ActivePhaseSelection_none;
99
* mscConfig.downstreamConfig.srhActivePhaseSelection = IfxMsc_ActivePhaseSelection_none;
100
*
101
* // initialize MSCs
102
* for(int i=0; i<IFXMSC_COUNT; ++i) {
103
* // init module pointer
104
* mscConfig.msc = (Ifx_MSC*)IfxMsc_cfg_indexMap[i].module;
105
*
106
* // IO Config
107
* mscConfig.io = IfxMsc_PinMap[i];
108
*
109
* // initialize module
110
* IfxMsc_Msc_initModule(&msc[i], &mscConfig);
111
* }
112
* \endcode
113
*
114
* The MSC is ready for use now!
115
*
116
*
117
* \section IfxLld_Msc_Msc_DataTransfers Data Transfers
118
*
119
* The MSC driver provides simple to use transfer function
120
*
121
* \code
122
* for(int n=0; n<10; ++n) {
123
* // clear IRQ flag of previous transfer
124
* for(int i=0; i<IFXMSC_COUNT; ++i) {
125
* msc[i].msc->ISC.B.CDEDI = 1;
126
* }
127
*
128
* // new transfer
129
* for(int i=0; i<IFXMSC_COUNT; ++i) {
130
* const unsigned dataL = i*0x1000 + n;
131
* const unsigned dataH = i*0x1000 + 0x0100 + n;
132
* IfxMsc_Msc_sendData(&msc[i], dataL, dataH);
133
* }
134
* // wait until transfers are finished
135
* for(int i=0; i<IFXMSC_COUNT; ++i) {
136
* while( !msc[i].msc->ISR.B.DEDI ); // check if new data could be written
137
* while( msc[i].msc->DSS.B.DFA ); // check if we are still in the active data phase
138
* }
139
* \endcode
140
*
141
* \defgroup IfxLld_Msc_Msc Msc
142
* \ingroup IfxLld_Msc
143
* \defgroup IfxLld_Msc_Msc_Enumerations Enumerations
144
* \ingroup IfxLld_Msc_Msc
145
* \defgroup IfxLld_Msc_Msc_Data_Structures Data Structures
146
* \ingroup IfxLld_Msc_Msc
147
* \defgroup IfxLld_Msc_Msc_Module_Initialize_Functions Module Initialize Functions
148
* \ingroup IfxLld_Msc_Msc
149
* \defgroup IfxLld_Msc_Msc_Send_Functions Send Functions
150
* \ingroup IfxLld_Msc_Msc
151
* \defgroup IfxLld_Msc_Msc_Receive_Functions Receive Functions
152
* \ingroup IfxLld_Msc_Msc
153
* \defgroup IfxLld_Msc_Msc_Target_Read_Write_Functions Target Read Write Functions
154
* \ingroup IfxLld_Msc_Msc
155
*/
156
157
#ifndef IFXMSC_MSC_H
158
#define IFXMSC_MSC_H 1
159
160
/******************************************************************************/
161
/*----------------------------------Includes----------------------------------*/
162
/******************************************************************************/
163
164
#include "
Msc/Std/IfxMsc.h
"
165
166
/******************************************************************************/
167
/*--------------------------------Enumerations--------------------------------*/
168
/******************************************************************************/
169
170
/** \addtogroup IfxLld_Msc_Msc_Enumerations
171
* \{ */
172
/** \brief Msc Instance Number
173
*/
174
typedef
enum
175
{
176
IfxMsc_Msc_Target_low
= 0,
/**< \brief MSC Target Low */
177
IfxMsc_Msc_Target_high
= 1
/**< \brief MSC Target High */
178
}
IfxMsc_Msc_Target
;
179
180
/** \} */
181
182
/******************************************************************************/
183
/*-----------------------------Data Structures--------------------------------*/
184
/******************************************************************************/
185
186
/** \addtogroup IfxLld_Msc_Msc_Data_Structures
187
* \{ */
188
typedef
struct
189
{
190
IfxMsc_En_Out
*
pin
;
191
IfxPort_OutputMode
mode
;
192
}
IfxMsc_Msc_en0
;
193
194
typedef
struct
195
{
196
IfxMsc_En_Out
*
pin
;
197
IfxPort_OutputMode
mode
;
198
}
IfxMsc_Msc_en1
;
199
200
typedef
struct
201
{
202
IfxMsc_Fcln_Out
*
pin
;
203
IfxPort_OutputMode
mode
;
204
}
IfxMsc_Msc_fcln
;
205
206
typedef
struct
207
{
208
IfxMsc_Fclp_Out
*
pin
;
209
IfxPort_OutputMode
mode
;
210
}
IfxMsc_Msc_fclp
;
211
212
typedef
struct
213
{
214
IfxMsc_Inj_In
*
pin
;
215
IfxPort_InputMode
mode
;
216
}
IfxMsc_Msc_inj0
;
217
218
typedef
struct
219
{
220
IfxMsc_Inj_In
*
pin
;
221
IfxPort_InputMode
mode
;
222
}
IfxMsc_Msc_inj1
;
223
224
typedef
struct
225
{
226
IfxMsc_Sdi_In
*
pin
;
227
IfxPort_InputMode
mode
;
228
}
IfxMsc_Msc_sdi
;
229
230
typedef
struct
231
{
232
IfxMsc_Son_Out
*
pin
;
233
IfxPort_OutputMode
mode
;
234
}
IfxMsc_Msc_son
;
235
236
typedef
struct
237
{
238
IfxMsc_Sop_Out
*
pin
;
239
IfxPort_OutputMode
mode
;
240
}
IfxMsc_Msc_sop
;
241
242
/** \} */
243
244
/** \addtogroup IfxLld_Msc_Msc_Data_Structures
245
* \{ */
246
/** \brief ABRA block Configuration Structure
247
*/
248
typedef
struct
249
{
250
uint32
abraDownstreamBlockBaudrate
;
/**< \brief Specifies ABRA downstream block baud */
251
IfxMsc_ShiftClockPhaseDuration
lowPhaseOfShiftClock
;
/**< \brief Specifies Low phase of shift clock */
252
IfxMsc_ShiftClockPhaseDuration
highPhaseOfShiftClock
;
/**< \brief Specifies High phase of shift clock */
253
IfxMsc_ClockSelect
clockSelectAbra
;
/**< \brief Specifies the clock select for ABRA */
254
IfxMsc_NDividerAbra
nDividerAbra
;
/**< \brief Specifies the N divider */
255
IfxMsc_AsynchronousBlock
abraBlockBypass
;
/**< \brief Specifies ABRA block bypass */
256
}
IfxMsc_Msc_Abra
;
257
258
/** \brief Clock configuration data Structure
259
*/
260
typedef
struct
261
{
262
uint32
baudrate
;
/**< \brief Specifies the baud rate */
263
IfxMsc_DividerMode
dividerMode
;
/**< \brief Specifies divided clock properties */
264
uint16
step
;
/**< \brief Specifies the step value */
265
}
IfxMsc_Msc_Clock
;
266
267
/** \brief Downstream Control Configuration Structure
268
*/
269
typedef
struct
270
{
271
IfxMsc_TransmissionMode
transmissionMode
;
/**< \brief Specifies the transmission Mode */
272
IfxMsc_DataFrameLength
srlDataFrameLength
;
/**< \brief Specifies the Number of SRL bits shifted at data frames */
273
IfxMsc_DataFrameLength
srhDataFrameLength
;
/**< \brief Specifies the Number of SRH bits shifted at data frames */
274
IfxMsc_ActivePhaseSelection
srlActivePhaseSelection
;
/**< \brief Specifies the Enable SRL active phase selection bit */
275
IfxMsc_ActivePhaseSelection
srhActivePhaseSelection
;
/**< \brief Specifies the Enable SRL active phase selection bit */
276
IfxMsc_CommandFrameLength
commandFrameLength
;
/**< \brief Specifies the Number of bits shifted at command frames */
277
IfxMsc_DataFramePassivePhaseLength
dataFramePassivePhaseLength
;
/**< \brief Specifies the Passive Phase Length at Data Frames */
278
IfxMsc_PassiveTimeFrameCount
passiveTimeFrameCount
;
/**< \brief Specifies the Number of Passive Time Frames */
279
IfxMsc_ExternalSignalInjection
externalSignalInjectionPin0
;
/**< \brief Specifies the Injection Enable Pin 0 */
280
IfxMsc_ExternalBitInjectionPosition
injectionPositionPin0
;
/**< \brief Specifies the Injection Position Pin 0 */
281
IfxMsc_ExternalSignalInjection
externalSignalInjectionPin1
;
/**< \brief Specifies the Injection Enable Pin 1 */
282
IfxMsc_ExternalBitInjectionPosition
injectionPositionPin1
;
/**< \brief Specifies the Injection Position Pin 1 */
283
IfxMsc_CommandDataCommandRepetitionMode
commandDataCommandReceptionMode
;
/**< \brief Specifies the Command-Data-Command in Data Repetition Mode */
284
uint32
downstreamDataSourcesLow
;
/**< \brief Specifies the Downstream Data Source selections Low */
285
uint32
downstreamDataSourcesHigh
;
/**< \brief Specifies the Downstream Data Source selections High */
286
uint32
emergencyStopEnableBits
;
/**< \brief Emergency Stop */
287
}
IfxMsc_Msc_DownstreamControlConfig
;
288
289
/** \brief Downstream Control Extension Configuration Structure
290
*/
291
typedef
struct
292
{
293
IfxMsc_Extension
extension
;
/**< \brief Specifies the Extension Enable */
294
IfxMsc_MsbBitDataExtension
srlBitsShiftedAtDataFramesExtension
;
/**< \brief Specifies the Number of SRLE bits shifted at Data Frames */
295
IfxMsc_MsbBitDataExtension
srhBitsShiftedAtDataFramesExtension
;
/**< \brief Specifies the Number of SRHE bits shifted at Data Frames */
296
uint32
downstreamExtensionDataSourcesLow
;
/**< \brief Specifies the Downstream Select Data Source Low Extension */
297
uint32
downstreamExtensionDataSourcesHigh
;
/**< \brief Specifies the Downstream Select Data Source High Extension */
298
uint32
emergencyStopExtensionEnableBits
;
/**< \brief Emergency Stop Extension */
299
IfxMsc_DataFrameExtensionPassivePhaseLength
dataFrameExtensionPassivePhaseLength
;
/**< \brief Specifies the Passive Phase Length at Data Frames Extension */
300
IfxMsc_ControlFrameExtensionPassivePhaseLength
controlFrameExtensionPassivePhaseLength
;
/**< \brief Specifies the Passive Phase Length at Control Frames Extension */
301
IfxMsc_NDividerDownstream
nDividerDownstream
;
/**< \brief Specifies the division ratio for downstream generator clock */
302
}
IfxMsc_Msc_DownstreamControlExtensionConfig
;
303
304
/** \brief Interrupt Configuration Structure
305
*/
306
typedef
struct
307
{
308
IfxMsc_DataFrameInterruptNode
dataFrameInterruptNode
;
/**< \brief Specifies the Data Frame Interrupt Node */
309
IfxMsc_DataFrameInterrupt
dataFrameInterrupt
;
/**< \brief Specifies the Data Frame Interrupt Mode */
310
IfxMsc_CommandFrameInterruptNode
commandFrameInterruptNode
;
/**< \brief Specifies the Command Frame Interrupt Node */
311
IfxMsc_CommandFrameInterrupt
commandFrameInterrupt
;
/**< \brief Specifies the Command Frame Interrupt Mode */
312
IfxMsc_TimeFrameInterruptNode
timeFrameInterruptNode
;
/**< \brief Specifies the Time Frame Interrupt Node */
313
IfxMsc_TimeFrameInterrupt
timeFrameInterrupt
;
/**< \brief Specifies the Time Frame Interrupt Mode */
314
IfxMsc_ReceiveDataInterruptNode
receiveDataInterruptNode
;
/**< \brief Specifies the Receive Interrupt Node */
315
IfxMsc_ReceiveDataInterrupt
receiveDataInterrupt
;
/**< \brief Specifies the Receive Interrupt Mode */
316
IfxMsc_UpstreamTimeoutInterruptNode
upstreamTimeoutInterruptNode
;
/**< \brief Specifies the Upstream Timeout Interrupt Node */
317
IfxMsc_UpstreamTimeoutInterrupt
upstreamTimeoutInterrupt
;
/**< \brief Specifies the Upstream Timeout Interrupt Mode */
318
IfxMsc_OverflowInterruptNode
overflowInterruptNode
;
/**< \brief Specifies the ABRA Overflow Interrupt Node */
319
IfxMsc_OverflowInterrupt
overflowInterrupt
;
/**< \brief Specifies the ABRA Overflow Interrupt Mode */
320
IfxMsc_UnderflowInterruptNode
underflowInterruptNode
;
/**< \brief Specifies the ABRA Underflow Interrupt Node */
321
IfxMsc_UnderflowInterrupt
underflowInterrupt
;
/**< \brief Specifies the ABRA Underflow Interrupt Mode */
322
}
IfxMsc_Msc_InterruptConfig
;
323
324
/** \brief MSC Pin Configuration Structure
325
*/
326
typedef
struct
327
{
328
IfxMsc_Msc_fclp
fclp
;
329
IfxMsc_Msc_fcln
fcln
;
330
IfxMsc_Msc_sop
sop
;
331
IfxMsc_Msc_son
son
;
332
IfxMsc_Msc_en0
en0
;
333
IfxMsc_Msc_en1
en1
;
334
IfxMsc_Msc_sdi
sdi
;
335
IfxMsc_Msc_inj0
inj0
;
336
IfxMsc_Msc_inj1
inj1
;
337
IfxPort_PadDriver
pinDriver
;
338
}
IfxMsc_Msc_Io
;
339
340
/** \brief Output Control Configuration Structure
341
*/
342
typedef
struct
343
{
344
IfxMsc_FclLinePolarity
fclpPolarity
;
/**< \brief Specifies the FCLP Polarity */
345
IfxMsc_SoLinePolarity
sopPolarity
;
/**< \brief Specifies the SLP Polarity */
346
IfxMsc_ChipSelectActiveState
cslpPolarity
;
/**< \brief Specifies the CSLP Polarity */
347
IfxMsc_SdiLinePolarity
sdiLinePolarity
;
/**< \brief Specifies the ILP Polarity */
348
IfxMsc_FclClockControlEnabled
fclClockControl
;
/**< \brief Specifies the CLKCTRL Polarity */
349
}
IfxMsc_Msc_OutputControlConfig
;
350
351
/** \brief Upstream Control Configuration Structure
352
*/
353
typedef
struct
354
{
355
IfxMsc_UpstreamChannelFrameType
upstreamChannelFrameType
;
/**< \brief Specifies the Upstream Channel Frame Type */
356
IfxMsc_UpstreamChannelReceivingRate
upstreamChannelReceivingRate
;
/**< \brief Specifies the Upstream Channel Receiving Rate */
357
IfxMsc_Parity
parity
;
/**< \brief Specifies the Parity Mode */
358
IfxMsc_ServiceRequestDelay
serviceRequestDelay
;
/**< \brief Specifies the Service Request Delay */
359
IfxMsc_UpstreamTimeoutPrescaler
upstreamTimeoutPrescaler
;
/**< \brief Specifies the Upstream Timeout Prescaler */
360
IfxMsc_UpstreamTimeoutValue
upstreamTimeoutValue
;
/**< \brief Specifies the Upstream Timeout Value */
361
}
IfxMsc_Msc_UpstreamStatusConfig
;
362
363
/** \} */
364
365
/** \addtogroup IfxLld_Msc_Msc_Data_Structures
366
* \{ */
367
/** \brief MSC base address data Structure
368
*/
369
typedef
struct
370
{
371
Ifx_MSC *
msc
;
/**< \brief Specifies the pointer to the MSC registers */
372
}
IfxMsc_Msc
;
373
374
/** \brief MSC Module Configuration Structure
375
*/
376
typedef
struct
377
{
378
Ifx_MSC *
msc
;
/**< \brief Specifies the pointer to the MSC registers */
379
IfxMsc_Msc_Clock
clockConfig
;
/**< \brief Specifies the Clock configuration */
380
IfxMsc_Msc_UpstreamStatusConfig
upstreamConfig
;
/**< \brief Specifies the Upstream configuration */
381
IfxMsc_Msc_InterruptConfig
interruptConfig
;
/**< \brief Specifies the Interrupt configuration */
382
IfxMsc_Msc_OutputControlConfig
outputControlConfig
;
/**< \brief Specifies the Output Control configuration */
383
IfxMsc_Msc_DownstreamControlConfig
downstreamConfig
;
/**< \brief Specifies the Downstream configuration */
384
IfxMsc_Msc_DownstreamControlExtensionConfig
downstreamExtensionConfig
;
/**< \brief Specifies the Downstream Extension configuration */
385
IfxMsc_Msc_Abra
abraConfig
;
/**< \brief Specifies the ABRA configuration */
386
IfxMsc_Target
target[2];
/**< \brief Specifies the Downstream targets */
387
IfxMsc_Msc_Io
io
;
/**< \brief Specifies the IO Pin configuration */
388
}
IfxMsc_Msc_Config
;
389
390
/** \} */
391
392
/** \addtogroup IfxLld_Msc_Msc_Module_Initialize_Functions
393
* \{ */
394
395
/******************************************************************************/
396
/*-------------------------Global Function Prototypes-------------------------*/
397
/******************************************************************************/
398
399
/** \brief de-initialize MSC module
400
* \param msc pointer to the MSC module handle
401
* \return None
402
*
403
* \code
404
* IfxMsc_Msc_deInitModule(&msc);
405
* \endcode
406
*
407
*/
408
IFX_EXTERN
void
IfxMsc_Msc_deInitModule
(
IfxMsc_Msc
*msc);
409
410
/** \brief initialize the MSC module
411
* \param msc pointer to the MSC module handle
412
* \param config pointer to the MSC module configuration
413
* \return None
414
*
415
* \code
416
* // create configuration (same is used for all MSCs)
417
* IfxMsc_Msc_Config mscConfig;
418
* IfxMsc_Msc_initModuleConfig(&mscConfig, &MODULE_MSC0);
419
*
420
* // increase baudrate for faster simulation:
421
* mscConfig.clockConfig.baudrate = 25000000;
422
* mscConfig.clockConfig.dividerMode = IfxMsc_DividerMode_fractional;
423
*
424
* // FCL only activated on transfers
425
* mscConfig.outputControlConfig.fclClockControl = IfxMsc_FclClockControlEnabled_activePhaseOnly;
426
*
427
* // in this case we also don't need a selection bit
428
* mscConfig.downstreamConfig.srlActivePhaseSelection = IfxMsc_ActivePhaseSelection_none;
429
* mscConfig.downstreamConfig.srhActivePhaseSelection = IfxMsc_ActivePhaseSelection_none;
430
*
431
* // initialize MSCs
432
* for(int i=0; i<IFXMSC_COUNT; ++i) {
433
* // init module pointer
434
* mscConfig.msc = (Ifx_MSC*)IfxMsc_cfg_indexMap[i].module;
435
*
436
* // IO Config
437
* mscConfig.io = IfxMsc_PinMap[i];
438
*
439
* // initialize module
440
* IfxMsc_Msc_initModule(&msc[i], &mscConfig);
441
* }
442
* \endcode
443
*
444
*/
445
IFX_EXTERN
void
IfxMsc_Msc_initModule
(
IfxMsc_Msc
*msc,
IfxMsc_Msc_Config
*config);
446
447
/** \brief initialize the MSC module configuration
448
* \param config pointer to the MSC configuration
449
* \param msc pointer to the MSC registers
450
* \return None
451
*
452
* A coding example can be found in \ref IfxMsc_Msc_initModule
453
*
454
*/
455
IFX_EXTERN
void
IfxMsc_Msc_initModuleConfig
(
IfxMsc_Msc_Config
*config, Ifx_MSC *msc);
456
457
/** \brief initialize the ABRA block
458
* \param msc pointer to the MSC module handle
459
* \param config pointer to the MSC module configuration
460
* \return None
461
*/
462
IFX_EXTERN
void
IfxMsc_Msc_initializeAbra
(
IfxMsc_Msc
*msc,
IfxMsc_Msc_Config
*config);
463
464
/** \brief initialize the MSC data extension block for 64bit operation
465
* \param msc pointer to the MSC module handle
466
* \param config pointer to the MSC module configuration
467
* \return None
468
*/
469
IFX_EXTERN
void
IfxMsc_Msc_initializeDataExtension
(
IfxMsc_Msc
*msc,
IfxMsc_Msc_Config
*config);
470
471
/** \} */
472
473
/** \addtogroup IfxLld_Msc_Msc_Send_Functions
474
* \{ */
475
476
/******************************************************************************/
477
/*-------------------------Global Function Prototypes-------------------------*/
478
/******************************************************************************/
479
480
/** \brief send downstream command
481
* \param msc pointer to the MSC module handle
482
* \param command transmit command
483
* \return None
484
*/
485
IFX_EXTERN
void
IfxMsc_Msc_sendCommand
(
IfxMsc_Msc
*msc,
uint32
command);
486
487
/** \brief send complete downstream data, both high and low
488
* \param msc pointer to the MSC module handle
489
* \param dataLow low data to be transmitted
490
* \param dataHigh high data to be transmitted
491
* \return None
492
*
493
* \code
494
* for(int n=0; n<10; ++n) {
495
* // clear IRQ flag of previous transfer
496
* for(int i=0; i<IFXMSC_COUNT; ++i) {
497
* msc[i].msc->ISC.B.CDEDI = 1; // missing function!
498
* }
499
*
500
* // new transfer
501
* for(int i=0; i<IFXMSC_COUNT; ++i) {
502
* const unsigned dataL = i*0x1000 + n;
503
* const unsigned dataH = i*0x1000 + 0x0100 + n;
504
* IfxMsc_Msc_sendData(&msc[i], dataL, dataH);
505
* }
506
* }
507
* \endcode
508
*
509
*/
510
IFX_EXTERN
void
IfxMsc_Msc_sendData
(
IfxMsc_Msc
*msc,
uint16
dataLow,
uint16
dataHigh);
511
512
/** \brief Send downstream data extension (64bit)
513
* \param msc pointer to the MSC module handle
514
* \param data Data to send
515
* \param dataExtension Data extension to send
516
* \return None
517
*/
518
IFX_EXTERN
void
IfxMsc_Msc_sendDataExtension
(
IfxMsc_Msc
*msc,
uint32
data,
uint32
dataExtension);
519
520
/** \brief send high downstream data
521
* \param msc pointer to the MSC module handle
522
* \param data high downstream data to be transmitted
523
* \return None
524
*/
525
IFX_EXTERN
void
IfxMsc_Msc_sendDataHigh
(
IfxMsc_Msc
*msc,
uint16
data);
526
527
/** \brief send high downstream data
528
* \param msc pointer to the MSC module handle
529
* \param data low downstream data to be transmitted
530
* \return None
531
*/
532
IFX_EXTERN
void
IfxMsc_Msc_sendDataLow
(
IfxMsc_Msc
*msc,
uint16
data);
533
534
/** \} */
535
536
/** \addtogroup IfxLld_Msc_Msc_Receive_Functions
537
* \{ */
538
539
/******************************************************************************/
540
/*-------------------------Global Function Prototypes-------------------------*/
541
/******************************************************************************/
542
543
/** \brief receive upstream data
544
* \param msc pointer to the MSC module handle
545
* \param upstreamIdx index of the upstream data register
546
* \return data
547
*/
548
IFX_EXTERN
uint32
IfxMsc_Msc_receiveData
(
IfxMsc_Msc
*msc,
uint8
upstreamIdx);
549
550
/** \} */
551
552
/** \addtogroup IfxLld_Msc_Msc_Target_Read_Write_Functions
553
* \{ */
554
555
/******************************************************************************/
556
/*-------------------------Global Function Prototypes-------------------------*/
557
/******************************************************************************/
558
559
/** \brief get the target during high and low phase
560
* \param msc pointer to the MSC module handle
561
* \param target low phase target or high phase target
562
* \return selected target
563
*/
564
IFX_EXTERN
IfxMsc_Target
IfxMsc_Msc_getTarget
(
IfxMsc_Msc
*msc,
IfxMsc_Msc_Target
target);
565
566
/** \brief set the command for target
567
* \param msc pointer to the MSC module handle
568
* \param enX enX target to be selected
569
* \return None
570
*/
571
IFX_EXTERN
void
IfxMsc_Msc_setCommandTarget
(
IfxMsc_Msc
*msc,
IfxMsc_Target
enX);
572
573
/** \brief set the target data to be transmitted during low and high phase
574
* \param msc pointer to the MSC module handle
575
* \param enXHigh high target to be selected
576
* \param enXLow low target to be selected
577
* \return None
578
*/
579
IFX_EXTERN
void
IfxMsc_Msc_setDataTarget
(
IfxMsc_Msc
*msc,
IfxMsc_Target
enXHigh,
IfxMsc_Target
enXLow);
580
581
/** \} */
582
583
/******************************************************************************/
584
/*-------------------------Inline Function Prototypes-------------------------*/
585
/******************************************************************************/
586
587
/**
588
* \param msc pointer to the MSC module handle
589
* \return None
590
*/
591
IFX_INLINE
void
IfxMsc_Msc_clearDataFrameInterrupt
(
IfxMsc_Msc
*msc);
592
593
/**
594
* \param msc pointer to the MSC module handle
595
* \return status of the active data frame
596
*/
597
IFX_INLINE
boolean
IfxMsc_Msc_getActiveDataFrameStatus
(
IfxMsc_Msc
*msc);
598
599
/**
600
* \param msc pointer to the MSC module handle
601
* \return status of the data frame interrupt
602
*/
603
IFX_INLINE
boolean
IfxMsc_Msc_getDataFrameInterruptStatus
(
IfxMsc_Msc
*msc);
604
605
/******************************************************************************/
606
/*---------------------Inline Function Implementations------------------------*/
607
/******************************************************************************/
608
609
IFX_INLINE
void
IfxMsc_Msc_clearDataFrameInterrupt
(
IfxMsc_Msc
*msc)
610
{
611
IfxMsc_clearDataFrameInterruptFlag
(msc->
msc
);
612
}
613
614
615
IFX_INLINE
boolean
IfxMsc_Msc_getActiveDataFrameStatus
(
IfxMsc_Msc
*msc)
616
{
617
return
IfxMsc_getActiveDataFrameStatus
(msc->
msc
);
618
}
619
620
621
IFX_INLINE
boolean
IfxMsc_Msc_getDataFrameInterruptStatus
(
IfxMsc_Msc
*msc)
622
{
623
return
IfxMsc_getDataFrameInterruptFlag
(msc->
msc
);
624
}
625
626
627
#endif
/* IFXMSC_MSC_H */
home
mclld
Libraries
release
iLLD_0_1_0_10
src
ifx
TC27xC
Msc
Msc
IfxMsc_Msc.h
Generated by
1.8.4