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