Program which demonstrates the usage of the TIMER peripheral. Program sets TIMER 2 to blink the LED on the pin P0.9. This is a more sophisticated way of blinking an LED.

Dependencies:   mbed

Committer:
71GA
Date:
Sat May 02 17:25:32 2015 +0000
Revision:
0:e83c998e1cfd
First commit of this program.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
71GA 0:e83c998e1cfd 1 //Definicije registrov za periferijo IOCONFIG
71GA 0:e83c998e1cfd 2
71GA 0:e83c998e1cfd 3 //Port 0
71GA 0:e83c998e1cfd 4 #define IOCON_P0_0 (*((volatile unsigned int *) 0x4002C000)) //D (IOCON type)
71GA 0:e83c998e1cfd 5 #define IOCON_P0_1 (*((volatile unsigned int *) 0x4002C004)) //D
71GA 0:e83c998e1cfd 6 #define IOCON_P0_2 (*((volatile unsigned int *) 0x4002C008)) //D
71GA 0:e83c998e1cfd 7 #define IOCON_P0_3 (*((volatile unsigned int *) 0x4002C00C)) //D
71GA 0:e83c998e1cfd 8 #define IOCON_P0_4 (*((volatile unsigned int *) 0x4002C010)) //D
71GA 0:e83c998e1cfd 9 #define IOCON_P0_5 (*((volatile unsigned int *) 0x4002C014)) //D
71GA 0:e83c998e1cfd 10 #define IOCON_P0_6 (*((volatile unsigned int *) 0x4002C018)) //D
71GA 0:e83c998e1cfd 11 #define IOCON_P0_7 (*((volatile unsigned int *) 0x4002C01C)) //W
71GA 0:e83c998e1cfd 12 #define IOCON_P0_8 (*((volatile unsigned int *) 0x4002C020)) //W
71GA 0:e83c998e1cfd 13 #define IOCON_P0_9 (*((volatile unsigned int *) 0x4002C024)) //W
71GA 0:e83c998e1cfd 14 #define IOCON_P0_10 (*((volatile unsigned int *) 0x4002C028)) //D
71GA 0:e83c998e1cfd 15 #define IOCON_P0_11 (*((volatile unsigned int *) 0x4002C02C)) //D
71GA 0:e83c998e1cfd 16 #define IOCON_P0_12 (*((volatile unsigned int *) 0x4002C030)) //A
71GA 0:e83c998e1cfd 17 #define IOCON_P0_13 (*((volatile unsigned int *) 0x4002C034)) //A
71GA 0:e83c998e1cfd 18 #define IOCON_P0_14 (*((volatile unsigned int *) 0x4002C038)) //D
71GA 0:e83c998e1cfd 19 #define IOCON_P0_15 (*((volatile unsigned int *) 0x4002C03C)) //D
71GA 0:e83c998e1cfd 20 #define IOCON_P0_16 (*((volatile unsigned int *) 0x4002C040)) //D
71GA 0:e83c998e1cfd 21 #define IOCON_P0_17 (*((volatile unsigned int *) 0x4002C044)) //D
71GA 0:e83c998e1cfd 22 #define IOCON_P0_18 (*((volatile unsigned int *) 0x4002C048)) //D
71GA 0:e83c998e1cfd 23 #define IOCON_P0_19 (*((volatile unsigned int *) 0x4002C04C)) //D
71GA 0:e83c998e1cfd 24 #define IOCON_P0_20 (*((volatile unsigned int *) 0x4002C050)) //D
71GA 0:e83c998e1cfd 25 #define IOCON_P0_21 (*((volatile unsigned int *) 0x4002C054)) //D
71GA 0:e83c998e1cfd 26 #define IOCON_P0_22 (*((volatile unsigned int *) 0x4002C058)) //D
71GA 0:e83c998e1cfd 27 #define IOCON_P0_23 (*((volatile unsigned int *) 0x4002C05C)) //A
71GA 0:e83c998e1cfd 28 #define IOCON_P0_24 (*((volatile unsigned int *) 0x4002C060)) //A
71GA 0:e83c998e1cfd 29 #define IOCON_P0_25 (*((volatile unsigned int *) 0x4002C064)) //A
71GA 0:e83c998e1cfd 30 #define IOCON_P0_26 (*((volatile unsigned int *) 0x4002C068)) //A
71GA 0:e83c998e1cfd 31 #define IOCON_P0_27 (*((volatile unsigned int *) 0x4002C06C)) //I
71GA 0:e83c998e1cfd 32 #define IOCON_P0_28 (*((volatile unsigned int *) 0x4002C070)) //I
71GA 0:e83c998e1cfd 33 #define IOCON_P0_29 (*((volatile unsigned int *) 0x4002C074)) //U
71GA 0:e83c998e1cfd 34 #define IOCON_P0_30 (*((volatile unsigned int *) 0x4002C078)) //U
71GA 0:e83c998e1cfd 35 #define IOCON_P0_31 (*((volatile unsigned int *) 0x4002C07C)) //U
71GA 0:e83c998e1cfd 36
71GA 0:e83c998e1cfd 37 //Port 1
71GA 0:e83c998e1cfd 38 #define IOCON_P1_0 (*((volatile unsigned int *) 0x4002C080)) //D (IOCON type)
71GA 0:e83c998e1cfd 39 #define IOCON_P1_1 (*((volatile unsigned int *) 0x4002C084)) //D
71GA 0:e83c998e1cfd 40 #define IOCON_P1_2 (*((volatile unsigned int *) 0x4002C088)) //D
71GA 0:e83c998e1cfd 41 #define IOCON_P1_3 (*((volatile unsigned int *) 0x4002C08C)) //D
71GA 0:e83c998e1cfd 42 #define IOCON_P1_4 (*((volatile unsigned int *) 0x4002C090)) //D
71GA 0:e83c998e1cfd 43 #define IOCON_P1_5 (*((volatile unsigned int *) 0x4002C094)) //W
71GA 0:e83c998e1cfd 44 #define IOCON_P1_6 (*((volatile unsigned int *) 0x4002C098)) //W
71GA 0:e83c998e1cfd 45 #define IOCON_P1_7 (*((volatile unsigned int *) 0x4002C09C)) //W
71GA 0:e83c998e1cfd 46 #define IOCON_P1_8 (*((volatile unsigned int *) 0x4002C0A0)) //D
71GA 0:e83c998e1cfd 47 #define IOCON_P1_9 (*((volatile unsigned int *) 0x4002C0A4)) //D
71GA 0:e83c998e1cfd 48 #define IOCON_P1_10 (*((volatile unsigned int *) 0x4002C0A8)) //D
71GA 0:e83c998e1cfd 49 #define IOCON_P1_11 (*((volatile unsigned int *) 0x4002C0AC)) //D
71GA 0:e83c998e1cfd 50 #define IOCON_P1_12 (*((volatile unsigned int *) 0x4002C0B0)) //D
71GA 0:e83c998e1cfd 51 #define IOCON_P1_13 (*((volatile unsigned int *) 0x4002C0B4)) //D
71GA 0:e83c998e1cfd 52 #define IOCON_P1_14 (*((volatile unsigned int *) 0x4002C0B8)) //W
71GA 0:e83c998e1cfd 53 #define IOCON_P1_15 (*((volatile unsigned int *) 0x4002C0BC)) //D
71GA 0:e83c998e1cfd 54 #define IOCON_P1_16 (*((volatile unsigned int *) 0x4002C0C0)) //W
71GA 0:e83c998e1cfd 55 #define IOCON_P1_17 (*((volatile unsigned int *) 0x4002C0C4)) //W
71GA 0:e83c998e1cfd 56 #define IOCON_P1_18 (*((volatile unsigned int *) 0x4002C0C8)) //D
71GA 0:e83c998e1cfd 57 #define IOCON_P1_19 (*((volatile unsigned int *) 0x4002C0CC)) //D
71GA 0:e83c998e1cfd 58 #define IOCON_P1_20 (*((volatile unsigned int *) 0x4002C0D0)) //D
71GA 0:e83c998e1cfd 59 #define IOCON_P1_21 (*((volatile unsigned int *) 0x4002C0D4)) //D
71GA 0:e83c998e1cfd 60 #define IOCON_P1_22 (*((volatile unsigned int *) 0x4002C0D8)) //D
71GA 0:e83c998e1cfd 61 #define IOCON_P1_23 (*((volatile unsigned int *) 0x4002C0DC)) //D
71GA 0:e83c998e1cfd 62 #define IOCON_P1_24 (*((volatile unsigned int *) 0x4002C0E0)) //D
71GA 0:e83c998e1cfd 63 #define IOCON_P1_25 (*((volatile unsigned int *) 0x4002C0E4)) //D
71GA 0:e83c998e1cfd 64 #define IOCON_P1_26 (*((volatile unsigned int *) 0x4002C0E8)) //D
71GA 0:e83c998e1cfd 65 #define IOCON_P1_27 (*((volatile unsigned int *) 0x4002C0EC)) //D
71GA 0:e83c998e1cfd 66 #define IOCON_P1_28 (*((volatile unsigned int *) 0x4002C0F0)) //D
71GA 0:e83c998e1cfd 67 #define IOCON_P1_29 (*((volatile unsigned int *) 0x4002C0F4)) //D
71GA 0:e83c998e1cfd 68 #define IOCON_P1_30 (*((volatile unsigned int *) 0x4002C0F8)) //A
71GA 0:e83c998e1cfd 69 #define IOCON_P1_31 (*((volatile unsigned int *) 0x4002C0FC)) //A
71GA 0:e83c998e1cfd 70
71GA 0:e83c998e1cfd 71 //Port 2
71GA 0:e83c998e1cfd 72 #define IOCON_P2_0 (*((volatile unsigned int *) 0x4002C100)) //D (IOCON type)
71GA 0:e83c998e1cfd 73 #define IOCON_P2_1 (*((volatile unsigned int *) 0x4002C104)) //D
71GA 0:e83c998e1cfd 74 #define IOCON_P2_2 (*((volatile unsigned int *) 0x4002C108)) //D
71GA 0:e83c998e1cfd 75 #define IOCON_P2_3 (*((volatile unsigned int *) 0x4002C10C)) //D
71GA 0:e83c998e1cfd 76 #define IOCON_P2_4 (*((volatile unsigned int *) 0x4002C110)) //D
71GA 0:e83c998e1cfd 77 #define IOCON_P2_5 (*((volatile unsigned int *) 0x4002C114)) //D
71GA 0:e83c998e1cfd 78 #define IOCON_P2_6 (*((volatile unsigned int *) 0x4002C118)) //D
71GA 0:e83c998e1cfd 79 #define IOCON_P2_7 (*((volatile unsigned int *) 0x4002C11C)) //D
71GA 0:e83c998e1cfd 80 #define IOCON_P2_8 (*((volatile unsigned int *) 0x4002C120)) //D
71GA 0:e83c998e1cfd 81 #define IOCON_P2_9 (*((volatile unsigned int *) 0x4002C124)) //D
71GA 0:e83c998e1cfd 82 #define IOCON_P2_10 (*((volatile unsigned int *) 0x4002C128)) //D
71GA 0:e83c998e1cfd 83 #define IOCON_P2_11 (*((volatile unsigned int *) 0x4002C12C)) //D
71GA 0:e83c998e1cfd 84 #define IOCON_P2_12 (*((volatile unsigned int *) 0x4002C130)) //D
71GA 0:e83c998e1cfd 85 #define IOCON_P2_13 (*((volatile unsigned int *) 0x4002C134)) //D
71GA 0:e83c998e1cfd 86 #define IOCON_P2_14 (*((volatile unsigned int *) 0x4002C138)) //D
71GA 0:e83c998e1cfd 87 #define IOCON_P2_15 (*((volatile unsigned int *) 0x4002C13C)) //D
71GA 0:e83c998e1cfd 88 #define IOCON_P2_16 (*((volatile unsigned int *) 0x4002C140)) //D
71GA 0:e83c998e1cfd 89 #define IOCON_P2_17 (*((volatile unsigned int *) 0x4002C144)) //D
71GA 0:e83c998e1cfd 90 #define IOCON_P2_18 (*((volatile unsigned int *) 0x4002C148)) //D
71GA 0:e83c998e1cfd 91 #define IOCON_P2_19 (*((volatile unsigned int *) 0x4002C14C)) //D
71GA 0:e83c998e1cfd 92 #define IOCON_P2_20 (*((volatile unsigned int *) 0x4002C150)) //D
71GA 0:e83c998e1cfd 93 #define IOCON_P2_21 (*((volatile unsigned int *) 0x4002C154)) //D
71GA 0:e83c998e1cfd 94 #define IOCON_P2_22 (*((volatile unsigned int *) 0x4002C158)) //D
71GA 0:e83c998e1cfd 95 #define IOCON_P2_23 (*((volatile unsigned int *) 0x4002C15C)) //D
71GA 0:e83c998e1cfd 96 #define IOCON_P2_24 (*((volatile unsigned int *) 0x4002C160)) //D
71GA 0:e83c998e1cfd 97 #define IOCON_P2_25 (*((volatile unsigned int *) 0x4002C164)) //D
71GA 0:e83c998e1cfd 98 #define IOCON_P2_26 (*((volatile unsigned int *) 0x4002C168)) //D
71GA 0:e83c998e1cfd 99 #define IOCON_P2_27 (*((volatile unsigned int *) 0x4002C16C)) //D
71GA 0:e83c998e1cfd 100 #define IOCON_P2_28 (*((volatile unsigned int *) 0x4002C170)) //D
71GA 0:e83c998e1cfd 101 #define IOCON_P2_29 (*((volatile unsigned int *) 0x4002C174)) //D
71GA 0:e83c998e1cfd 102 #define IOCON_P2_30 (*((volatile unsigned int *) 0x4002C178)) //D
71GA 0:e83c998e1cfd 103 #define IOCON_P2_31 (*((volatile unsigned int *) 0x4002C17C)) //D
71GA 0:e83c998e1cfd 104
71GA 0:e83c998e1cfd 105 //Port 3
71GA 0:e83c998e1cfd 106 #define IOCON_P3_0 (*((volatile unsigned int *) 0x4002C180)) //D (IOCON type)
71GA 0:e83c998e1cfd 107 #define IOCON_P3_1 (*((volatile unsigned int *) 0x4002C184)) //D
71GA 0:e83c998e1cfd 108 #define IOCON_P3_2 (*((volatile unsigned int *) 0x4002C188)) //D
71GA 0:e83c998e1cfd 109 #define IOCON_P3_3 (*((volatile unsigned int *) 0x4002C18C)) //D
71GA 0:e83c998e1cfd 110 #define IOCON_P3_4 (*((volatile unsigned int *) 0x4002C190)) //D
71GA 0:e83c998e1cfd 111 #define IOCON_P3_5 (*((volatile unsigned int *) 0x4002C194)) //D
71GA 0:e83c998e1cfd 112 #define IOCON_P3_6 (*((volatile unsigned int *) 0x4002C198)) //D
71GA 0:e83c998e1cfd 113 #define IOCON_P3_7 (*((volatile unsigned int *) 0x4002C19C)) //D
71GA 0:e83c998e1cfd 114 #define IOCON_P3_8 (*((volatile unsigned int *) 0x4002C1A0)) //D
71GA 0:e83c998e1cfd 115 #define IOCON_P3_9 (*((volatile unsigned int *) 0x4002C1A4)) //D
71GA 0:e83c998e1cfd 116 #define IOCON_P3_10 (*((volatile unsigned int *) 0x4002C1A8)) //D
71GA 0:e83c998e1cfd 117 #define IOCON_P3_11 (*((volatile unsigned int *) 0x4002C1AC)) //D
71GA 0:e83c998e1cfd 118 #define IOCON_P3_12 (*((volatile unsigned int *) 0x4002C1B0)) //D
71GA 0:e83c998e1cfd 119 #define IOCON_P3_13 (*((volatile unsigned int *) 0x4002C1B4)) //D
71GA 0:e83c998e1cfd 120 #define IOCON_P3_14 (*((volatile unsigned int *) 0x4002C1B8)) //D
71GA 0:e83c998e1cfd 121 #define IOCON_P3_15 (*((volatile unsigned int *) 0x4002C1BC)) //D
71GA 0:e83c998e1cfd 122 #define IOCON_P3_16 (*((volatile unsigned int *) 0x4002C1C0)) //D
71GA 0:e83c998e1cfd 123 #define IOCON_P3_17 (*((volatile unsigned int *) 0x4002C1C4)) //D
71GA 0:e83c998e1cfd 124 #define IOCON_P3_18 (*((volatile unsigned int *) 0x4002C1C8)) //D
71GA 0:e83c998e1cfd 125 #define IOCON_P3_19 (*((volatile unsigned int *) 0x4002C1CC)) //D
71GA 0:e83c998e1cfd 126 #define IOCON_P3_20 (*((volatile unsigned int *) 0x4002C1D0)) //D
71GA 0:e83c998e1cfd 127 #define IOCON_P3_21 (*((volatile unsigned int *) 0x4002C1D4)) //D
71GA 0:e83c998e1cfd 128 #define IOCON_P3_22 (*((volatile unsigned int *) 0x4002C1D8)) //D
71GA 0:e83c998e1cfd 129 #define IOCON_P3_23 (*((volatile unsigned int *) 0x4002C1DC)) //D
71GA 0:e83c998e1cfd 130 #define IOCON_P3_24 (*((volatile unsigned int *) 0x4002C1E0)) //D
71GA 0:e83c998e1cfd 131 #define IOCON_P3_25 (*((volatile unsigned int *) 0x4002C1E4)) //D
71GA 0:e83c998e1cfd 132 #define IOCON_P3_26 (*((volatile unsigned int *) 0x4002C1E8)) //D
71GA 0:e83c998e1cfd 133 #define IOCON_P3_27 (*((volatile unsigned int *) 0x4002C1EC)) //D
71GA 0:e83c998e1cfd 134 #define IOCON_P3_28 (*((volatile unsigned int *) 0x4002C1F0)) //D
71GA 0:e83c998e1cfd 135 #define IOCON_P3_29 (*((volatile unsigned int *) 0x4002C1F4)) //D
71GA 0:e83c998e1cfd 136 #define IOCON_P3_30 (*((volatile unsigned int *) 0x4002C1F8)) //D
71GA 0:e83c998e1cfd 137 #define IOCON_P3_31 (*((volatile unsigned int *) 0x4002C1FC)) //D
71GA 0:e83c998e1cfd 138
71GA 0:e83c998e1cfd 139 //Port 4
71GA 0:e83c998e1cfd 140 #define IOCON_P4_0 (*((volatile unsigned int *) 0x4002C200)) //D (IOCON type)
71GA 0:e83c998e1cfd 141 #define IOCON_P4_1 (*((volatile unsigned int *) 0x4002C204)) //D
71GA 0:e83c998e1cfd 142 #define IOCON_P4_2 (*((volatile unsigned int *) 0x4002C208)) //D
71GA 0:e83c998e1cfd 143 #define IOCON_P4_3 (*((volatile unsigned int *) 0x4002C20C)) //D
71GA 0:e83c998e1cfd 144 #define IOCON_P4_4 (*((volatile unsigned int *) 0x4002C210)) //D
71GA 0:e83c998e1cfd 145 #define IOCON_P4_5 (*((volatile unsigned int *) 0x4002C214)) //D
71GA 0:e83c998e1cfd 146 #define IOCON_P4_6 (*((volatile unsigned int *) 0x4002C218)) //D
71GA 0:e83c998e1cfd 147 #define IOCON_P4_7 (*((volatile unsigned int *) 0x4002C21C)) //D
71GA 0:e83c998e1cfd 148 #define IOCON_P4_8 (*((volatile unsigned int *) 0x4002C220)) //D
71GA 0:e83c998e1cfd 149 #define IOCON_P4_9 (*((volatile unsigned int *) 0x4002C224)) //D
71GA 0:e83c998e1cfd 150 #define IOCON_P4_10 (*((volatile unsigned int *) 0x4002C228)) //D
71GA 0:e83c998e1cfd 151 #define IOCON_P4_11 (*((volatile unsigned int *) 0x4002C22C)) //D
71GA 0:e83c998e1cfd 152 #define IOCON_P4_12 (*((volatile unsigned int *) 0x4002C230)) //D
71GA 0:e83c998e1cfd 153 #define IOCON_P4_13 (*((volatile unsigned int *) 0x4002C234)) //D
71GA 0:e83c998e1cfd 154 #define IOCON_P4_14 (*((volatile unsigned int *) 0x4002C238)) //D
71GA 0:e83c998e1cfd 155 #define IOCON_P4_15 (*((volatile unsigned int *) 0x4002C23C)) //D
71GA 0:e83c998e1cfd 156 #define IOCON_P4_16 (*((volatile unsigned int *) 0x4002C240)) //D
71GA 0:e83c998e1cfd 157 #define IOCON_P4_17 (*((volatile unsigned int *) 0x4002C244)) //D
71GA 0:e83c998e1cfd 158 #define IOCON_P4_18 (*((volatile unsigned int *) 0x4002C248)) //D
71GA 0:e83c998e1cfd 159 #define IOCON_P4_19 (*((volatile unsigned int *) 0x4002C24C)) //D
71GA 0:e83c998e1cfd 160 #define IOCON_P4_20 (*((volatile unsigned int *) 0x4002C250)) //D
71GA 0:e83c998e1cfd 161 #define IOCON_P4_21 (*((volatile unsigned int *) 0x4002C254)) //D
71GA 0:e83c998e1cfd 162 #define IOCON_P4_22 (*((volatile unsigned int *) 0x4002C258)) //D
71GA 0:e83c998e1cfd 163 #define IOCON_P4_23 (*((volatile unsigned int *) 0x4002C25C)) //D
71GA 0:e83c998e1cfd 164 #define IOCON_P4_24 (*((volatile unsigned int *) 0x4002C260)) //D
71GA 0:e83c998e1cfd 165 #define IOCON_P4_25 (*((volatile unsigned int *) 0x4002C264)) //D
71GA 0:e83c998e1cfd 166 #define IOCON_P4_26 (*((volatile unsigned int *) 0x4002C268)) //D
71GA 0:e83c998e1cfd 167 #define IOCON_P4_27 (*((volatile unsigned int *) 0x4002C26C)) //D
71GA 0:e83c998e1cfd 168 #define IOCON_P4_28 (*((volatile unsigned int *) 0x4002C270)) //D
71GA 0:e83c998e1cfd 169 #define IOCON_P4_29 (*((volatile unsigned int *) 0x4002C274)) //D
71GA 0:e83c998e1cfd 170 #define IOCON_P4_30 (*((volatile unsigned int *) 0x4002C278)) //D
71GA 0:e83c998e1cfd 171 #define IOCON_P4_31 (*((volatile unsigned int *) 0x4002C27C)) //D
71GA 0:e83c998e1cfd 172
71GA 0:e83c998e1cfd 173 //Port 5
71GA 0:e83c998e1cfd 174 #define IOCON_P5_0 (*((volatile unsigned int *) 0x4002C280)) //D (IOCON type)
71GA 0:e83c998e1cfd 175 #define IOCON_P5_1 (*((volatile unsigned int *) 0x4002C284)) //D
71GA 0:e83c998e1cfd 176 #define IOCON_P5_2 (*((volatile unsigned int *) 0x4002C288)) //I
71GA 0:e83c998e1cfd 177 #define IOCON_P5_3 (*((volatile unsigned int *) 0x4002C28C)) //I
71GA 0:e83c998e1cfd 178 #define IOCON_P5_4 (*((volatile unsigned int *) 0x4002C290)) //D