ISSDK  1.7
IoT Sensing Software Development Kit
frdm_kl27z.h
Go to the documentation of this file.
1 /*
2  * The Clear BSD License
3  * Copyright (c) 2016, Freescale Semiconductor, Inc.
4  * Copyright 2016-2017 NXP
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without modification,
8  * are permitted (subject to the limitations in the disclaimer below) provided
9  * that the following conditions are met:
10  *
11  * o Redistributions of source code must retain the above copyright notice, this list
12  * of conditions and the following disclaimer.
13  *
14  * o Redistributions in binary form must reproduce the above copyright notice, this
15  * list of conditions and the following disclaimer in the documentation and/or
16  * other materials provided with the distribution.
17  *
18  * o Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from this
20  * software without specific prior written permission.
21  *
22  * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
27  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 /**
36  * @file frdm_kl27z.h
37  * @brief The frdm_kl27z.h file defines GPIO pins for FRDM-KL27Z board
38  */
39 
40 #ifndef FRDM_KL27Z_H_
41 #define FRDM_KL27Z_H_
42 
43 #include "pin_mux.h"
44 #include "fsl_smc.h"
45 #include "MKL27Z644.h"
46 #include "RTE_Device.h"
47 #include "gpio_driver.h"
48 
49 // I2C0 Pin Handles
50 extern gpioHandleKSDK_t D15;
51 extern gpioHandleKSDK_t D14;
52 
53 // I2C1 Handle
54 extern gpioHandleKSDK_t A5;
55 extern gpioHandleKSDK_t A4;
56 
57 // SPI0 Handle
58 extern gpioHandleKSDK_t D13;
59 extern gpioHandleKSDK_t D11;
60 extern gpioHandleKSDK_t D12;
61 
62 // UART0 Handle
63 extern gpioHandleKSDK_t D0;
64 extern gpioHandleKSDK_t D1;
65 
66 // FRDM-KL27Z Arduino Connector Pin Defintion
67 extern gpioHandleKSDK_t A1;
68 extern gpioHandleKSDK_t A2;
69 extern gpioHandleKSDK_t A3;
70 extern gpioHandleKSDK_t D2;
71 extern gpioHandleKSDK_t D4;
72 extern gpioHandleKSDK_t D5;
73 extern gpioHandleKSDK_t D6;
74 extern gpioHandleKSDK_t D7;
75 extern gpioHandleKSDK_t D8;
76 extern gpioHandleKSDK_t D9;
77 extern gpioHandleKSDK_t D10;
78 
79 // FRDM-KL27Z Internal Peripheral Pin Definitions
83 
84 extern gpioHandleKSDK_t INT1;
85 extern gpioHandleKSDK_t INT2;
86 
87 // I2C_S1: Pin mapping and driver information for default I2C brought to shield
88 #define I2C_S1_SCL_PIN D15
89 #define I2C_S1_SDA_PIN D14
90 #define I2C_S1_DRIVER Driver_I2C0
91 #define I2C_S1_DEVICE_INDEX I2C0_INDEX
92 #define I2C_S1_SIGNAL_EVENT I2C0_SignalEvent_t
93 
94 // I2C_S2: Pin mapping and driver information for alternate I2C bus on shield
95 #define I2C_S2_SCL_PIN A5
96 #define I2C_S2_SDA_PIN A4
97 #define I2C_S2_DRIVER Driver_I2C1
98 #define I2C_S2_DEVICE_INDEX I2C1_INDEX
99 #define I2C_S2_SIGNAL_EVENT I2C1_SignalEvent_t
100 
101 // I2C_B: Pin mapping and driver information for I2C routed on KL27Z base board
102 #define I2C_BB_SCL_PIN D15
103 #define I2C_BB_SDA_PIN D14
104 #define I2C_BB_DRIVER Driver_I2C1
105 #define I2C_BB_DEVICE_INDEX I2C1_INDEX
106 #define I2C_BB_SIGNAL_EVENT I2C1_SignalEvent_t
107 
108 // SPIS: Pin mapping and driver information default SPI brought to shield
109 #define SPI_S_SCLK D13
110 #define SPI_S_MOSI D11
111 #define SPI_S_MISO D12
112 #define SPI_S_DRIVER Driver_SPI0
113 #define SPI_S_BAUDRATE 500000U ///< Transfer baudrate - 500k
114 #define SPI_S_DEVICE_INDEX SPI0_INDEX
115 #define SPI_S_SIGNAL_EVENT SPI0_SignalEvent_t
116 
117 // UART: Driver information for default UART to communicate with HOST PC.
118 #define HOST_S_DRIVER Driver_USART0
119 #define HOST_S_SIGNAL_EVENT HOST_SignalEvent_t
120 
121 // Bluetooth: Driver information for default UART to communicate with HOST PC.
122 #define HOST_B_DRIVER Driver_USART0
123 #define HOST_B_SIGNAL_EVENT HOST_SignalEvent_t
124 
125 // On-Board MMA8451 Sensor Information
126 #define MMA845x_I2C_ADDR 0x1D
127 #define MMA845x_INT1 INT1
128 #define MMA845x_INT2 INT2
129 
130 // On-Board MAG3110 Sensor Information
131 #define MAG3110_I2C_ADDR 0x0E
132 
133 // Set GPIO pin for handling the gpio interrupt using PORTB_PORTC_PORTD_PORTE_IRQHandler
134 // By default, GPIO Pin set to GPIOC
135 #define GPIO_TYPE GPIOC
136 #define GPIO_PORT_NUM PORTC_NUM
137 
138 /* @brief Ask use input to resume after specified samples have been processed. */
139 #define ASK_USER_TO_RESUME(x) \
140  static volatile bool askResume = true; \
141  static uint16_t samplesToProcess = x - 1; \
142  if (askResume && !samplesToProcess--) \
143  { \
144  PRINTF("\r\n Specified samples processed, press any key to continue... \r\n"); \
145  GETCHAR(); \
146  askResume = false; \
147  }
148 
149 // Miscellaneous Hardware Configuration Parameters
150 #define ADS_NVM_ADDR 0x0000F800 ///< start of the next to last 1K (sector size) of the 64K flash
151 #define FLASH_SECTOR_SIZE_PROPERTY kFLASH_PropertyPflashSectorSize
152 
153 #endif /* FRDM_KL27Z_H_ */
gpioHandleKSDK_t D13
Definition: frdm_k64f.c:75
gpioHandleKSDK_t BLUE_LED
Definition: frdm_k64f.c:221
gpioHandleKSDK_t D4
Definition: frdm_k64f.c:156
gpioHandleKSDK_t D6
Definition: frdm_k64f.c:170
gpioHandleKSDK_t A4
Definition: frdm_k64f.c:66
gpioHandleKSDK_t D2
Definition: frdm_k64f.c:142
The GPIO pin handle for KSDK.
Definition: gpio_driver.h:75
gpioHandleKSDK_t D7
Definition: frdm_k64f.c:177
gpioHandleKSDK_t D11
Definition: frdm_k64f.c:82
gpioHandleKSDK_t D0
Definition: frdm_k64f.c:98
gpioHandleKSDK_t D14
Definition: frdm_k64f.c:50
gpioHandleKSDK_t RED_LED
Definition: frdm_k64f.c:207
gpioHandleKSDK_t INT1
Definition: frdm_k64f.c:230
gpioHandleKSDK_t A5
Definition: frdm_k64f.c:59
gpioHandleKSDK_t D5
Definition: frdm_k64f.c:163
gpioHandleKSDK_t A3
Definition: frdm_k64f.c:135
gpioHandleKSDK_t A1
Definition: frdm_k64f.c:121
gpioHandleKSDK_t D15
Definition: frdm_k64f.c:43
gpioHandleKSDK_t D10
Definition: frdm_k64f.c:198
gpioHandleKSDK_t D12
Definition: frdm_k64f.c:89
gpioHandleKSDK_t GREEN_LED
Definition: frdm_k64f.c:214
gpioHandleKSDK_t INT2
Definition: frdm_k64f.c:237
gpioHandleKSDK_t D9
Definition: frdm_k64f.c:191
gpioHandleKSDK_t D1
Definition: frdm_k64f.c:105
gpioHandleKSDK_t D8
Definition: frdm_k64f.c:184
gpioHandleKSDK_t A2
Definition: frdm_k64f.c:128