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

Subversion Repositories vspi

[/] [vspi/] [trunk/] [projnav/] [xps/] [drivers/] [spiifc_v1_00_a/] [src/] [spiifc.c] - Blame information for rev 14

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 14 mjlyons
/*****************************************************************************
2
* Filename:          C:\Users\mjlyons\workspace\vSPI\projnav\xps/drivers/spiifc_v1_00_a/src/spiifc.c
3
* Version:           1.00.a
4
* Description:       spiifc Driver Source File
5
* Date:              Tue Feb 28 11:11:28 2012 (by Create and Import Peripheral Wizard)
6
*****************************************************************************/
7
 
8
 
9
/***************************** Include Files *******************************/
10
 
11
#include "spiifc.h"
12
 
13
/************************** Function Definitions ***************************/
14
 
15
/**
16
 *
17
 * Enable all possible interrupts from SPIIFC device.
18
 *
19
 * @param   baseaddr_p is the base address of the SPIIFC device.
20
 *
21
 * @return  None.
22
 *
23
 * @note    None.
24
 *
25
 */
26
void SPIIFC_EnableInterrupt(void * baseaddr_p)
27
{
28
  Xuint32 baseaddr;
29
  baseaddr = (Xuint32) baseaddr_p;
30
 
31
  /*
32
   * Enable all interrupt source from user logic.
33
   */
34
  SPIIFC_mWriteReg(baseaddr, SPIIFC_INTR_IPIER_OFFSET, 0x00000001);
35
 
36
  /*
37
   * Set global interrupt enable.
38
   */
39
  SPIIFC_mWriteReg(baseaddr, SPIIFC_INTR_DGIER_OFFSET, INTR_GIE_MASK);
40
}
41
 
42
/**
43
 *
44
 * Example interrupt controller handler for SPIIFC device.
45
 * This is to show example of how to toggle write back ISR to clear interrupts.
46
 *
47
 * @param   baseaddr_p is the base address of the SPIIFC device.
48
 *
49
 * @return  None.
50
 *
51
 * @note    None.
52
 *
53
 */
54
void SPIIFC_Intr_DefaultHandler(void * baseaddr_p)
55
{
56
  Xuint32 baseaddr;
57
  Xuint32 IntrStatus;
58
Xuint32 IpStatus;
59
  baseaddr = (Xuint32) baseaddr_p;
60
 
61
  {
62
    xil_printf("User logic interrupt! \n\r");
63
    IpStatus = SPIIFC_mReadReg(baseaddr, SPIIFC_INTR_IPISR_OFFSET);
64
    SPIIFC_mWriteReg(baseaddr, SPIIFC_INTR_IPISR_OFFSET, IpStatus);
65
  }
66
 
67
}
68
 

powered by: WebSVN 2.1.0

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