ISSDK  1.8
IoT Sensing Software Development Kit
evkmimxrt1170.c
Go to the documentation of this file.
1 /*
2  * Copyright 2020 NXP
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 /**
9  * @file evkmimxrt1170.c
10  * @brief The evkmimxrt1170.c file defines GPIO pins and I2C CMSIS utilities for evkmimxrt1170 board.
11  */
12 
13 #include "evkmimxrt1170.h"
14 
15 /*
16  * Execute the instrument to enter low power.
17  */
18 static void stop(void)
19 {
20  SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
21  __asm("WFI");
22 }
23 
24 /*!
25  * @brief Configures the system to WAIT power mode.
26  * API name used from Kinetis family to maintain compatibility.
27  *
28  * @param Power peripheral base address (dummy).
29  * @return Configuration error code.
30  */
31 status_t SMC_SetPowerModeWait(void *arg)
32 {
33  CLOCK_SetMode(kCLOCK_ModeWait);
34  stop();
35 
36  return kStatus_Success;
37 }
38 
39 /*!
40  * @brief Configures the system to VLPR power mode.
41  * API name used from Kinetis family to maintain compatibility.
42  *
43  * @param Power peripheral base address (dummy).
44  * @return Configuration error code.
45  */
46 status_t SMC_SetPowerModeVlpr(void *arg)
47 {
48  CLOCK_SetMode(kCLOCK_ModeWait);
49  stop();
50 
51  return kStatus_Success;
52 }
53 
54 /*! @brief Determines the Clock Frequency feature.
55  * @details The Clock Frequecny computation API required by fsl_uart_cmsis.c.
56  * @param[in] void
57  * @Constraints None
58  * @Reentrant Yes
59  * @return uint32_t Returns the clock frequency .
60  */
61 uint32_t LPUART1_GetFreq(void)
62 {
64 }
65 
66 /*! @brief Determines the Clock Frequency feature.
67  * @details The Clock Frequecny computation API required by fsl_i2c_cmsis.c.
68  * @param[in] void
69  * @Constraints None
70  * @Reentrant Yes
71  * @return uint32_t Returns the clock frequency .
72  */
73 uint32_t LPI2C1_GetFreq(void)
74 {
75  return CLOCK_GetFreq(kCLOCK_OscRc48MDiv2);
76 }
77 
78 /*! @brief Determines the Clock Frequency feature.
79  * @details The Clock Frequecny computation API required by fsl_spi_cmsis.c.
80  * @param[in] void
81  * @Constraints None
82  * @Reentrant Yes
83  * @return uint32_t Returns the clock frequency .
84  */
85 uint32_t LPSPI1_GetFreq(void)
86 {
87  return CLOCK_GetFreqFromObs(CCM_OBS_LPSPI1_CLK_ROOT);
88 }
uint32_t BOARD_DebugConsoleSrcFreq(void)
Definition: board.c:25
uint32_t LPSPI1_GetFreq(void)
Determines the Clock Frequency feature.
Definition: evkmimxrt1170.c:85
status_t SMC_SetPowerModeWait(void *arg)
Configures the system to WAIT power mode. API name used from Kinetis family to maintain compatibility...
Definition: evkmimxrt1170.c:31
uint32_t LPI2C1_GetFreq(void)
Determines the Clock Frequency feature.
Definition: evkmimxrt1170.c:73
The evkmimxrt1170.h file defines GPIO pin mappings for evkmimxrt1170 board.
status_t SMC_SetPowerModeVlpr(void *arg)
Configures the system to VLPR power mode. API name used from Kinetis family to maintain compatibility...
Definition: evkmimxrt1170.c:46
uint32_t LPUART1_GetFreq(void)
Determines the Clock Frequency feature.
Definition: evkmimxrt1170.c:61