ISSDK  1.7
IoT Sensing Software Development Kit
lpc54114.c
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.c
37  * @brief The lpc54114.c file defines GPIO pins and I2C CMSIS utilities for LPCXpresso54114 board.
38  */
39 
40 #include "lpc54114.h"
41 
42 // I2C4 Pin Handles
44  .pinNumber = 26,
45  .mask = 1 << (26),
46  .clockName = kCLOCK_Gpio0,
47  .portNumber = kGINT_Port0};
49  .pinNumber = 25,
50  .mask = 1 << (25),
51  .clockName = kCLOCK_Gpio0,
52  .portNumber = kGINT_Port0};
53 
54 // I2C5/SPI5 Handle
56  .pinNumber = 20,
57  .mask = 1 << (20),
58  .clockName = kCLOCK_Gpio0,
59  .portNumber = kGINT_Port0};
61  .pinNumber = 18,
62  .mask = 1 << (18),
63  .clockName = kCLOCK_Gpio0,
64  .portNumber = kGINT_Port0};
66  .pinNumber = 19,
67  .mask = 1 << (19),
68  .clockName = kCLOCK_Gpio0,
69  .portNumber = kGINT_Port0};
70 
71 // UART0 Handle
73  .pinNumber = 8,
74  .mask = 1 << (8),
75  .clockName = kCLOCK_Gpio0,
76  .portNumber = kGINT_Port0};
78  .pinNumber = 9,
79  .mask = 1 << (9),
80  .clockName = kCLOCK_Gpio0,
81  .portNumber = kGINT_Port0};
82 
83 // FRDM-K64F Arduino Connector Pin Defintion
85  .pinNumber = 30,
86  .mask = 1 << (30),
87  .clockName = kCLOCK_Gpio0,
88  .portNumber = kGINT_Port0};
89 gpioHandleKSDK_t A1; // No Connection
91  .pinNumber = 8,
92  .mask = 1 << (8),
93  .clockName = kCLOCK_Gpio1,
94  .portNumber = kGINT_Port1};
96  .pinNumber = 10,
97  .mask = 1 << (10),
98  .clockName = kCLOCK_Gpio1,
99  .portNumber = kGINT_Port1};
101  .pinNumber = 4,
102  .mask = 1 << (4),
103  .clockName = kCLOCK_Gpio1,
104  .portNumber = kGINT_Port1};
106  .pinNumber = 5,
107  .mask = 1 << (5),
108  .clockName = kCLOCK_Gpio1,
109  .portNumber = kGINT_Port1};
110 
112  .pinNumber = 10,
113  .mask = 1 << (10),
114  .clockName = kCLOCK_Gpio0,
115  .portNumber = kGINT_Port0};
117  .pinNumber = 12,
118  .mask = 1 << (12),
119  .clockName = kCLOCK_Gpio1,
120  .portNumber = kGINT_Port1};
122  .pinNumber = 13,
123  .mask = 1 << (13),
124  .clockName = kCLOCK_Gpio1,
125  .portNumber = kGINT_Port1};
127  .pinNumber = 29,
128  .mask = 1 << (29),
129  .clockName = kCLOCK_Gpio0,
130  .portNumber = kGINT_Port0};
132  .pinNumber = 0,
133  .mask = 1 << (0),
134  .clockName = kCLOCK_Gpio1,
135  .portNumber = kGINT_Port1};
137  .pinNumber = 14,
138  .mask = 1 << (14),
139  .clockName = kCLOCK_Gpio1,
140  .portNumber = kGINT_Port1};
142  .pinNumber = 16,
143  .mask = 1 << (16),
144  .clockName = kCLOCK_Gpio1,
145  .portNumber = kGINT_Port1};
147  .pinNumber = 15,
148  .mask = 1 << (15),
149  .clockName = kCLOCK_Gpio1,
150  .portNumber = kGINT_Port1};
152  .pinNumber = 1,
153  .mask = 1 << (1),
154  .clockName = kCLOCK_Gpio1,
155  .portNumber = kGINT_Port1};
156 
157 // FRDM-K64F Internal Peripheral Pin Definitions
159  .pinNumber = 29,
160  .mask = 1 << (29),
161  .clockName = kCLOCK_Gpio0,
162  .portNumber = kGINT_Port0};
164  .pinNumber = 10,
165  .mask = 1 << (10),
166  .clockName = kCLOCK_Gpio1,
167  .portNumber = kGINT_Port1};
169  .pinNumber = 9,
170  .mask = 1 << (9),
171  .clockName = kCLOCK_Gpio1,
172  .portNumber = kGINT_Port1};
173 
174 /*!
175  * @brief Configures the system to WAIT power mode.
176  * API name used from Kinetis family to maintain compatibility.
177  *
178  * @param Power peripheral base address (dummy).
179  * @return Configuration error code.
180  */
181 status_t SMC_SetPowerModeWait(void *arg)
182 {
183  POWER_EnterSleep();
184 
185  return kStatus_Success;
186 }
187 
188 /*! @brief Determines the Clock Frequency feature.
189  * @details The Clock Frequecny computation API required by fsl_uart_cmsis.c.
190  * @param[in] void
191  * @Constraints None
192  * @Reentrant Yes
193  * @return uint32_t Returns the clock frequency .
194  */
195 uint32_t USART0_GetFreq(void)
196 {
197  return CLOCK_GetFreq(kCLOCK_Flexcomm0);
198 }
199 
200 /*! @brief Determines the Clock Frequency feature.
201  * @details The Clock Frequecny computation API required by fsl_i2c_cmsis.c.
202  * @param[in] void
203  * @Constraints None
204  * @Reentrant Yes
205  * @return uint32_t Returns the clock frequency .
206  */
207 uint32_t I2C4_GetFreq(void)
208 {
209  return CLOCK_GetFreq(kCLOCK_Fro12M);
210 }
211 
212 /*! @brief Determines the Clock Frequency feature.
213  * @details The Clock Frequecny computation API required by fsl_i2c_cmsis.c.
214  * @param[in] void
215  * @Constraints None
216  * @Reentrant Yes
217  * @return uint32_t Returns the clock frequency .
218  */
219 uint32_t I2C5_GetFreq(void)
220 {
221  return CLOCK_GetFreq(kCLOCK_Fro12M);
222 }
223 
224 /*! @brief Determines the Clock Frequency feature.
225  * @details The Clock Frequecny computation API required by fsl_spi_cmsis.c.
226  * @param[in] void
227  * @Constraints None
228  * @Reentrant Yes
229  * @return uint32_t Returns the clock frequency .
230  */
231 uint32_t SPI3_GetFreq(void)
232 {
233  return CLOCK_GetFreq(kCLOCK_Flexcomm3);
234 }
235 
236 /*! @brief Determines the Clock Frequency feature.
237  * @details The Clock Frequecny computation API required by fsl_spi_cmsis.c.
238  * @param[in] void
239  * @Constraints None
240  * @Reentrant Yes
241  * @return uint32_t Returns the clock frequency .
242  */
243 uint32_t SPI5_GetFreq(void)
244 {
245  return CLOCK_GetFreq(kCLOCK_Flexcomm5);
246 }
uint32_t SPI3_GetFreq(void)
Determines the Clock Frequency feature.
Definition: lpc54114.c:231
gpioHandleKSDK_t A2
Definition: lpc54114.c:90
gpioHandleKSDK_t D3
Definition: lpc54114.c:116
gpioHandleKSDK_t A3
Definition: lpc54114.c:95
gpioHandleKSDK_t D10
Definition: lpc54114.c:151
gpioHandleKSDK_t A0
Definition: lpc54114.c:84
The GPIO pin handle for KSDK.
Definition: gpio_driver.h:75
gpioHandleKSDK_t A5
Definition: lpc54114.c:105
gpioHandleKSDK_t D1
Definition: lpc54114.c:77
gpioHandleKSDK_t BLUE_LED
Definition: lpc54114.c:168
gpioHandleKSDK_t A4
Definition: lpc54114.c:100
gpioHandleKSDK_t D8
Definition: lpc54114.c:141
The lpc54114.h file defines GPIO pin mappings for LPCXpresso54114 board.
gpioHandleKSDK_t D14
Definition: lpc54114.c:43
gpioHandleKSDK_t D0
Definition: lpc54114.c:72
gpioHandleKSDK_t D5
Definition: lpc54114.c:126
gpioHandleKSDK_t D2
Definition: lpc54114.c:111
gpioHandleKSDK_t D15
Definition: lpc54114.c:48
gpioHandleKSDK_t D9
Definition: lpc54114.c:146
gpioHandleKSDK_t D13
Definition: lpc54114.c:65
gpioHandleKSDK_t A1
Definition: lpc54114.c:89
uint32_t USART0_GetFreq(void)
Determines the Clock Frequency feature.
Definition: lpc54114.c:195
gpioHandleKSDK_t D7
Definition: lpc54114.c:136
gpioHandleKSDK_t D12
Definition: lpc54114.c:60
gpioHandleKSDK_t RED_LED
Definition: lpc54114.c:158
gpioHandleKSDK_t D11
Definition: lpc54114.c:55
uint32_t SPI5_GetFreq(void)
Determines the Clock Frequency feature.
Definition: lpc54114.c:243
gpioHandleKSDK_t D4
Definition: lpc54114.c:121
gpioHandleKSDK_t GREEN_LED
Definition: lpc54114.c:163
uint32_t I2C5_GetFreq(void)
Determines the Clock Frequency feature.
Definition: lpc54114.c:219
GPIO_Type * base
Definition: gpio_driver.h:77
status_t SMC_SetPowerModeWait(void *arg)
Configures the system to WAIT power mode. API name used from Kinetis family to maintain compatibility...
Definition: lpc54114.c:181
uint32_t I2C4_GetFreq(void)
Determines the Clock Frequency feature.
Definition: lpc54114.c:207
gpioHandleKSDK_t D6
Definition: lpc54114.c:131