OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [ARM7_STR75x_GCC/] [STLibrary/] [src/] [75x_ssp.c] - Blame information for rev 586

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 577 jeremybenn
/******************** (C) COPYRIGHT 2006 STMicroelectronics ********************
2
* File Name          : 75x_ssp.c
3
* Author             : MCD Application Team
4
* Date First Issued  : 03/10/2006
5
* Description        : This file provides all the SSP software functions.
6
********************************************************************************
7
* History:
8
* 07/17/2006 : V1.0
9
* 03/10/2006 : V0.1
10
********************************************************************************
11
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
13
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
14
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
15
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
16
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17
*******************************************************************************/
18
 
19
/* Includes ------------------------------------------------------------------*/
20
#include "75x_ssp.h"
21
#include "75x_mrcc.h"
22
 
23
/* Private typedef -----------------------------------------------------------*/
24
/* Private define ------------------------------------------------------------*/
25
/* Private macro -------------------------------------------------------------*/
26
/* Private variables ---------------------------------------------------------*/
27
 
28
/* SSP peripheral Enable */
29
#define SSP_Enable   0x0002
30
#define SSP_Disable  0xFFFD
31
 
32
/* SSP Loop Back Mode Enable */
33
#define SSP_LoopBackMode_Enable   0x0001
34
#define SSP_LoopBackMode_Disable  0xFFFE
35
 
36
/* SSP Flag Mask */
37
#define SSP_Flag_Mask  0x001F
38
 
39
/* SSP DMA transmit/ receive enable/disable Masks */
40
#define SSP0_DMA_TransmitEnable   0x0002
41
#define SSP0_DMA_TransmitDisable  0xFFFD
42
#define SSP0_DMA_ReceiveEnable    0x0001
43
#define SSP0_DMA_ReceiveDisable   0xFFFE
44
 
45
/* SSP Masks */
46
#define SSP_FrameFormat_Mask     0xFFCF
47
#define SSP_DataSize_Mask        0xFFF0
48
#define SSP_ClockRate_Mask       0x00FF
49
#define SSP_ClockPrescaler_Mask  0xFF00
50
#define SSP_SSI_Set_Mask         0x0020
51
#define SSP_SSI_Reset_Mask       0xFFDF
52
 
53
 
54
/* Private function prototypes -----------------------------------------------*/
55
/* Private functions ---------------------------------------------------------*/
56
 
57
/*******************************************************************************
58
* Function Name  : SSP_DeInit
59
* Description    : Deinitializes the SSPx peripheral registers to their default
60
*                  reset values.
61
* Input          : SSPx: where x can be 0 or 1 to select the SSP peripheral.
62
* Output         : None
63
* Return         : None
64
*******************************************************************************/
65
void SSP_DeInit(SSP_TypeDef* SSPx)
66
{
67
  if(SSPx == SSP0)
68
  {
69
    /* Reset the SSP0 registers values*/
70
    MRCC_PeripheralSWResetConfig(MRCC_Peripheral_SSP0,ENABLE);
71
    MRCC_PeripheralSWResetConfig(MRCC_Peripheral_SSP0,DISABLE);
72
  }
73
  else if (SSPx == SSP1)
74
  {
75
    /* Reset the SSP1 registers values*/
76
    MRCC_PeripheralSWResetConfig(MRCC_Peripheral_SSP1,ENABLE);
77
    MRCC_PeripheralSWResetConfig(MRCC_Peripheral_SSP1,DISABLE);
78
  }
79
}
80
 
81
/*******************************************************************************
82
* Function Name  : SSP_Init
83
* Description    : Initializes the SSPx  peripheral according to the specified
84
*                  parameters in the SSP_InitTypeDef structure.
85
* Input          : - SSPx: where x can be 0 or 1 to select the SSP peripheral.
86
*                  - SSP_InitStruct: pointer to a SSP_InitTypeDef structure that
87
*                    contains the configuration information for the specified SSP
88
*                    peripheral.
89
* Output         : None
90
* Return         : None
91
*******************************************************************************/
92
void SSP_Init(SSP_TypeDef* SSPx, SSP_InitTypeDef* SSP_InitStruct)
93
{
94
  /* Configure the Frame format */
95
  if(SSP_InitStruct->SSP_FrameFormat == SSP_FrameFormat_TI)
96
  {
97
    /* Clear the FRF[1:0] bits */
98
    SSPx->CR0 &= SSP_FrameFormat_Mask;
99
    /* Set the TI frame format */
100
    SSPx->CR0 |= SSP_FrameFormat_TI;
101
  }
102
  else
103
  {
104
    /* Set the Motorola frame format */
105
    SSPx->CR0 &= SSP_FrameFormat_Motorola;
106
    /* Configure the Clock polarity */
107
    if(SSP_InitStruct->SSP_CPOL == SSP_CPOL_High)
108
    {
109
      /* SCK is held high when no data is being transfered */
110
      SSPx->CR0 |= SSP_CPOL_High;
111
    }
112
    else
113
    {
114
      /* SCK is held low when no data is being transfered */
115
      SSPx->CR0 &= SSP_CPOL_Low;
116
    }
117
    /* Configure the Clock Phase */
118
    if(SSP_InitStruct->SSP_CPHA == SSP_CPHA_2Edge)
119
    {
120
      /* Data captured on second clock edge */
121
      SSPx->CR0 |= SSP_CPHA_2Edge;
122
    }
123
    else
124
    {
125
      /* Data captured on first clock edge */
126
      SSPx->CR0 &= SSP_CPHA_1Edge;
127
    }
128
  }
129
 
130
  /* Configure the Mode */
131
  if(SSP_InitStruct->SSP_Mode == SSP_Mode_Slave)
132
  {
133
    /* Set the slave mode */
134
    SSPx->CR1 |= SSP_Mode_Slave;
135
    /* Configure the Slave output */
136
    if(SSP_InitStruct->SSP_SlaveOutput == SSP_SlaveOutput_Disable)
137
    {
138
      /* Slave output disabled */
139
      SSPx->CR1 |= SSP_SlaveOutput_Disable;
140
    }
141
    else
142
    {
143
      /* Slave output enabled */
144
      SSPx->CR1 &= SSP_SlaveOutput_Enable;
145
    }
146
    /* Configure the NSS pin */
147
    if(SSP_InitStruct->SSP_NSS == SSP_NSS_Soft)
148
    {
149
      /* Slave selected by software through SSI bit */
150
      SSPx->CR1 |= SSP_NSS_Soft;
151
      SSPx->CR1 &= SSP_SSI_Reset_Mask;
152
    }
153
    else
154
    {
155
      /* Slave selected by hardware through external SSpin */
156
      SSPx->CR1 &= SSP_NSS_Hard;
157
    }
158
    /* Configure the Clock rate and prescaler in TI slave mode */
159
    if(SSP_InitStruct->SSP_FrameFormat == SSP_FrameFormat_TI)
160
    {
161
      /* Clear clock rate SCR[7:0] bits */
162
      SSPx->CR0 &= SSP_ClockRate_Mask;
163
      /* Set the serial clock rate */
164
      SSPx->CR0 |= (SSP_InitStruct->SSP_ClockRate<<8);
165
      /* Clear clock prescaler CPSDVSR[7:0] bits */
166
      SSPx->PR &= SSP_ClockPrescaler_Mask;
167
      /* Set the serial clock prescaler */
168
      SSPx->PR |= SSP_InitStruct->SSP_ClockPrescaler;
169
    }
170
  }
171
  else
172
  {
173
    /* Set the master mode */
174
    SSPx->CR1 &= SSP_Mode_Master;
175
    /* Configure the NSS pin */
176
    if(SSP_InitStruct->SSP_NSS == SSP_NSS_Soft)
177
    {
178
      /* Master selected by software through SSI bit */
179
      SSPx->CR1 |= SSP_NSS_Soft;
180
      SSPx->CR1 |= SSP_SSI_Set_Mask;
181
    }
182
    else
183
    {
184
      /* Master selected by hardware through external SSpin */
185
      SSPx->CR1 &= SSP_NSS_Hard;
186
    }
187
    /* Clear clock rate SCR[7:0] bits */
188
    SSPx->CR0 &= SSP_ClockRate_Mask;
189
    /* Set the serial clock rate */
190
    SSPx->CR0 |= (SSP_InitStruct->SSP_ClockRate<<8);
191
    /* Clear clock prescaler CPSDVSR[7:0] bits */
192
    SSPx->PR &= SSP_ClockPrescaler_Mask;
193
    /* Set the serial clock prescaler */
194
    SSPx->PR |= SSP_InitStruct->SSP_ClockPrescaler;
195
  }
196
 
197
  /* Clear data size DSS[3:0] bits */
198
  SSPx->CR0 &= SSP_DataSize_Mask;
199
  /* Set the data size */
200
  SSPx->CR0 |= SSP_InitStruct->SSP_DataSize;
201
}
202
 
203
/*******************************************************************************
204
* Function Name  : SSP_StructInit
205
* Description    : Fills each SSP_InitStruct member with its default value.
206
* Input          : SSP_InitStruct : pointer to a SSP_InitTypeDef structure
207
                   which will be initialized.
208
* Output         : None
209
* Return         : None
210
*******************************************************************************/
211
void SSP_StructInit(SSP_InitTypeDef* SSP_InitStruct)
212
{
213
  /* Initialize the SSP_FrameFormat member */
214
  SSP_InitStruct->SSP_FrameFormat = SSP_FrameFormat_Motorola;
215
 
216
  /* Initialize the SSP_Mode member */
217
  SSP_InitStruct->SSP_Mode = SSP_Mode_Master;
218
 
219
  /* Initialize the SSP_CPOL member */
220
  SSP_InitStruct->SSP_CPOL = SSP_CPOL_Low;
221
 
222
  /* Initialize the SSP_CPHA member */
223
  SSP_InitStruct->SSP_CPHA = SSP_CPHA_1Edge;
224
 
225
  /* Initialize the SSP_DataSize member */
226
  SSP_InitStruct->SSP_DataSize = SSP_DataSize_8b;
227
 
228
  /* Initialize the SSP_NSS  member */
229
  SSP_InitStruct->SSP_NSS = SSP_NSS_Hard;
230
 
231
  /* Initialize the SSP_SlaveOutput member */
232
  SSP_InitStruct->SSP_SlaveOutput = SSP_SlaveOutput_Enable;
233
 
234
  /* Initialize the SSP_ClockRate member */
235
  SSP_InitStruct->SSP_ClockRate = 0;
236
 
237
  /* Initialize the SSP_ClockPrescaler member */
238
  SSP_InitStruct->SSP_ClockPrescaler = 0;
239
}
240
 
241
/*******************************************************************************
242
* Function Name  : SSP_Cmd
243
* Description    : Enables or disables the specified SSP peripheral.
244
* Input          : - SSPx: where x can be 0 or 1 to select the SSP peripheral.
245
*                  - NewState: new state of the SSPx peripheral.
246
*                    This parameter can be: ENABLE or DISABLE.
247
* Output         : None
248
* Return         : None
249
*******************************************************************************/
250
void SSP_Cmd(SSP_TypeDef* SSPx, FunctionalState NewState)
251
{
252
  if(NewState == ENABLE)
253
  {
254
    /* Enable the SSP peripheral */
255
    SSPx->CR1 |= SSP_Enable;
256
  }
257
  else
258
  {
259
    /* Disable the SSP peripheral */
260
    SSPx->CR1 &= SSP_Disable;
261
  }
262
}
263
 
264
/*******************************************************************************
265
* Function Name  : SSP_ITConfig
266
* Description    : Enables or disables the specified SSP interrupts.
267
* Input          : - SSPx: where x can be 0 or 1 to select the SSP peripheral.
268
*                  - SSP_IT: specifies the SSP interrupts sources to be enabled
269
*                    or disabled. This parameter can be any combination of the
270
*                    following values:
271
*                         - SSP_IT_TxFifo: Transmit FIFO half empty or less interrupt
272
*                         - SSP_IT_RxFifo: Receive FIFO half full or less interrupt
273
*                         - SSP_IT_RxTimeOut: Receive timeout interrupt
274
*                         - SSP_IT_RxOverrun: Receive overrun interrupt
275
*                  - NewState: new state of the specified SSP interrupts.
276
*                    This parameter can be: ENABLE or DISABLE.
277
* Output         : None
278
* Return         : None
279
*******************************************************************************/
280
void SSP_ITConfig(SSP_TypeDef* SSPx, u16 SSP_IT, FunctionalState NewState)
281
{
282
  if(NewState == ENABLE)
283
  {
284
    /* Enable the selected SSP interrupts */
285
    SSPx->IMSCR |= SSP_IT;
286
  }
287
  else
288
  {
289
    /* Disable the selected SSP interrupts */
290
    SSPx->IMSCR &= ~SSP_IT;
291
  }
292
}
293
 
294
/*******************************************************************************
295
* Function Name  : SSP_DMACmd
296
* Description    : Configures the SSP0 DMA interface.
297
* Input          : - SSP0_DMAtransfer : specifies the DMA transfer to be
298
*                    enabled or disabled. This parameter can be one of the
299
*                    following values:
300
*                         - SSP0_DMA_Transmit: transmit Fifo DMA transfer
301
*                         - SSP0_DMA_Receive: receive Fifo DMA transfer
302
*                  - NewState: new state of SSP0 DMA transfer.
303
*                    This parameter can be: ENABLE or DISABLE.
304
* Output         : None
305
* Return         : None
306
*******************************************************************************/
307
void SSP_DMACmd(u16 SSP0_DMAtransfer, FunctionalState NewState)
308
{
309
  if(NewState == ENABLE)
310
  {
311
    if(SSP0_DMAtransfer == SSP0_DMA_Transmit)
312
    {
313
      /* Enable DMA for the transmit FIFO */
314
      SSP0->DMACR |= SSP0_DMA_TransmitEnable;
315
    }
316
    else
317
    {
318
      /* Enable DMA for the receive FIFO */
319
      SSP0->DMACR |= SSP0_DMA_ReceiveEnable;
320
    }
321
  }
322
  else
323
  {
324
    if(SSP0_DMAtransfer == SSP0_DMA_Transmit)
325
    {
326
      /* Disable DMA for the transmit FIFO */
327
      SSP0->DMACR &= SSP0_DMA_TransmitDisable;
328
    }
329
    else
330
    {
331
      /* Disable DMA for the receive FIFO */
332
      SSP0->DMACR &= SSP0_DMA_ReceiveDisable;
333
    }
334
  }
335
}
336
 
337
/*******************************************************************************
338
* Function Name  : SSP_DMATxConfig
339
* Description    : Configures the SSP0 DMA transmit transfer.
340
* Input          : - SSP0_DMATxReq : specifies the SSP0 DMA transmit request to
341
*                    be enabled. This parameter can be one of the following
342
*                    values:
343
*                         - SSP0_DMATxReq_Single: Transmit FIFO DMA single
344
*                           request enabled
345
*                         - SSP0_DMATxReq_Burst: Transmit FIFO DMA burst request
346
*                           enabled
347
* Output         : None
348
* Return         : None
349
*******************************************************************************/
350
void SSP_DMATxConfig(u16 SSP0_DMATxReq)
351
{
352
  if(SSP0_DMATxReq == SSP0_DMATxReq_Burst)
353
  {
354
    /* Enable DMA transmit burst request */
355
    SSP0->DMACR |= SSP0_DMATxReq_Burst;
356
  }
357
  else
358
  {
359
    /* Enable DMA transmit single request */
360
    SSP0->DMACR &= SSP0_DMATxReq_Single;
361
  }
362
}
363
 
364
/*******************************************************************************
365
* Function Name  : SSP_DMARxConfig
366
* Description    : Configures the SSP0 DMA receive transfer.
367
* Input          : - SSP0_DMARxReq : specifies the SSP0 DMA receive request to
368
*                    be enabled. This parameter can be one of the following
369
*                    values:
370
*                         - SSP0_DMARxReq_Single: Receive FIFO DMA burst request
371
*                           enabled
372
*                         - SSP0_DMARxReq_Burst: Receive FIFO DMA single request
373
*                          enabled
374
* Output         : None
375
* Return         : None
376
*******************************************************************************/
377
void SSP_DMARxConfig(u16 SSP0_DMARxReq)
378
{
379
  if(SSP0_DMARxReq == SSP0_DMARxReq_Burst)
380
  {
381
    /* Enable DMA receive burst request */
382
    SSP0->DMACR |= SSP0_DMARxReq_Burst;
383
  }
384
  else
385
  {
386
    /* Enable DMA receive single request */
387
    SSP0->DMACR &= SSP0_DMARxReq_Single;
388
  }
389
}
390
 
391
/*******************************************************************************
392
* Function Name  : SSP_SendData
393
* Description    : Transmits a Data through the SSP peripheral.
394
* Input          : - SSPx: where x can be 0 or 1 to select the SSP peripheral.
395
*                  - Data : Data to be transmitted.
396
* Output         : None
397
* Return         : None
398
*******************************************************************************/
399
void SSP_SendData(SSP_TypeDef* SSPx, u16 Data)
400
{
401
  /* Write in the DR register the data to be sent */
402
  SSPx->DR = Data;
403
}
404
 
405
/*******************************************************************************
406
* Function Name  : SSP_ReceiveData
407
* Description    : Returns the most recent received data by the SSP peripheral.
408
* Input          : SSPx: where x can be 0 or 1 to select the SSP peripheral.
409
* Output         : None
410
* Return         : The value of the received data.
411
*******************************************************************************/
412
u16 SSP_ReceiveData(SSP_TypeDef* SSPx)
413
{
414
  /* Return the data in the DR register */
415
  return SSPx->DR;
416
}
417
 
418
/*******************************************************************************
419
* Function Name  : SSP_LoopBackConfig
420
* Description    : Enables or disables the Loop back mode for the selected SSP
421
*                  peripheral.
422
* Input          : - SSPx: where x can be 0 or 1 to select the SSP peripheral.
423
*                  - NewState: new state of the Loop Back mode.
424
*                    This parameter can be: ENABLE or DISABLE.
425
* Output         : None
426
* Return         : None
427
*******************************************************************************/
428
void SSP_LoopBackConfig(SSP_TypeDef* SSPx, FunctionalState NewState)
429
{
430
  if(NewState == ENABLE)
431
  {
432
    /* Enable loop back mode */
433
    SSPx->CR1 |= SSP_LoopBackMode_Enable;
434
  }
435
  else
436
  {
437
    /* Disable loop back mode */
438
    SSPx->CR1 &= SSP_LoopBackMode_Disable;
439
  }
440
}
441
 
442
/*******************************************************************************
443
* Function Name  : SSP_NSSInternalConfig
444
* Description    : Configures by software the NSS pin.
445
* Input          : - SSPx: where x can be 0 or 1 to select the SSP peripheral.
446
*                  - SSP_NSSState: NSS internal state.This parameter can be one
447
*                    of the following values:
448
*                         - SSP_NSSInternal_Set: Set NSS pin internally
449
*                         - SSP_NSSInternal_Reset: Reset NSS pin internally
450
* Output         : None
451
* Return         : None
452
*******************************************************************************/
453
void SSP_NSSInternalConfig(SSP_TypeDef* SSPx, u16 SSP_NSSState)
454
{
455
  if(SSP_NSSState == SSP_NSSInternal_Set)
456
  {
457
    /* Set NSS pin internally */
458
    SSPx->CR1 |= SSP_NSSInternal_Set;
459
  }
460
  else
461
  {
462
    /* Reset NSS pin internally */
463
    SSPx->CR1 &= SSP_NSSInternal_Reset;
464
  }
465
}
466
 
467
/*******************************************************************************
468
* Function Name  : SSP_GetFlagStatus
469
* Description    : Checks whether the specified SSP flag is set or not.
470
* Input          : - SSPx: where x can be 0 or 1 to select the SSP peripheral.
471
*                  - SSP_FLAG: specifies the flag to check.  This parameter can
472
*                    be one of the following values:
473
*                         - SSP_FLAG_Busy: busy flag
474
*                         - SSP_FLAG_RxFifoFull: Receive FIFO full flag
475
*                         - SSP_FLAG_RxFifoNotEmpty: Receive FIFO not empty flag
476
*                         - SSP_FLAG_TxFifoNotFull: Transmit FIFO not full flag
477
*                         - SSP_FLAG_TxFifoEmpty: Transmit FIFO empty flag
478
*                         - SSP_FLAG_TxFifo: Transmit FIFO half empty or less flag
479
*                         - SSP_FLAG_RxFifo: Receive FIFO half full or less flag
480
*                         - SSP_FLAG_RxTimeOut: Receive timeout flag
481
*                         - SSP_FLAG_RxOverrun: Receive overrun flag
482
* Output         : None
483
* Return         : The new state of SSP_FLAG(SET or RESET).
484
*******************************************************************************/
485
FlagStatus SSP_GetFlagStatus(SSP_TypeDef* SSPx, u16 SSP_FLAG)
486
{
487
  u32 SSPReg = 0, FlagPos = 0;
488
  u32 StatusReg = 0;
489
 
490
  /* Get the SSP register index */
491
  SSPReg = SSP_FLAG >> 5;
492
 
493
  /* Get the flag position */
494
  FlagPos = SSP_FLAG & SSP_Flag_Mask;
495
 
496
  /* Find the register of the flag to check */
497
  if(SSPReg == 1)
498
  {
499
    /* The flag to check is in SR register */
500
    StatusReg = SSPx->SR;
501
  }
502
  else if (SSPReg == 2)
503
  {
504
    /* The flag to check is in RISR register */
505
    StatusReg = SSPx->RISR;
506
  }
507
 
508
  /* Check the status of the specified SSP flag */
509
  if((StatusReg & (1 << FlagPos)) != RESET)
510
  {
511
    /* Return SET if the SSP flag is set */
512
    return SET;
513
  }
514
  else
515
  {
516
    /* Return RESET if the SSP flag is reset */
517
    return RESET;
518
  }
519
}
520
 
521
/*******************************************************************************
522
* Function Name  : SSP_ClearFlag
523
* Description    : Clears the SSPx’s pending flags.
524
* Input          : - SSPx: where x can be 0 or 1 to select the SSP peripheral.
525
*                  - SSP_FLAG: specifies the flag to clear.  This parameter can
526
*                    be one of the following values:
527
*                         - SSP_FLAG_RxTimeOut: Receive timeout flag
528
*                         - SSP_FLAG_RxOverrun: Receive overrun flag
529
* Output         : None
530
* Return         : None
531
*******************************************************************************/
532
void SSP_ClearFlag(SSP_TypeDef* SSPx, u16 SSP_FLAG)
533
{
534
  u8 FlagPos = 0;
535
 
536
  /* Get the flag position */
537
  FlagPos = SSP_FLAG & SSP_Flag_Mask;
538
 
539
  /* Clear the selected SSP flag */
540
  SSPx->ICR = (1 << FlagPos);
541
}
542
 
543
/*******************************************************************************
544
* Function Name  : SSP_GetITStatus
545
* Description    : Checks whether the specified SSP interrupt has occurred or not.
546
* Input          : - SSPx: where x can be 0 or 1 to select the SSP peripheral.
547
*                  - SSP_IT: specifies the interrupt source to check.
548
*                    This parameter can be one of the following values:
549
*                         - SSP_IT_TxFifo: Transmit FIFO half empty or less interrupt
550
*                         - SSP_IT_RxFifo: Receive FIFO half full or less interrupt
551
*                         - SSP_IT_RxTimeOut: Receive timeout interrupt
552
*                         - SSP_IT_RxOverrun: Receive overrun interrupt
553
* Output         : None
554
* Return         : The new state of SSP_IT(SET or RESET).
555
*******************************************************************************/
556
ITStatus SSP_GetITStatus(SSP_TypeDef* SSPx, u16 SSP_IT)
557
{
558
  /* Check the status of the specified interrupt flag */
559
  if((SSPx->MISR & SSP_IT) != RESET)
560
  {
561
    /* Return SET if the SSP interrupt flag is set */
562
    return SET;
563
  }
564
  else
565
  {
566
    /* Return RESET if SSP interrupt flag is reset */
567
    return RESET;
568
  }
569
}
570
 
571
/*******************************************************************************
572
* Function Name  : SSP_ClearITPendingBit
573
* Description    : Clears the SSPx’s interrupt pending bits.
574
* Input          : - SSPx: where x can be 0 or 1 to select the SSP peripheral.
575
*                  - SSP_IT: specifies the interrupt pending bit to clear.
576
*                    This parameter can be any combination of the following values:
577
*                         - SSP_IT_RxTimeOut: Receive timeout interrupt
578
*                         - SSP_IT_RxOverrun: Receive overrun interrupt
579
* Output         : None
580
* Return         : None
581
*******************************************************************************/
582
void SSP_ClearITPendingBit(SSP_TypeDef* SSPx, u16 SSP_IT)
583
{
584
  /* Clear the selected SSP interrupts pending bits */
585
  SSPx->ICR = SSP_IT;
586
}
587
 
588
/******************* (C) COPYRIGHT 2006 STMicroelectronics *****END OF FILE****/

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.