ISSDK  1.7
IoT Sensing Software Development Kit
lpc54114.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 lpc54114.h
37  * @brief The lpc54114.h file defines GPIO pin mappings for LPCXpresso54114 board
38 */
39 
40 #ifndef LPC54114_H_
41 #define LPC54114_H_
42 
43 #include "pin_mux.h"
44 #include "fsl_power.h"
45 #include "RTE_Device.h"
46 #include "gpio_driver.h"
47 
48 // I2C4 Pin Handles
49 extern gpioHandleKSDK_t D14;
50 extern gpioHandleKSDK_t D15;
51 
52 // I2C5/SPI5 Handles
53 extern gpioHandleKSDK_t D11;
54 extern gpioHandleKSDK_t D12;
55 extern gpioHandleKSDK_t D13;
56 
57 // UART0 Handle
58 extern gpioHandleKSDK_t D0;
59 extern gpioHandleKSDK_t D1;
60 
61 // LPCXpresso54114 Arduino Connector Pin Defintion
62 extern gpioHandleKSDK_t A0;
63 extern gpioHandleKSDK_t A1;
64 extern gpioHandleKSDK_t A2;
65 extern gpioHandleKSDK_t A3;
66 extern gpioHandleKSDK_t A4;
67 extern gpioHandleKSDK_t A5;
68 extern gpioHandleKSDK_t D2;
69 extern gpioHandleKSDK_t D3;
70 extern gpioHandleKSDK_t D4;
71 extern gpioHandleKSDK_t D5;
72 extern gpioHandleKSDK_t D6;
73 extern gpioHandleKSDK_t D7;
74 extern gpioHandleKSDK_t D8;
75 extern gpioHandleKSDK_t D9;
76 extern gpioHandleKSDK_t D10;
77 
78 // LPCXpresso54114 Internal Peripheral Pin Definitions
82 
83 // I2C_S1: Pin mapping and driver information for default I2C brought to shield
84 #define I2C_S1_SCL_PIN D15
85 #define I2C_S1_SDA_PIN D14
86 #define I2C_S1_DRIVER Driver_I2C4
87 #define I2C_S1_DEVICE_INDEX I2C4_INDEX
88 #define I2C_S1_SIGNAL_EVENT I2C4_SignalEvent_t
89 
90 // I2C_S2: Pin mapping and driver information for alternate I2C bus on shield
91 #define I2C_S2_DRIVER Driver_I2C5
92 #define I2C_S2_DEVICE_INDEX I2C5_INDEX
93 #define I2C_S2_SIGNAL_EVENT I2C5_SignalEvent_t
94 
95 // SPIS: Pin mapping and driver information default SPI brought to shield
96 #define SPI_S_DRIVER Driver_SPI5
97 #define SPI_S_BAUDRATE 500000U ///< Transfer baudrate - 500k
98 #define SPI_S_DEVICE_INDEX SPI5_INDEX
99 #define SPI_S_SIGNAL_EVENT SPI5_SignalEvent_t
100 
101 // UART: Driver information for default UART to communicate with HOST PC.
102 #define HOST_S_DRIVER Driver_USART0
103 #define HOST_S_SIGNAL_EVENT HOST_SignalEvent_t
104 #define HOST_B_DRIVER Driver_USART1
105 #define HOST_B_SIGNAL_EVENT HOST_SignalEvent_t
106 
107 #define WIRED_USART USART0
108 #define WIRED_USART_CLK_SRC kCLOCK_Flexcomm0
109 #define WIRED_USART_CLK_FREQ CLOCK_GetFreq(kCLOCK_Flexcomm0)
110 #define WIRED_USART_IRQHandler FLEXCOMM0_IRQHandler
111 #define WIRED_USART_IRQn FLEXCOMM0_IRQn
112 
113 #define WIRELESS_USART USART1
114 
115 // ADS_FLASH: The next to last sector of flash.
116 #define ADS_NVM_ADDR (FSL_FEATURE_SYSCON_FLASH_SIZE_BYTES - (2 * FSL_FEATURE_SYSCON_FLASH_SECTOR_SIZE_BYTES))
117 
118 /* @brief Ask use input to resume after specified samples have been processed. */
119 #define ASK_USER_TO_RESUME(x) \
120  static bool askResume = true; \
121  static uint16_t samplesToProcess = x - 1; \
122  if (askResume && !samplesToProcess--) \
123  { \
124  PRINTF("\r\n Specified samples processed, press any key to continue... \r\n"); \
125  GETCHAR(); \
126  askResume = false; \
127  }
128 
129 /* @brief Override Kinetis style Wrapper for handling all Clock related configurations. */
130 #ifdef BOARD_BootClockRUN
131 #undef BOARD_BootClockRUN
132 #define BOARD_BootClockRUN() \
133  /* attach 12 MHz clock to FLEXCOMM0 (debug/UART0) */ \
134  CLOCK_AttachClk(kFRO12M_to_FLEXCOMM0); \
135  /* attach 12 MHz clock to FLEXCOMM4 (I2C4) */ \
136  CLOCK_AttachClk(kFRO12M_to_FLEXCOMM4); \
137  /* attach 12 MHz clock to FLEXCOMM4 (SPI5) */ \
138  CLOCK_AttachClk(kFRO12M_to_FLEXCOMM5); \
139  /* Configure FROHF48M Clock */ \
140  BOARD_BootClockFROHF48M()
141 #endif
142 
143 /* @brief dummy arguement to Power Mode Wait Wrapper. */
144 #define SMC NULL
145 
146 /* @brief Kinetis style Wrapper API for Power Mode Wait (Wait for Interrupt). */
147 status_t SMC_SetPowerModeWait(void *);
148 
149 ///@name Miscellaneous Hardware Configuration Parameters
150 ///@{
151 #define THIS_BOARD 16 ///< LPC54114
152 #define CORE_SYSTICK_HZ 48000000 ///< core and systick clock rate (Hz)
153 #define CALIBRATION_NVM_ADDR 0x0003FF00 ///< start of final 256 bytes of 256K flash memory (LPC54114)
154 #define NVM_SECTOR_NUMBER 7 ///< Sector number in flash where we will store parameters
155 #define NVM_PAGE_NUMBER 1023 ///< Page number in flash where we will store parameters
156 
157 // offsets from start of NVM block for calibration coefficients
158 #define MAG_NVM_OFFSET 0 // 68 bytes used
159 #define GYRO_NVM_OFFSET 100 // 16 bytes used
160 #define ACCEL_NVM_OFFSET 140 // 88 bytes used
161 ///@}
162 
163 #endif /* LPC54114_CM4_H_ */
gpioHandleKSDK_t D7
Definition: frdm_k64f.c:177
gpioHandleKSDK_t D14
Definition: frdm_k64f.c:50
gpioHandleKSDK_t D1
Definition: frdm_k64f.c:105
The GPIO pin handle for KSDK.
Definition: gpio_driver.h:75
gpioHandleKSDK_t A1
Definition: frdm_k64f.c:121
status_t SMC_SetPowerModeWait(void *)
Configures the system to WAIT power mode. API name used from Kinetis family to maintain compatibility...
Definition: lpc54114.c:181
gpioHandleKSDK_t A2
Definition: frdm_k64f.c:128
gpioHandleKSDK_t D13
Definition: frdm_k64f.c:75
gpioHandleKSDK_t A4
Definition: frdm_k64f.c:66
gpioHandleKSDK_t A0
Definition: frdm_k64f.c:114
gpioHandleKSDK_t RED_LED
Definition: frdm_k64f.c:207
gpioHandleKSDK_t D8
Definition: frdm_k64f.c:184
gpioHandleKSDK_t D15
Definition: frdm_k64f.c:43
gpioHandleKSDK_t GREEN_LED
Definition: frdm_k64f.c:214
gpioHandleKSDK_t A5
Definition: frdm_k64f.c:59
gpioHandleKSDK_t D6
Definition: frdm_k64f.c:170
gpioHandleKSDK_t D10
Definition: frdm_k64f.c:198
gpioHandleKSDK_t D5
Definition: frdm_k64f.c:163
gpioHandleKSDK_t D12
Definition: frdm_k64f.c:89
gpioHandleKSDK_t D4
Definition: frdm_k64f.c:156
gpioHandleKSDK_t D11
Definition: frdm_k64f.c:82
gpioHandleKSDK_t D0
Definition: frdm_k64f.c:98
gpioHandleKSDK_t A3
Definition: frdm_k64f.c:135
gpioHandleKSDK_t D3
Definition: frdm_k64f.c:149
gpioHandleKSDK_t BLUE_LED
Definition: frdm_k64f.c:221
gpioHandleKSDK_t D9
Definition: frdm_k64f.c:191
gpioHandleKSDK_t D2
Definition: frdm_k64f.c:142