mirror of https://github.com/ARMmbed/mbed-os.git
Update LP API
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>pull/15263/head
parent
92983653ed
commit
7826582e44
|
|
@ -207,18 +207,18 @@ void MXC_LP_ClearWakeStatus (void);
|
|||
* @brief Enables the selected GPIO port and its selected pins to wake up the device from any low power mode.
|
||||
* Call this function multiple times to enable pins on multiple ports. This function does not configure
|
||||
* the GPIO pins nor does it setup their interrupt functionality.
|
||||
* @param wu_pins The port and pins to configure as wakeup sources. Only the gpio and mask fields of the
|
||||
* structure are used. The func and pad fields are ignored. \ref mxc_gpio_cfg_t
|
||||
* @param port The port to configure as wakeup sources.
|
||||
* @param mask The pins to configure as wakeup sources.
|
||||
*/
|
||||
void MXC_LP_EnableGPIOWakeup (mxc_gpio_cfg_t *wu_pins);
|
||||
void MXC_LP_EnableGPIOWakeup(unsigned int port, unsigned int mask);
|
||||
|
||||
/**
|
||||
* @brief Disables the selected GPIO port and its selected pins as a wake up source.
|
||||
* Call this function multiple times to disable pins on multiple ports.
|
||||
* @param wu_pins The port and pins to disable as wakeup sources. Only the gpio and mask fields of the
|
||||
* structure are used. The func and pad fields are ignored. \ref mxc_gpio_cfg_t
|
||||
* @param port The port to configure as wakeup sources.
|
||||
* @param mask The pins to configure as wakeup sources.
|
||||
*/
|
||||
void MXC_LP_DisableGPIOWakeup (mxc_gpio_cfg_t *wu_pins);
|
||||
void MXC_LP_DisableGPIOWakeup (unsigned int port, unsigned int mask);
|
||||
|
||||
/**
|
||||
* @brief Enables the RTC alarm to wake up the device from any low power mode.
|
||||
|
|
|
|||
|
|
@ -187,29 +187,31 @@ void MXC_LP_ClearWakeStatus(void)
|
|||
MXC_PWRSEQ->lppwkst = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
void MXC_LP_EnableGPIOWakeup(mxc_gpio_cfg_t* wu_pins)
|
||||
void MXC_LP_EnableGPIOWakeup(unsigned int port, unsigned int mask)
|
||||
{
|
||||
MXC_GCR->pm |= MXC_F_GCR_PM_GPIO_WE;
|
||||
|
||||
switch (1 << MXC_GPIO_GET_IDX(wu_pins->port)) {
|
||||
switch (1 << port) {
|
||||
case MXC_GPIO_PORT_0:
|
||||
MXC_PWRSEQ->lpwken0 |= wu_pins->mask;
|
||||
MXC_PWRSEQ->lpwken0 |= mask;
|
||||
break;
|
||||
|
||||
case MXC_GPIO_PORT_1:
|
||||
MXC_PWRSEQ->lpwken1 |= wu_pins->mask;
|
||||
MXC_PWRSEQ->lpwken1 |= mask;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MXC_LP_DisableGPIOWakeup(mxc_gpio_cfg_t* wu_pins)
|
||||
void MXC_LP_DisableGPIOWakeup(unsigned int port, unsigned int mask)
|
||||
{
|
||||
switch (1 << MXC_GPIO_GET_IDX(wu_pins->port)) {
|
||||
switch (1 << port) {
|
||||
case MXC_GPIO_PORT_0:
|
||||
MXC_PWRSEQ->lpwken0 &= ~wu_pins->mask;
|
||||
MXC_PWRSEQ->lpwken0 &= ~mask;
|
||||
break;
|
||||
|
||||
case MXC_GPIO_PORT_1:
|
||||
MXC_PWRSEQ->lpwken1 &= ~wu_pins->mask;
|
||||
MXC_PWRSEQ->lpwken1 &= ~mask;
|
||||
break;
|
||||
}
|
||||
|
||||
if (MXC_PWRSEQ->lpwken1 == 0 && MXC_PWRSEQ->lpwken0 == 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue