Hello y'all,
I am trying to put my micro controller in hibernation mode when PD0 is low and wake it up when PD0 is high. Here is my code, and I don't know why this is not working. Please help me out.
Thank you in advance
#include <stdint.h>
#include <stdbool.h>
#include "utils/ustdlib.h"
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "driverlib/sysctl.h"
#include "driverlib/pin_map.h"
#include "driverlib/debug.h"
#include "driverlib/hibernate.h"
#include "driverlib/gpio.h"
int main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
//GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x08);
SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
HibernateEnableExpClk(SysCtlClockGet());
HibernateGPIORetentionEnable();
SysCtlDelay(64000000);
HibernateWakeSet(HIBERNATE_WAKE_GPIO|HIBERNATE_WAKE_PIN);
GPIOPinTypeWakeHigh(GPIO_PORTD_BASE, GPIO_PIN_0);
//GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_3, 0x00);
//HibernateGPIORetentionDisable();
HibernateRequest();
while(1)
{
}
}