summaryrefslogtreecommitdiffstats
path: root/Bachelor/Mikroprozessorsysteme2/mi2/h/pio.inc
blob: e694e7ae05ef2532e4ba9a22718c8f6dee19eb3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@----------------------------------------------------------------------------
@ File Name           : pio.inc
@ Object              : Parallel I/O Header File
@
@ 1.0 27/10/02 GR    : Creation
@----------------------------------------------------------------------------

#ifndef pio_inc
#define pio_inc


@------------------------------------------------------------*/
@ User Interface Parallel I/O Interface Structure Definition */
@------------------------------------------------------------*/

PIO_PER = 0x0           @ PIO Enable Register 
PIO_PDR = 0x4           @ PIO Disable Register 
PIO_PSR = 0x8           @ PIO Status Register 
			@ Reserved 0xC
PIO_OER = 0x10           @ Output Enable Register 
PIO_ODR = 0x14           @ Output Disable Register 
PIO_OSR = 0x18           @ Output Status Register 
			@  Reserved 0x1C
PIO_IFER = 0x20          @ Input Filter Enable Register 
PIO_IFDR = 0x24          @ Input Filter Disable Register 
PIO_IFSR = 0x28          @ Input Filter Status Register 
			@  Reserved 0x2C
PIO_SODR = 0x30         @ Set Output Data Register 
PIO_CODR = 0x34         @ Clear Output Data Register 
PIO_ODSR = 0x38         @ Output Data Status Register 
PIO_PDSR = 0x3C         @ Pin Data Status Register 
PIO_IER = 0x40          @ Interrupt Enable Register 
PIO_IDR = 0x44          @ Interrupt Disable Register 
PIO_IMR = 0x48          @ Interrupt Mask Register 
PIO_ISR = 0x4C          @ Interrupt Status Register 
PIO_MDER = 0x50         @ Multi Driver Enable Register 
PIO_MDDR = 0x54         @ Multi Driver Disable Register 
PIO_MDSR = 0x58          @ Multi Driver Status Register 
			@  Reserved 0x5C

PIOB_BASE     = 0xFFFF0000     @ Parallel I/O Controller B 
PIOA_BASE     = 0xFFFEC000      @ Parallel I/O Controller A 

@ PIO Controller A 
PIOTCLK3   =     0         @ Timer 3 Clock signal 
PIOTIOA3   =     1         @ Timer 3 Signal A 
PIOTIOB3   =     2         @ Timer 3 Signal B 
                                   
PIOTCLK4   =     3         @ Timer 4 Clock signal 
PIOTIOA4   =     4         @ Timer 4 Signal A 
PIOTIOB4   =     5         @ Timer 4 Signal B 
                                   
PIOTCLK5   =     6         @ Timer 5 Clock signal 
PIOTIOA5   =     7         @ Timer 5 Signal A 
PIOTIOB5   =     8         @ Timer 5 Signal B 
                                    
PIOIRQ0    =     9         @ External Interrupt 0 
PIOIRQ1    =     10        @ External Interrupt 1 
PIOIRQ2    =     11        @ External Interrupt 2 
PIOIRQ3    =     12        @ External Interrupt 3 
PIOFIQ     =     13        @ Fast Interrupt 
                                   
PIOSCK0    =     14        @ USART 0 signal 
PIOTXD0    =     15        @ USART 0 transmit data 
PIORXD0    =     16        @ USART 0 receive data  
                                  
PIOSCK1    =     17        @ USART 1 clock signal  
PIOTXD1    =     18        @ USART 1 transmit data 
PIORXD1    =     19        @ USART 1 receive data  
                                   
PIOSCK2    =     20        @ USART 2 clock signal   
PIOTXD2    =     21        @ USART 2 transmit data  
PIORXD2    =     22        @ USART 2 receive data   
                                   
PIOSPCK    =     23        @ SPI clock signal  
PIOMISO    =     24        @ SPI Master In Slave 
PIOMOSI    =     25        @ SPI Master Out Slave 
PIONPCS0   =     26        @ SPI Peripheral Chip Select 0 
PIONSS     =     PIONPCS0    
PIONPCS1   =     27        @ SPI Peripheral Chip Select 1 
PIONPCS2   =     28        @ SPI Peripheral Chip Select 2 
PIONPCS3   =     29        @ SPI Peripheral Chip Select 3 

@ PIO Controller B 
PIOTCLK0    =    19        @ Timer 0 Clock signal input 
PIOTIOA0    =    20        @ Timer 0 Signal A   
PIOTIOB0    =    21        @ Timer 0 Signal B   
                                   
PIOTCLK1    =    22        @ Timer 1 Clock signal 
PIOTIOA1    =    23        @ Timer 1 Signal A 
PIOTIOB1    =    24        @ Timer 1 Signal B 
                                       
PIOTCLK2    =    25        @ Timer 2 Clock signal 
PIOTIOA2    =    26        @ Timer 2 Signal A 
PIOTIOB2    =    27        @ Timer 2 Signal B 
                                     
PIOMCKO     =    17        @ Master Clock Output 
                                  
PIOBMS      =    18        @ Boot Mode Select 
                                  
PIOMPI_NOE  =    0         @ MPI output enable 
PIOMPI_NLB  =    1         @ MPI lower byte select 
PIOMPI_NUB  =    2         @ MPI upper byte select 

LED1        =    (1<<8)         @ LED 1 (linke LED) 
LED2        =    (1<<9)         @ LED 2 
LED3        =   (1<<10)         @ LED 3 
LED4        =   (1<<11)         @ LED 4 
LED5        =   (1<<12)         @ LED 5 
LED6        =   (1<<13)         @ LED 6 
LED7        =   (1<<14)         @ LED 7 
LED8        =   (1<<15)         @ LED 8 
ALL_LEDS    =   (LED1|LED2|LED3|LED4|LED5|LED6|LED7|LED8)

KEY1        =    (1<<3)         @ TASTE 1 (linke Taste) auf PB3 
KEY2        =    (1<<4)         @ TASTE 2 auf PB4 
KEY3        =    (1<<5)         @ TASTE 3 auf PB5 
KEY4        =    (1<<9)         @ TASTE 4 auf PA9/IRQ0 
ALL_KEYS    =    (KEY1|KEY2|KEY3)                                            
#endif