ISSDK  1.7
IoT Sensing Software Development Kit
frdm_k64f.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_k64f.h
37  * @brief The frdm_k64f.h file defines GPIO pin mappings for FRDM-K64F board
38 */
39 
40 #ifndef FRDM_K64F_H_
41 #define FRDM_K64F_H_
42 
43 #include "pin_mux.h"
44 #include "fsl_smc.h"
45 #include "MK64F12.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 // UART3 Handle
63 extern gpioHandleKSDK_t D0;
64 extern gpioHandleKSDK_t D1;
65 
66 // FRDM-K64F Arduino Connector Pin Defintion
67 extern gpioHandleKSDK_t A0;
68 extern gpioHandleKSDK_t A1;
69 extern gpioHandleKSDK_t A2;
70 extern gpioHandleKSDK_t A3;
71 extern gpioHandleKSDK_t D2;
72 extern gpioHandleKSDK_t D3;
73 extern gpioHandleKSDK_t D4;
74 extern gpioHandleKSDK_t D5;
75 extern gpioHandleKSDK_t D6;
77 extern gpioHandleKSDK_t D8;
78 extern gpioHandleKSDK_t D9;
79 extern gpioHandleKSDK_t D10;
80 
81 // FRDM-K64F Internal Peripheral Pin Definitions
85 extern gpioHandleKSDK_t INT1;
86 extern gpioHandleKSDK_t INT2;
87 
88 // I2C_S1: Pin mapping and driver information for default I2C brought to shield
89 #define I2C_S1_SCL_PIN A5
90 #define I2C_S1_SDA_PIN A4
91 #define I2C_S1_DRIVER Driver_I2C1
92 #define I2C_S1_DEVICE_INDEX I2C1_INDEX
93 #define I2C_S1_SIGNAL_EVENT I2C1_SignalEvent_t
94 
95 // I2C_S2: Pin mapping and driver information for alternate I2C bus on shield
96 #define I2C_S2_SCL_PIN D15
97 #define I2C_S2_SDA_PIN D14
98 #define I2C_S2_DRIVER Driver_I2C0
99 #define I2C_S2_DEVICE_INDEX I2C0_INDEX
100 #define I2C_S2_SIGNAL_EVENT I2C0_SignalEvent_t
101 
102 // I2C_B: Pin mapping and driver information for I2C routed on K64F base board
103 #define I2C_BB_SCL_PIN D15
104 #define I2C_BB_SDA_PIN D14
105 #define I2C_BB_DRIVER Driver_I2C0
106 #define I2C_BB_DEVICE_INDEX I2C0_INDEX
107 #define I2C_BB_SIGNAL_EVENT I2C0_SignalEvent_t
108 
109 // SPIS: Pin mapping and driver information default SPI brought to shield
110 #define SPI_S_SCLK D13
111 #define SPI_S_MOSI D11
112 #define SPI_S_MISO D12
113 #define SPI_S_DRIVER Driver_SPI0
114 #define SPI_S_BAUDRATE 500000U ///< Transfer baudrate - 500k
115 #define SPI_S_DEVICE_INDEX SPI0_INDEX
116 #define SPI_S_SIGNAL_EVENT SPI0_SignalEvent_t
117 
118 // UART: Driver information for default UART to communicate with HOST PC.
119 #define HOST_S_DRIVER Driver_USART0
120 #define HOST_S_SIGNAL_EVENT HOST_SignalEvent_t
121 
122 // Bluetooth: Driver information for default UART to communicate with HOST PC.
123 #define HOST_B_DRIVER Driver_USART3
124 #define HOST_B_SIGNAL_EVENT HOST_SignalEvent_t
125 
126 // On-Board FXOS8700 Sensor Information
127 #define FXOS8700_BB_I2C_ADDR 0x1D
128 #define FXOS8700_BB_INT1 INT1
129 #define FXOS8700_BB_INT2 INT2
130 
131 /* @brief Ask use input to resume after specified samples have been processed. */
132 #define ASK_USER_TO_RESUME(x) \
133  static volatile bool askResume = true; \
134  static uint16_t samplesToProcess = x - 1; \
135  if (askResume && !samplesToProcess--) \
136  { \
137  PRINTF("\r\n Specified samples processed, press any key to continue... \r\n"); \
138  GETCHAR(); \
139  askResume = false; \
140  }
141 
142 // Sensor Fusion Required Definitions
143 ///@{
144 // Wired UART Parameters
145 #define WIRED_UART UART0 ///< KSDK instance name for the debug UART
146 #define WIRED_UART_PORT_CLKEN kCLOCK_PortB ///< KDSK handle for the pin port clock enable
147 #define WIRED_UART_PORT PORTB ///< KDSK handle for the pin port associated with this UART
148 #define WIRED_UART_RX_PIN 16U ///< The port number associated with RX
149 #define WIRED_UART_TX_PIN 17U ///< The port number associated with TX
150 #define WIRED_UART_MUX kPORT_MuxAlt3 ///< KDSK pin mux selector
151 #ifndef USE_ORIENT_APP_CONTROL ///< If Using Orient App then use Host I/O
152 #define WIRED_UART_IRQHandler UART0_RX_TX_IRQHandler ///< KDSK-specified IRQ handler name
153 #endif
154 #define WIRED_UART_IRQn UART0_RX_TX_IRQn ///< The interrupt number associated with this IRQ
155 #define WIRED_UART_CLKSRC UART0_CLK_SRC ///< KSDK instance name for the clock feeding this module
156 #define WIRED_UART_IRQn UART0_RX_TX_IRQn ///< KSDK interrupt vector number
157 
158 // Wireless UART Parameters
159 #define WIRELESS_UART UART3 ///< KSDK instance name for the debug UART
160 #define WIRELESS_UART_PORT_CLKEN kCLOCK_PortC ///< KDSK handle for the pin port clock enable
161 #define WIRELESS_UART_PORT PORTC ///< KDSK handle for the pin port associated with this UART
162 #define WIRELESS_UART_RX_PIN 16U ///< The port number associated with RX
163 #define WIRELESS_UART_TX_PIN 17U ///< The port number associated with TX
164 #define WIRELESS_UART_MUX kPORT_MuxAlt3 ///< KDSK pin mux selector
165 #define WIRELESS_UART_IRQHandler UART3_RX_TX_IRQHandler ///< KDSK-specified IRQ handler name
166 #define WIRELESS_UART_IRQn UART3_RX_TX_IRQn ///< The interrupt number associated with this IRQ
167 #define WIRELESS_UART_CLKSRC UART3_CLK_SRC ///< KSDK instance name for the clock feeding this module
168 #define WIRELESS_UART_IRQn UART3_RX_TX_IRQn ///< KSDK interrupt vector number
169 
170 // Miscellaneous Hardware Configuration Parameters
171 #define THIS_BOARD 5 ///< FRDM_K64F
172 #define CORE_SYSTICK_HZ 120000000 ///< core and systick clock rate (Hz)
173 #define CALIBRATION_NVM_ADDR 0x000FF000 ///< start of final 4K (sector size) of 1M flash
174 #define ADS_NVM_ADDR 0x000FE000 ///< start of the next to last 4K (sector size) of the 1M flash
175 #define FLASH_SECTOR_SIZE_PROPERTY kFLASH_PropertyPflashSectorSize
176 #define FLASH_ERASE_KEY kFLASH_ApiEraseKey
177 
178 // offsets from start of NVM block for calibration coefficients
179 #define MAG_NVM_OFFSET 0 // 68 bytes used
180 #define GYRO_NVM_OFFSET 100 // 16 bytes used
181 #define ACCEL_NVM_OFFSET 140 // 88 bytes used
182 ///@}
183 
184 #endif /* FRDM_K64F_H_ */
gpioHandleKSDK_t D11
Definition: frdm_k64f.c:82
gpioHandleKSDK_t D6
Definition: frdm_k64f.h:76
gpioHandleKSDK_t GREEN_LED
Definition: frdm_k64f.c:214
The GPIO pin handle for KSDK.
Definition: gpio_driver.h:75
gpioHandleKSDK_t A2
Definition: frdm_k64f.c:128
gpioHandleKSDK_t D9
Definition: frdm_k64f.c:191
gpioHandleKSDK_t A5
Definition: frdm_k64f.c:59
gpioHandleKSDK_t D0
Definition: frdm_k64f.c:98
gpioHandleKSDK_t A4
Definition: frdm_k64f.c:66
gpioHandleKSDK_t D5
Definition: frdm_k64f.c:163
gpioHandleKSDK_t INT1
Definition: frdm_k64f.c:230
gpioHandleKSDK_t D4
Definition: frdm_k64f.c:156
gpioHandleKSDK_t A0
Definition: frdm_k64f.c:114
gpioHandleKSDK_t D3
Definition: frdm_k64f.c:149
gpioHandleKSDK_t D2
Definition: frdm_k64f.c:142
gpioHandleKSDK_t INT2
Definition: frdm_k64f.c:237
gpioHandleKSDK_t RED_LED
Definition: frdm_k64f.c:207
gpioHandleKSDK_t D13
Definition: frdm_k64f.c:75
gpioHandleKSDK_t BLUE_LED
Definition: frdm_k64f.c:221
gpioHandleKSDK_t D1
Definition: frdm_k64f.c:105
gpioHandleKSDK_t D8
Definition: frdm_k64f.c:184
gpioHandleKSDK_t D14
Definition: frdm_k64f.c:50
gpioHandleKSDK_t D15
Definition: frdm_k64f.c:43
gpioHandleKSDK_t A1
Definition: frdm_k64f.c:121
gpioHandleKSDK_t D10
Definition: frdm_k64f.c:198
gpioHandleKSDK_t A3
Definition: frdm_k64f.c:135
gpioHandleKSDK_t D12
Definition: frdm_k64f.c:89