//**************************************************************************** // //! \brief This function restore the backed up data (after S3) //! //! \param none //! //! \return none // //**************************************************************************** void lp3p0_restore_soc_data(void) { /* Invoking the default CC3xxx service impl. */ cc_restore_soc_data(); // // Configure the pinmux settings for the peripherals exercised // PinMuxConfig(); cc_gpio_restore_context(); #ifdef DEBUG_GPIO cc_gpio_write(tGPIODbgHndl, GPIO_09, 1); #endif /* Initialize timer services */ MAP_PRCMPeripheralClkEnable(PRCM_TIMERA0, PRCM_RUN_MODE_CLK| PRCM_SLP_MODE_CLK); /* ungates the clk for the shared SPI*/ MAP_PRCMPeripheralClkEnable(PRCM_SSPI, PRCM_RUN_MODE_CLK| PRCM_SLP_MODE_CLK); /* Initialize the DMA module */ MAP_PRCMPeripheralClkEnable(PRCM_UDMA, PRCM_RUN_MODE_CLK| PRCM_SLP_MODE_CLK); MAP_uDMAControlBaseSet(dma_ctrl_table); MAP_uDMAEnable(); MAP_PRCMIntEnable(PRCM_INT_SLOW_CLK_CTR); }
//**************************************************************************** // //! \brief This function backs up necessary registers and data(before S3) //! //! \param none //! //! \return none // //**************************************************************************** void lp3p0_back_up_soc_data(void) { #ifdef DEBUG_GPIO cc_gpio_write(tGPIODbgHndl, GPIO_09, 0); #endif /* Invoking the default CC3xxx service impl. */ cc_back_up_soc_data(PRCM_SRAM_COL_1|PRCM_SRAM_COL_2|PRCM_SRAM_COL_3); /* Park the IO PINs safely to avoid any leakage */ cc_io_park_safe(cc32xx_io_park, sizeof(cc32xx_io_park)/sizeof(struct soc_io_park)); /* Park the Antennas selection pins */ HWREG(0x4402E108) = 0x00000E61; HWREG(0x4402E10C) = 0x00000E61; return; }
//**************************************************************************** // MAIN FUNCTION //**************************************************************************** void main(void) { int iRetVal; // // Board Initialization // BoardInit(); // // Configure the pinmux settings for the peripherals exercised // PinMuxConfig(); // // Initialize the platform // platform_init(); // // Configuring UART // g_tUartHndl = uart_open(PRCM_UARTA0); #ifdef DEBUG_GPIO // // setting up GPIO for indicating the entry into LPDS // tGPIODbgHndl = cc_gpio_open(GPIO_09, GPIO_DIR_OUTPUT); cc_gpio_write(tGPIODbgHndl, GPIO_09, 1); #endif // // Start the SimpleLink Host // iRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if(iRetVal < 0) { UART_PRINT("could not create simplelink task\n\r"); LOOP_FOREVER(); } // // sync object for inter thread communication // iRetVal = osi_MsgQCreate(&g_tConnectionFlag, NULL, sizeof( unsigned char ), 1); if(iRetVal < 0) { UART_PRINT("could not create msg queue\n\r"); LOOP_FOREVER(); } // // Task creation for providing host_irq as a wake up source(LPDS) // iRetVal = osi_TaskCreate(UDPServerTask, (const signed char *)"UDP Server waiting to recv"\ "packets", OSI_STACK_SIZE, NULL, 1, NULL ); if(iRetVal < 0) { UART_PRINT("First Task creation failed\n\r"); LOOP_FOREVER(); } // // setting up timer and gpio as source for wake up from lPDS // iRetVal = osi_TaskCreate(TimerGPIOTask, (const signed char*)"Configuring Timer and GPIO as"\ " wake src", OSI_STACK_SIZE, NULL, 1, NULL ); if(iRetVal < 0) { UART_PRINT("Second Task creation failed\n\r"); LOOP_FOREVER(); } // // Start the task scheduler // osi_start(); }