Test program for MMA8451Q

Dependencies:   MMA8451Q mbed

Committer:
Rhyme
Date:
Fri Dec 25 07:23:26 2015 +0000
Revision:
0:b9f8aeb1c46b
commit before publishing

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rhyme 0:b9f8aeb1c46b 1 #ifndef _MSS_H_
Rhyme 0:b9f8aeb1c46b 2 #define _MSS_H_
Rhyme 0:b9f8aeb1c46b 3
Rhyme 0:b9f8aeb1c46b 4 #if defined (TARGET_KL25Z)
Rhyme 0:b9f8aeb1c46b 5 /* I2C */
Rhyme 0:b9f8aeb1c46b 6 #define PIN_SCL PTE1
Rhyme 0:b9f8aeb1c46b 7 #define PIN_SDA PTE0
Rhyme 0:b9f8aeb1c46b 8 /* SPI */
Rhyme 0:b9f8aeb1c46b 9 #define PIN_SCK PTD1
Rhyme 0:b9f8aeb1c46b 10 #define PIN_MISO PTD3
Rhyme 0:b9f8aeb1c46b 11 #define PIN_MOSI PTD2
Rhyme 0:b9f8aeb1c46b 12 #define PIN_CS0 PTD0
Rhyme 0:b9f8aeb1c46b 13 /* Interrupt */
Rhyme 0:b9f8aeb1c46b 14 #define PIN_INT0 PTD5
Rhyme 0:b9f8aeb1c46b 15 #define PIN_INT1 PTA13
Rhyme 0:b9f8aeb1c46b 16 #define PIN_INT2 PTC9 /* This pin does not support interrupt */
Rhyme 0:b9f8aeb1c46b 17 #define PIN_INT3 PTC8 /* This pin does not support interrupt */
Rhyme 0:b9f8aeb1c46b 18 #define PIN_INT4 PTA5
Rhyme 0:b9f8aeb1c46b 19 #define PIN_INT5 PTA4
Rhyme 0:b9f8aeb1c46b 20 /* Analog Input */
Rhyme 0:b9f8aeb1c46b 21 #define PIN_AN0 PTB0
Rhyme 0:b9f8aeb1c46b 22 #define PIN_AN1 PTB1
Rhyme 0:b9f8aeb1c46b 23 #define PIN_AN2 PTB2
Rhyme 0:b9f8aeb1c46b 24 #define PIN_AN3 PTB3
Rhyme 0:b9f8aeb1c46b 25 #define PIN_AN4 PTC2
Rhyme 0:b9f8aeb1c46b 26 #define PIN_AN5 PTC1
Rhyme 0:b9f8aeb1c46b 27 #define BOARD_NAME "FRDM-KL25Z"
Rhyme 0:b9f8aeb1c46b 28
Rhyme 0:b9f8aeb1c46b 29 #elif defined (TARGET_KL46Z)
Rhyme 0:b9f8aeb1c46b 30 /* I2C */
Rhyme 0:b9f8aeb1c46b 31 #define PIN_SCL PTE1
Rhyme 0:b9f8aeb1c46b 32 #define PIN_SDA PTE0
Rhyme 0:b9f8aeb1c46b 33 /* SPI */
Rhyme 0:b9f8aeb1c46b 34 #define PIN_SCK PTD5
Rhyme 0:b9f8aeb1c46b 35 #define PIN_MISO PTD7
Rhyme 0:b9f8aeb1c46b 36 #define PIN_MOSI PTD6
Rhyme 0:b9f8aeb1c46b 37 #define PIN_CS0 PTD4
Rhyme 0:b9f8aeb1c46b 38 /* Interrupt */
Rhyme 0:b9f8aeb1c46b 39 #define PIN_INT0 PTD2
Rhyme 0:b9f8aeb1c46b 40 #define PIN_INT1 PTA13
Rhyme 0:b9f8aeb1c46b 41 #define PIN_INT2 PTC9 /* This pin does not support interrupt */
Rhyme 0:b9f8aeb1c46b 42 #define PIN_INT3 PTC8 /* This pin does not support interrupt */
Rhyme 0:b9f8aeb1c46b 43 #define PIN_INT4 PTA5
Rhyme 0:b9f8aeb1c46b 44 #define PIN_INT5 PTA4
Rhyme 0:b9f8aeb1c46b 45 /* Analog Input */
Rhyme 0:b9f8aeb1c46b 46 #define PIN_AN0 PTB0
Rhyme 0:b9f8aeb1c46b 47 #define PIN_AN1 PTB1
Rhyme 0:b9f8aeb1c46b 48 #define PIN_AN2 PTB2
Rhyme 0:b9f8aeb1c46b 49 #define PIN_AN3 PTB3
Rhyme 0:b9f8aeb1c46b 50 #define PIN_AN4 PTC2
Rhyme 0:b9f8aeb1c46b 51 #define PIN_AN5 PTC1
Rhyme 0:b9f8aeb1c46b 52 #define BOARD_NAME "FRDM-KL46Z"
Rhyme 0:b9f8aeb1c46b 53
Rhyme 0:b9f8aeb1c46b 54 #elif defined (TARGET_K64F)
Rhyme 0:b9f8aeb1c46b 55 /* I2C */
Rhyme 0:b9f8aeb1c46b 56 #define PIN_SCL PTE24
Rhyme 0:b9f8aeb1c46b 57 #define PIN_SDA PTE25
Rhyme 0:b9f8aeb1c46b 58 /* SPI */
Rhyme 0:b9f8aeb1c46b 59 #define PIN_SCK PTD1
Rhyme 0:b9f8aeb1c46b 60 #define PIN_MISO PTD3
Rhyme 0:b9f8aeb1c46b 61 #define PIN_MOSI PTD2
Rhyme 0:b9f8aeb1c46b 62 #define PIN_CS0 PTD0
Rhyme 0:b9f8aeb1c46b 63 /* Interrupt */
Rhyme 0:b9f8aeb1c46b 64 #define PIN_INT0 PTC4
Rhyme 0:b9f8aeb1c46b 65 #define PIN_INT1 PTA0
Rhyme 0:b9f8aeb1c46b 66 #define PIN_INT2 PTC3
Rhyme 0:b9f8aeb1c46b 67 #define PIN_INT3 PTC2
Rhyme 0:b9f8aeb1c46b 68 #define PIN_INT4 PTA2
Rhyme 0:b9f8aeb1c46b 69 #define PIN_INT5 PTB23
Rhyme 0:b9f8aeb1c46b 70 /* Analog Input */
Rhyme 0:b9f8aeb1c46b 71 #define PIN_AN0 PTB2
Rhyme 0:b9f8aeb1c46b 72 #define PIN_AN1 PTB3
Rhyme 0:b9f8aeb1c46b 73 #define PIN_AN2 PTB10
Rhyme 0:b9f8aeb1c46b 74 #define PIN_AN3 PTB11
Rhyme 0:b9f8aeb1c46b 75 #define PIN_AN4 PTC11
Rhyme 0:b9f8aeb1c46b 76 #define PIN_AN5 PTC10
Rhyme 0:b9f8aeb1c46b 77 #define BOARD_NAME "FRDM-K64Z"
Rhyme 0:b9f8aeb1c46b 78
Rhyme 0:b9f8aeb1c46b 79 /**
Rhyme 0:b9f8aeb1c46b 80 * NOTE: On FRDM-K22F
Rhyme 0:b9f8aeb1c46b 81 * Both I2C and UART are assigned to
Rhyme 0:b9f8aeb1c46b 82 * the same pins PTE1/PTE0.
Rhyme 0:b9f8aeb1c46b 83 * So MSS does not work as is.
Rhyme 0:b9f8aeb1c46b 84 */
Rhyme 0:b9f8aeb1c46b 85 #elif defined (TARGET_K22F)
Rhyme 0:b9f8aeb1c46b 86 /* I2C */
Rhyme 0:b9f8aeb1c46b 87 #define PIN_SCL PTE1
Rhyme 0:b9f8aeb1c46b 88 #define PIN_SDA PTE0
Rhyme 0:b9f8aeb1c46b 89 /* SPI */
Rhyme 0:b9f8aeb1c46b 90 #define PIN_SCK PTD5
Rhyme 0:b9f8aeb1c46b 91 #define PIN_MISO PTD7
Rhyme 0:b9f8aeb1c46b 92 #define PIN_MOSI PTD6
Rhyme 0:b9f8aeb1c46b 93 #define PIN_CS0 PTD4
Rhyme 0:b9f8aeb1c46b 94 /* Interrupt */
Rhyme 0:b9f8aeb1c46b 95 #define PIN_INT0 PTA1
Rhyme 0:b9f8aeb1c46b 96 #define PIN_INT1 PTB19
Rhyme 0:b9f8aeb1c46b 97 #define PIN_INT2 PTC6
Rhyme 0:b9f8aeb1c46b 98 #define PIN_INT3 PTC3
Rhyme 0:b9f8aeb1c46b 99 #define PIN_INT4 PTB18
Rhyme 0:b9f8aeb1c46b 100 #define PIN_INT5 PTA4
Rhyme 0:b9f8aeb1c46b 101 /* Analog Input */
Rhyme 0:b9f8aeb1c46b 102 #define PIN_AN0 PTB0
Rhyme 0:b9f8aeb1c46b 103 #define PIN_AN1 PTB1
Rhyme 0:b9f8aeb1c46b 104 #define PIN_AN2 PTC1
Rhyme 0:b9f8aeb1c46b 105 #define PIN_AN3 PTC2
Rhyme 0:b9f8aeb1c46b 106 #define PIN_AN4 PTB3
Rhyme 0:b9f8aeb1c46b 107 #define PIN_AN5 PTB2
Rhyme 0:b9f8aeb1c46b 108 #define BOARD_NAME "FRDM-K22F"
Rhyme 0:b9f8aeb1c46b 109
Rhyme 0:b9f8aeb1c46b 110 #elif defined (TARGET_KL05Z)
Rhyme 0:b9f8aeb1c46b 111 /* I2C */
Rhyme 0:b9f8aeb1c46b 112 #define PIN_SCL PTB3
Rhyme 0:b9f8aeb1c46b 113 #define PIN_SDA PTB4
Rhyme 0:b9f8aeb1c46b 114 /* SPI */
Rhyme 0:b9f8aeb1c46b 115 #define PIN_SCK PTB0
Rhyme 0:b9f8aeb1c46b 116 #define PIN_MISO PTA6
Rhyme 0:b9f8aeb1c46b 117 #define PIN_MOSI PTA7
Rhyme 0:b9f8aeb1c46b 118 #define PIN_CS0 PTA5
Rhyme 0:b9f8aeb1c46b 119 /* Interrupt */
Rhyme 0:b9f8aeb1c46b 120 #define PIN_INT0 PTB11
Rhyme 0:b9f8aeb1c46b 121 #define PIN_INT1 PTB10
Rhyme 0:b9f8aeb1c46b 122 #define PIN_INT2 PTB7
Rhyme 0:b9f8aeb1c46b 123 #define PIN_INT3 PTB6
Rhyme 0:b9f8aeb1c46b 124 #define PIN_INT4 PTA12
Rhyme 0:b9f8aeb1c46b 125 #define PIN_INT5 PTA10
Rhyme 0:b9f8aeb1c46b 126 /* Analog Input */
Rhyme 0:b9f8aeb1c46b 127 #define PIN_AN0 PTB8
Rhyme 0:b9f8aeb1c46b 128 #define PIN_AN1 PTB9
Rhyme 0:b9f8aeb1c46b 129 #define PIN_AN2 PTA8
Rhyme 0:b9f8aeb1c46b 130 #define PIN_AN3 PTA0
Rhyme 0:b9f8aeb1c46b 131 #define PIN_AN4 PTA9
Rhyme 0:b9f8aeb1c46b 132 #define PIN_AN5 PTB13
Rhyme 0:b9f8aeb1c46b 133 #define BOARD_NAME "FRDM-KL05Z"
Rhyme 0:b9f8aeb1c46b 134
Rhyme 0:b9f8aeb1c46b 135 #elif define (TARGET_F411RE)
Rhyme 0:b9f8aeb1c46b 136 /* I2C */
Rhyme 0:b9f8aeb1c46b 137 #define PIN_SCL PB_8
Rhyme 0:b9f8aeb1c46b 138 #define PIN_SDA PB_9
Rhyme 0:b9f8aeb1c46b 139 /* SPI */
Rhyme 0:b9f8aeb1c46b 140 #define PIN_SCK PA_5
Rhyme 0:b9f8aeb1c46b 141 #define PIN_MISO PA_6
Rhyme 0:b9f8aeb1c46b 142 #define PIN_MOSI PA_7
Rhyme 0:b9f8aeb1c46b 143 #define PIN_CS0 PB_6
Rhyme 0:b9f8aeb1c46b 144 /* Interrupt */
Rhyme 0:b9f8aeb1c46b 145 #define PIN_INT0 PC_7
Rhyme 0:b9f8aeb1c46b 146 #define PIN_INT1 PA_9
Rhyme 0:b9f8aeb1c46b 147 #define PIN_INT2 PA_8
Rhyme 0:b9f8aeb1c46b 148 #define PIN_INT3 PB_10
Rhyme 0:b9f8aeb1c46b 149 #define PIN_INT4 PB_4
Rhyme 0:b9f8aeb1c46b 150 #define PIN_INT5 PB_5
Rhyme 0:b9f8aeb1c46b 151 /* Analog In */
Rhyme 0:b9f8aeb1c46b 152 #define PIN_AN0 PA_0
Rhyme 0:b9f8aeb1c46b 153 #define PIN_AN1 PA_1
Rhyme 0:b9f8aeb1c46b 154 #define PIN_AN2 PA_4
Rhyme 0:b9f8aeb1c46b 155 #define PIN_AN3 PB_0
Rhyme 0:b9f8aeb1c46b 156 #define PIN_AN4 PC_1
Rhyme 0:b9f8aeb1c46b 157 #define PIN_AN5 PC_0
Rhyme 0:b9f8aeb1c46b 158 #define BOARD_NAME "NUCLEO-F411RE"
Rhyme 0:b9f8aeb1c46b 159
Rhyme 0:b9f8aeb1c46b 160 #else
Rhyme 0:b9f8aeb1c46b 161 #error TARGET NOT DEFINED
Rhyme 0:b9f8aeb1c46b 162 /* I2C */
Rhyme 0:b9f8aeb1c46b 163 #define PIN_SCL D15
Rhyme 0:b9f8aeb1c46b 164 #define PIN_SDA D14
Rhyme 0:b9f8aeb1c46b 165 /* SPI */
Rhyme 0:b9f8aeb1c46b 166 #define PIN_SCK D13
Rhyme 0:b9f8aeb1c46b 167 #define PIN_MISO D12
Rhyme 0:b9f8aeb1c46b 168 #define PIN_MOSI D11
Rhyme 0:b9f8aeb1c46b 169 #define PIN_CS0 D10
Rhyme 0:b9f8aeb1c46b 170 /* Interrupt */
Rhyme 0:b9f8aeb1c46b 171 #define PIN_INT0 D9
Rhyme 0:b9f8aeb1c46b 172 #define PIN_INT1 D8
Rhyme 0:b9f8aeb1c46b 173 #define PIN_INT2 D7
Rhyme 0:b9f8aeb1c46b 174 #define PIN_INT3 D6
Rhyme 0:b9f8aeb1c46b 175 #define PIN_INT4 D5
Rhyme 0:b9f8aeb1c46b 176 #define PIN_INT5 D4
Rhyme 0:b9f8aeb1c46b 177 /* Analog In */
Rhyme 0:b9f8aeb1c46b 178 #define PIN_AN0 A0
Rhyme 0:b9f8aeb1c46b 179 #define PIN_AN1 A1
Rhyme 0:b9f8aeb1c46b 180 #define PIN_AN2 A2
Rhyme 0:b9f8aeb1c46b 181 #define PIN_AN3 A3
Rhyme 0:b9f8aeb1c46b 182 #define PIN_AN4 A4
Rhyme 0:b9f8aeb1c46b 183 #define PIN_AN5 A5
Rhyme 0:b9f8aeb1c46b 184 /* MSS on board LEDs */
Rhyme 0:b9f8aeb1c46b 185 #define LED_D1 D13
Rhyme 0:b9f8aeb1c46b 186 #define LED_D2 D12
Rhyme 0:b9f8aeb1c46b 187 #define LED_D3 D11
Rhyme 0:b9f8aeb1c46b 188 #define LED_D4 D10
Rhyme 0:b9f8aeb1c46b 189 #define LED_D5 D3
Rhyme 0:b9f8aeb1c46b 190 #define LED_D6 D2
Rhyme 0:b9f8aeb1c46b 191 #define LED_D7 D1
Rhyme 0:b9f8aeb1c46b 192 #define LED_D8 D0
Rhyme 0:b9f8aeb1c46b 193
Rhyme 0:b9f8aeb1c46b 194 #endif
Rhyme 0:b9f8aeb1c46b 195
Rhyme 0:b9f8aeb1c46b 196 #endif /* _MSS_H_ */