这篇教程C++ GPIO_IF_LedOff函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GPIO_IF_LedOff函数的典型用法代码示例。如果您正苦于以下问题:C++ GPIO_IF_LedOff函数的具体用法?C++ GPIO_IF_LedOff怎么用?C++ GPIO_IF_LedOff使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GPIO_IF_LedOff函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: OOBTask//****************************************************************************////! /brief OOB Application Main Task - Initializes SimpleLink Driver and//! Handles HTTP Requests//! /param[in] pvParameters is the data passed to the Task//!//! /return None////****************************************************************************static void OOBTask(void *pvParameters){ //Read Device Mode Configuration ReadDeviceConfiguration(); //Connect to Network ConnectToNetwork(); //Handle Async Events while(1) { //LED Actions if(g_ucLEDStatus == LED_ON) { GPIO_IF_LedOn(MCU_RED_LED_GPIO); osi_Sleep(500); } if(g_ucLEDStatus == LED_OFF) { GPIO_IF_LedOff(MCU_RED_LED_GPIO); osi_Sleep(500); } if(g_ucLEDStatus==LED_BLINK) { GPIO_IF_LedOn(MCU_RED_LED_GPIO); osi_Sleep(500); GPIO_IF_LedOff(MCU_RED_LED_GPIO); osi_Sleep(500); } }}
开发者ID:JamesHyunKim,项目名称:quickstart-samples,代码行数:41,
示例2: LEDBlinkyRoutine//*****************************************************************************////! Configures the pins as GPIOs and peroidically toggles the lines//!//! /param None//!//! This function//! 1. Configures 3 lines connected to LEDs as GPIO//! 2. Sets up the GPIO pins as output//! 3. Periodically toggles each LED one by one by toggling the GPIO line//!//! /return None////*****************************************************************************void LEDBlinkyRoutine(){ // // Toggle the lines initially to turn off the LEDs. // The values driven are as required by the LEDs on the LP. // GPIO_IF_LedOff(MCU_ALL_LED_IND); while(1) { // // Alternately toggle hi-low each of the GPIOs // to switch the corresponding LED on/off. // MAP_UtilsDelay(8000000); GPIO_IF_LedOn(MCU_RED_LED_GPIO); MAP_UtilsDelay(8000000); GPIO_IF_LedOff(MCU_RED_LED_GPIO); MAP_UtilsDelay(8000000); GPIO_IF_LedOn(MCU_ORANGE_LED_GPIO); MAP_UtilsDelay(8000000); GPIO_IF_LedOff(MCU_ORANGE_LED_GPIO); MAP_UtilsDelay(8000000); GPIO_IF_LedOn(MCU_GREEN_LED_GPIO); MAP_UtilsDelay(8000000); GPIO_IF_LedOff(MCU_GREEN_LED_GPIO); }}
开发者ID:ClarePhang,项目名称:CC3200,代码行数:42,
示例3: main//*****************************************************************************////! main function demonstrates the use of the timers to generate//! periodic interrupts.//!//! /param None//!//! /return none////*****************************************************************************intmain(void){ // // Initialize board configurations BoardInit(); // // Pinmuxing for LEDs // PinMuxConfig(); // // configure the LED RED and GREEN // GPIO_IF_LedConfigure(LED1|LED3); GPIO_IF_LedOff(MCU_RED_LED_GPIO); GPIO_IF_LedOff(MCU_GREEN_LED_GPIO); // // Base address for first timer // g_ulBase = TIMERA0_BASE; // // Base address for second timer // g_ulRefBase = TIMERA1_BASE; // // Configuring the timers // Timer_IF_Init(PRCM_TIMERA0, g_ulBase, TIMER_CFG_PERIODIC, TIMER_A, 0); Timer_IF_Init(PRCM_TIMERA1, g_ulRefBase, TIMER_CFG_PERIODIC, TIMER_A, 0); // // Setup the interrupts for the timer timeouts. // Timer_IF_IntSetup(g_ulBase, TIMER_A, TimerBaseIntHandler); Timer_IF_IntSetup(g_ulRefBase, TIMER_A, TimerRefIntHandler); // // Turn on the timers feeding values in mSec // Timer_IF_Start(g_ulBase, TIMER_A, 500); Timer_IF_Start(g_ulRefBase, TIMER_A, 1000); // // Loop forever while the timers run. // while(FOREVER) { }}
开发者ID:CaptFrank,项目名称:CC3200-Linux-SDK,代码行数:61,
示例4: MicroPhoneControl//*****************************************************************************////! MicroPhone Control Routine//!//! /param pValue - pointer to a memory structure that is passed //! to the interrupt handler.//!//! /return None////*****************************************************************************void MicroPhoneControl(void* pValue){ int iCount=0; unsigned long ulPin5Val = 1; //Check whether GPIO Level is Stable As No Debouncing Circuit in LP for(iCount=0;iCount<3;iCount++) { osi_Sleep(200); ulPin5Val = MAP_GPIOPinRead(GPIOA1_BASE,GPIO_PIN_5); if(ulPin5Val) { //False Alarm return; } } if (g_ucMicStartFlag == 0) { for(iCount = 0; iCount<3; iCount++) { //Blink LED 3 times to Indicate ON GPIO_IF_LedOff(MCU_GREEN_LED_GPIO); osi_Sleep(50); GPIO_IF_LedOn(MCU_GREEN_LED_GPIO); osi_Sleep(50); } g_ucMicStartFlag = 1; } else { //Blink LED 3 times to Indicate OFF for(iCount = 0; iCount<3; iCount++) { GPIO_IF_LedOn(MCU_GREEN_LED_GPIO); osi_Sleep(50); GPIO_IF_LedOff(MCU_GREEN_LED_GPIO); osi_Sleep(50); } g_ucMicStartFlag = 0; } //Enable GPIO Interrupt MAP_GPIOIntClear(GPIOA1_BASE,GPIO_PIN_5); MAP_IntPendClear(INT_GPIOA1); MAP_IntEnable(INT_GPIOA1); MAP_GPIOIntEnable(GPIOA1_BASE,GPIO_PIN_5);}
开发者ID:gale320,项目名称:cc3200,代码行数:59,
示例5: WlanConnect//****************************************************************************////! /brief Connecting to a WLAN Accesspoint//!//! This function connects to the required AP (SSID_NAME) with Security//! parameters specified in te form of macros at the top of this file//!//! /param None//!//! /return 0 on success else error code //!//! /warning If the WLAN connection fails or we don't aquire an IP//! address, It will be stuck in this function forever.////****************************************************************************long WlanConnect(){ long lRetVal = -1; SlSecParams_t secParams; secParams.Key = SECURITY_KEY; secParams.KeyLen = strlen(SECURITY_KEY); secParams.Type = SECURITY_TYPE; lRetVal = sl_WlanConnect(SSID_NAME,strlen(SSID_NAME),0,&secParams,0); ASSERT_ON_ERROR(lRetVal); while((!IS_CONNECTED(g_ulStatus)) || (!IS_IP_ACQUIRED(g_ulStatus))) { // Toggle LEDs to Indicate Connection Progress GPIO_IF_LedOff(MCU_IP_ALLOC_IND); MAP_UtilsDelay(800000); GPIO_IF_LedOn(MCU_IP_ALLOC_IND); MAP_UtilsDelay(800000); } // // Red LED on to indicate AP connection // GPIO_IF_LedOn(MCU_IP_ALLOC_IND); return SUCCESS;}
开发者ID:gale320,项目名称:cc3200,代码行数:42,
示例6: TimerPeriodicIntHandler//*****************************************************************************////! Periodic Timer Interrupt Handler//!//! /param None//!//! /return None////*****************************************************************************voidTimerPeriodicIntHandler(void){ unsigned long ulInts; // // Clear all pending interrupts from the timer we are // currently using. // ulInts = MAP_TimerIntStatus(TIMERA0_BASE, true); MAP_TimerIntClear(TIMERA0_BASE, ulInts); // // Increment our interrupt counter. // g_usTimerInts++; if(!(g_usTimerInts & 0x1)) { // // Off Led // GPIO_IF_LedOff(MCU_RED_LED_GPIO); } else { // // On Led // GPIO_IF_LedOn(MCU_RED_LED_GPIO); }}
开发者ID:oter,项目名称:BSPTools,代码行数:40,
示例7: SmartConfigTask//*****************************************************************************////! /brief Starts Smart Configuration//!//! /param none//!//! /return void//! /note//! /warning//*****************************************************************************void SmartConfigTask(void* pValue){ long lRetVal = -1; DispatcherUartSendPacket((char*)pucUARTSmartConfigString, sizeof(pucUARTSmartConfigString)); //Turn off the Network Status LED GPIO_IF_LedOff(MCU_IP_ALLOC_IND); LedTimerConfigNStart(); //Reset the Network Status before Entering Smart Config Network_IF_UnsetMCUMachineState(STATUS_BIT_CONNECTION); Network_IF_UnsetMCUMachineState(STATUS_BIT_IP_AQUIRED); lRetVal = SmartConfigConnect(); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Wait until IP is acquired // while (!(IS_CONNECTED(Network_IF_CurrentMCUState())) || !(IS_IP_ACQUIRED(Network_IF_CurrentMCUState()))); LedTimerDeinitStop(); // Red LED on GPIO_IF_LedOn(MCU_IP_ALLOC_IND); //Enable GPIO Interrupt Button_IF_EnableInterrupt(SW2);}
开发者ID:oter,项目名称:BSPTools,代码行数:45,
示例8: WatchdogIntHandler//*****************************************************************************////! The interrupt handler for the watchdog timer//!//! /param None//!//! /return None////*****************************************************************************void WatchdogIntHandler(void){ // // If we have been told to stop feeding the watchdog, return immediately // without clearing the interrupt. This will cause the system to reset // next time the watchdog interrupt fires. // if(!g_bFeedWatchdog) { return; } // // After 10 interrupts, switch On LED6 to indicate system reset // and don't clear watchdog interrupt which causes system reset // if(g_ulWatchdogCycles >= 10) { GPIO_IF_LedOn(MCU_RED_LED_GPIO); MAP_UtilsDelay(800000); return; } // // Clear the watchdog interrupt. // MAP_WatchdogIntClear(WDT_BASE); GPIO_IF_LedOn(MCU_RED_LED_GPIO); MAP_UtilsDelay(800000); GPIO_IF_LedOff(MCU_RED_LED_GPIO); // // Increment our interrupt counter. // g_ulWatchdogCycles++;}
开发者ID:CaptFrank,项目名称:CC3200-Linux-SDK,代码行数:43,
示例9: WlanConnect//****************************************************************************////! /brief Connecting to a WLAN Accesspoint//!//! This function connects to the required AP (SSID_NAME) with Security//! parameters specified in te form of macros at the top of this file//!//! /param None//!//! /return 0 on success else error code//!//! /warning If the WLAN connection fails or we don't aquire an IP//! address, It will be stuck in this function forever.////****************************************************************************static long WlanConnect(){ SlSecParams_t secParams = {0}; long lRetVal = 0; secParams.Key = SECURITY_KEY; secParams.KeyLen = strlen(SECURITY_KEY); secParams.Type = SECURITY_TYPE; lRetVal = sl_WlanConnect(SSID_NAME, strlen(SSID_NAME), 0, &secParams, 0); ASSERT_ON_ERROR(lRetVal); // Wait for WLAN Event while((!IS_CONNECTED(g_ulStatus)) || (!IS_IP_ACQUIRED(g_ulStatus))) { // Toggle LEDs to Indicate Connection Progress _SlNonOsMainLoopTask(); GPIO_IF_LedOff(MCU_IP_ALLOC_IND); MAP_UtilsDelay(800000); _SlNonOsMainLoopTask(); GPIO_IF_LedOn(MCU_IP_ALLOC_IND); MAP_UtilsDelay(800000); } return SUCCESS;}
开发者ID:moyanming,项目名称:CC3200SDK_1.2.0,代码行数:42,
示例10: fm_playerint fm_player(void){ char song_url[128] = {0}; // It's very tricky douban encoding track name into sequence number, so the url is pretty formated int index = 0; Report("Douban FM is ready/r/n"); while(1) { //fm_get_channel(); if(index >= 10) index = 0; else index++; memset(song_url, 0, sizeof(song_url)); fm_get_song(song_url, "1", index); if (strlen(song_url)) { Report("Going to play : %s/r/n", song_url); GPIO_IF_LedOn(MCU_ORANGE_LED_GPIO); fm_play_song(song_url); GPIO_IF_LedOff(MCU_ORANGE_LED_GPIO); } else { // wait for next try Report("Cannot fitch a song to play, waiting for next try/r/n"); osi_Sleep(1000); } }}
开发者ID:cha0s-repo,项目名称:douban_FM,代码行数:33,
示例11: process_commandstatic void process_command(struct mg_connection *nc, unsigned char *data, size_t len) { // TODO(lsm): use proper JSON parser int cmd, val; if (sscanf((char *) data, "{/"t/":%d,/"v/":%d}", &cmd, &val) != 2) { LOG(LL_ERROR, ("Invalid request: %.*s", (int) len, data)); return; } if (cmd == 1) { switch (val) { case '0': { GPIO_IF_LedOff(MCU_RED_LED_GPIO); break; } case '1': { GPIO_IF_LedOn(MCU_RED_LED_GPIO); break; } case '2': { GPIO_IF_LedToggle(MCU_RED_LED_GPIO); break; } default: { LOG(LL_ERROR, ("Invalid value: %.*s", (int) len, data)); return; } } } else { LOG(LL_ERROR, ("Unknown command: %.*s", (int) len, data)); return; }}
开发者ID:cesanta,项目名称:mongoose,代码行数:32,
示例12: ToggleLedState//****************************************************************************////! Toggles the state of GPIOs(LEDs)//!//! /param LedNum is the enumeration for the GPIO to be toggled//!//! /return none////****************************************************************************void ToggleLedState(ledEnum LedNum){ unsigned char ledstate = 0; switch(LedNum) { case LED1: ledstate = GPIO_IF_LedStatus(MCU_RED_LED_GPIO); if(!ledstate) { GPIO_IF_LedOn(MCU_RED_LED_GPIO); } else { GPIO_IF_LedOff(MCU_RED_LED_GPIO); } break; case LED2: ledstate = GPIO_IF_LedStatus(MCU_ORANGE_LED_GPIO); if(!ledstate) { GPIO_IF_LedOn(MCU_ORANGE_LED_GPIO); } else { GPIO_IF_LedOff(MCU_ORANGE_LED_GPIO); } break; case LED3: ledstate = GPIO_IF_LedStatus(MCU_GREEN_LED_GPIO); if(!ledstate) { GPIO_IF_LedOn(MCU_GREEN_LED_GPIO); } else { GPIO_IF_LedOff(MCU_GREEN_LED_GPIO); } break; default: break; }}
开发者ID:jfrancoya,项目名称:cc3200-mqtt_client,代码行数:51,
示例13: mainint main(void){ long lRetVal = -1; // // initialize board configurations // BoardInit(); // // Pinmux GPIO for LEDs // PinMuxConfig();#ifndef NOTERM // // Configuring UART // InitTerm();#endif // // Configure LEDs // GPIO_IF_LedConfigure(LED1|LED2|LED3); GPIO_IF_LedOff(MCU_ALL_LED_IND); // // Simplelinkspawntask // lRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } lRetVal = osi_TaskCreate(XmppClient, (const signed char*)"XmppClient",/ OSI_STACK_SIZE, NULL, 1, NULL ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } osi_start(); while(1) { }}
开发者ID:gale320,项目名称:cc3200,代码行数:54,
示例14: initBoardvoid initBoard() {#ifndef USE_TIRTOS#if defined(ccs) || defined(gcc) MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]);#endif#if defined(ewarm) MAP_IntVTableBaseSet((unsigned long)&__vector_table);#endif#endif MAP_IntMasterEnable(); MAP_IntEnable(FAULT_SYSTICK); PRCMCC3200MCUInit(); PinMuxConfig(); GPIO_IF_LedConfigure(LED1); GPIO_IF_LedOff(MCU_RED_LED_GPIO); InitTerm(); ClearTerm(); UART_PRINT("Blink - Parse for IoT sample application/r/n"); UART_PRINT("----------------------------------------/r/n"); UART_PRINT("/r/n"); UART_PRINT("[Blink] Board init/r/n"); // start the spawn task short status = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if (status < 0) { UART_PRINT("[Blink] Spawn task failed/r/n"); ERR_PRINT(status); LOOP_FOREVER(); } // initialize the I2C bus status = I2C_IF_Open(I2C_MASTER_MODE_FST); if (status < 0) { UART_PRINT("[Blink] I2C opening error/r/n"); ERR_PRINT(status); LOOP_FOREVER(); } UART_PRINT("[Blink] Device : TI SimpleLink CC3200/r/n");#ifdef USE_TIRTOS UART_PRINT("[Blink] Operating system : TI-RTOS/r/n");#endif#ifdef USE_FREERTOS UART_PRINT("[Blink] Operating system : FreeRTOS/r/n");#endif#ifndef SL_PLATFORM_MULTI_THREADED UART_PRINT("[Blink] Operating system : None/r/n");#endif}
开发者ID:AnjaneyuluAdepu,项目名称:parse-embedded-sdks,代码行数:54,
示例15: InfiniteLoopTaskvoid InfiniteLoopTask(void *pvParameters){ // GPIO Configuration GPIO_IF_LedConfigure(LED1|LED3); GPIO_IF_LedOff(MCU_RED_LED_GPIO); TimerConfigNStart(); while(1);}
开发者ID:tzhenghao,项目名称:TimerInterruptsOnCC3200,代码行数:11,
示例16: GPIO_IF_LedToggle//*****************************************************************************////! Toggle the Led state//!//! /param ledNum is the LED Number//!//! /return none//!//! /brief Toggles a board LED////*****************************************************************************void GPIO_IF_LedToggle(unsigned char ucLedNum){ unsigned char ucLEDStatus = GPIO_IF_LedStatus(ucLedNum); if(ucLEDStatus == 1) { GPIO_IF_LedOff(ucLedNum); } else { GPIO_IF_LedOn(ucLedNum); }}
开发者ID:Eterneco,项目名称:iot_control,代码行数:24,
示例17: OOBTask//****************************************************************************////! /brief OOB Application Main Task - Initializes SimpleLink Driver and//! Handles HTTP Requests//! /param[in] pvParameters is the data passed to the Task//!//! /return None////****************************************************************************static void OOBTask(void *pvParameters){ long lRetVal = -1; //Read Device Mode Configuration ReadDeviceConfiguration(); //Connect to Network lRetVal = ConnectToNetwork(); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } //Handle Async Events while(1) { //LED Actions if(g_ucLEDStatus == LED_ON) { GPIO_IF_LedOn(MCU_RED_LED_GPIO); osi_Sleep(500); } if(g_ucLEDStatus == LED_OFF) { GPIO_IF_LedOff(MCU_RED_LED_GPIO); osi_Sleep(500); } if(g_ucLEDStatus==LED_BLINK) { GPIO_IF_LedOn(MCU_RED_LED_GPIO); osi_Sleep(500); GPIO_IF_LedOff(MCU_RED_LED_GPIO); osi_Sleep(500); } }}
开发者ID:robbie-cao,项目名称:cc3200,代码行数:47,
示例18: MainLoop// main task to loopvoid MainLoop(void *pvParameters) { ButtonInit(); for(;;) { if (val&1) { GPIO_IF_LedOn(MCU_RED_LED_GPIO); } else { GPIO_IF_LedOff(MCU_RED_LED_GPIO); } if (val &(1<<1)) { GPIO_IF_LedOn(MCU_ORANGE_LED_GPIO); } else { GPIO_IF_LedOff(MCU_ORANGE_LED_GPIO); } if (val & (1<<2)) { GPIO_IF_LedOn(MCU_GREEN_LED_GPIO); } else { GPIO_IF_LedOff(MCU_GREEN_LED_GPIO); } }}
开发者ID:yuch7,项目名称:cc3200-MCU,代码行数:24,
示例19: main//*****************************************************************************// MAIN FUNCTION//*****************************************************************************void main() { // // Board Initialization // BoardInit(); // // configure the GPIO pins for LEDs,UART // PinMuxConfig(); // // Configure the UART //#ifndef NOTERM InitTerm();#endif //NOTERM // // Display Application Banner // DisplayBanner(APPLICATION_NAME); // // Configure all 3 LEDs // GPIO_IF_LedConfigure(LED1 | LED2 | LED3); // switch off all LEDs GPIO_IF_LedOff(MCU_ALL_LED_IND); FileTest(); /*// // Start the SimpleLink Host // VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); // // Start the WlanStationMode task // osi_TaskCreate( WlanStationMode, (const signed char*)"Wlan Station Task", OSI_STACK_SIZE, NULL, 1, NULL ); // // Start the task scheduler // osi_start();*/}
开发者ID:Balu1991,项目名称:Wifly_Light,代码行数:50,
示例20: TimerPeriodicIntHandler/* EFFECTS: Timer Interrupt handler, which toggles the RED led */void TimerPeriodicIntHandler(void){ unsigned long ulInts; // Clear all pending interrupts from the timer we are currently using. ulInts = MAP_TimerIntStatus(TIMERA0_BASE, true); MAP_TimerIntClear(TIMERA0_BASE, ulInts); // Increment our interrupt counter. if(g_usTimerInts) { GPIO_IF_LedOff(MCU_RED_LED_GPIO); g_usTimerInts = 0; } else { GPIO_IF_LedOn(MCU_RED_LED_GPIO); g_usTimerInts = 1; }}
开发者ID:tzhenghao,项目名称:TimerInterruptsOnCC3200,代码行数:21,
示例21: main//****************************************************************************////! Main function//!//! /param none//! //! This function //! 1. Invokes the LEDBlinkyTask//!//! /return None.////****************************************************************************intmain(){ // // Initialize Board configurations // BoardInit(); // // Power on the corresponding GPIO port B for 9,10,11. // Set up the GPIO lines to mode 0 (GPIO) // PinMuxConfig(); #ifndef NOTERM // // Configuring UART // InitTerm(); #endif DisplayBanner("Lab 0"); Message("/t/t****************************************************/n/r"); Message("/t/t/t CC3200 UART Echo Usage /n/r"); Message("/t/t To get to state 3, the user must press and hold SW2 /n/r"); Message("/t/t then press SW3 without releasing SW2 /n/r"); Message("/t/t and then release SW2 while continuing to press SW3/n/r"); Message("/n/n/n/r"); GPIO_IF_LedConfigure(LED1|LED2|LED3); GPIO_IF_LedOff(MCU_ALL_LED_IND); // // Start the LEDBlinkyRoutine // LEDBlinkyRoutine(); return 0;}
开发者ID:nqngo22,项目名称:CC3200_LED,代码行数:51,
示例22: launchpad_initvoid launchpad_init(void){ long lRetVal = -1; PinConfigSet(PIN_58, PIN_STRENGTH_2MA | PIN_STRENGTH_4MA, PIN_TYPE_STD_PD); GPIO_IF_LedConfigure(LED1|LED2|LED3); GPIO_IF_LedOff(MCU_ALL_LED_IND); MAP_UtilsDelay(8000000); GPIO_IF_LedOn(MCU_GREEN_LED_GPIO); Report ("Initialize I2C..."); // // I2C Init // lRetVal = I2C_IF_Open(I2C_MASTER_MODE_FST); if(lRetVal < 0) { Report ("Fail!/r/n"); while(1); } Report ("Success/r/n");}
开发者ID:CospanDesign,项目名称:annalogger,代码行数:23,
示例23: main//****************************************************************************////! Main function//!//! /param none//!//! This function//! 1. Invokes the LEDBlinkyTask//!//! /return None.////****************************************************************************intmain(){ // // Initialize Board configurations // BoardInit(); // // Power on the corresponding GPIO port B for 9,10,11. // Set up the GPIO lines to mode 0 (GPIO) // PinMuxConfig(); GPIO_IF_LedConfigure(LED1|LED2|LED3); GPIO_IF_LedOff(MCU_ALL_LED_IND); // // Start the LEDBlinkyRoutine // LEDBlinkyRoutine(); return 0;}
开发者ID:ClarePhang,项目名称:CC3200,代码行数:35,
示例24: ssl//*****************************************************************************////! This function demonstrates how certificate can be used with SSL.//! The procedure includes the following steps://! 1) connect to an open AP//! 2) get the server name via a DNS request//! 3) define all socket options and point to the CA certificate//! 4) connect to the server via TCP//!//! /param None//!//! /return 0 on success else error code//! /return LED1 is turned solid in case of success//! LED2 is turned solid in case of failure//!//*****************************************************************************static long ssl(){ SlSockAddrIn_t Addr; int iAddrSize; unsigned char ucMethod = SL_SO_SEC_METHOD_SSLV3; unsigned int uiIP,uiCipher = SL_SEC_MASK_SSL_RSA_WITH_RC4_128_SHA; long lRetVal = -1; int iSockID; GPIO_IF_LedConfigure(LED1|LED3); GPIO_IF_LedOff(MCU_RED_LED_GPIO); GPIO_IF_LedOff(MCU_GREEN_LED_GPIO); lRetVal = InitializeAppVariables(); ASSERT_ON_ERROR(lRetVal); // // Following function configure the device to default state by cleaning // the persistent settings stored in NVMEM (viz. connection profiles & // policies, power policy etc) // // Applications may choose to skip this step if the developer is sure // that the device is in its default state at start of applicaton // // Note that all profiles and persistent settings that were done on the // device will be lost // lRetVal = ConfigureSimpleLinkToDefaultState(); if(lRetVal < 0) { if (DEVICE_NOT_IN_STATION_MODE == lRetVal) UART_PRINT("Failed to configure the device in its default state /n/r"); return lRetVal; } UART_PRINT("Device is configured in default state /n/r"); CLR_STATUS_BIT_ALL(g_ulStatus); /// // Assumption is that the device is configured in station mode already // and it is in its default state // lRetVal = sl_Start(0, 0, 0); if (lRetVal < 0 || ROLE_STA != lRetVal) { UART_PRINT("Failed to start the device /n/r"); return lRetVal; } UART_PRINT("Device started as STATION /n/r"); // //Connecting to WLAN AP // lRetVal = WlanConnect(); if(lRetVal < 0) { UART_PRINT("Failed to establish connection w/ an AP /n/r"); GPIO_IF_LedOn(MCU_RED_LED_GPIO); return lRetVal; } UART_PRINT("Connection established w/ AP and IP is aquired /n/r"); //Set time of the device for certificate verification. lRetVal = set_time(); if(lRetVal < 0) { UART_PRINT("Unable to set time in the device"); return lRetVal; } lRetVal = sl_NetAppDnsGetHostByName(g_Host, strlen((const char *)g_Host), (unsigned long*)&uiIP, SL_AF_INET); if(lRetVal < 0) { UART_PRINT("Device couldn't retrive the host name /n/r"); GPIO_IF_LedOn(MCU_RED_LED_GPIO); return lRetVal;//.........这里部分代码省略.........
开发者ID:moyanming,项目名称:CC3200SDK_1.2.0,代码行数:101,
示例25: ConnectToNetworklong ConnectToNetwork(){ long lRetVal = -1; unsigned int uiConnectTimeoutCnt =0; //Start Simplelink Device lRetVal = sl_Start(NULL,NULL,NULL); ASSERT_ON_ERROR(lRetVal); if(lRetVal != ROLE_STA) { if (ROLE_AP == lRetVal) { // If the device is in AP mode, we need to wait for this event // before doing anything while(!IS_IP_ACQUIRED(g_ulStatus)) {#ifndef SL_PLATFORM_MULTI_THREADED _SlNonOsMainLoopTask();#endif } } // // Configure to STA Mode // lRetVal = ConfigureMode(ROLE_STA); if(lRetVal !=ROLE_STA) { UART_PRINT("Unable to set STA mode.../n/r"); lRetVal = sl_Stop(SL_STOP_TIMEOUT); CLR_STATUS_BIT_ALL(g_ulStatus); return DEVICE_NOT_IN_STATION_MODE; } } //waiting for the device to Auto Connect while(uiConnectTimeoutCnt<AUTO_CONNECTION_TIMEOUT_COUNT && ((!IS_CONNECTED(g_ulStatus)) || (!IS_IP_ACQUIRED(g_ulStatus)))) { //Turn Green LED On GPIO_IF_LedOn(MCU_GREEN_LED_GPIO); osi_Sleep(50); //Turn Green LED Off GPIO_IF_LedOff(MCU_GREEN_LED_GPIO); osi_Sleep(50); uiConnectTimeoutCnt++; } //Couldn't connect Using Auto Profile if(uiConnectTimeoutCnt==AUTO_CONNECTION_TIMEOUT_COUNT) { CLR_STATUS_BIT_ALL(g_ulStatus); //Turn Green LED On GPIO_IF_LedOn(MCU_GREEN_LED_GPIO); //Connect Using Smart Config lRetVal = SmartConfigConnect(); ASSERT_ON_ERROR(lRetVal); //Waiting for the device to Auto Connect while((!IS_CONNECTED(g_ulStatus)) || (!IS_IP_ACQUIRED(g_ulStatus))) { MAP_UtilsDelay(500); } //Turn Green LED Off GPIO_IF_LedOff(MCU_GREEN_LED_GPIO); } return SUCCESS; }
开发者ID:bigcat26,项目名称:cc3200-sdk,代码行数:73,
示例26: mainint main(void){ long lRetVal = -1; // // Initialize Board configurations // BoardInit(); // // Configure the pinmux settings for the peripherals exercised // PinMuxConfig(); #ifndef NOTERM InitTerm(); #endif // configure RED LED GPIO_IF_LedConfigure(LED1); GPIO_IF_LedOff(MCU_RED_LED_GPIO); InitializeAppVariables(); // // Following function configure the device to default state by cleaning // the persistent settings stored in NVMEM (viz. connection profiles & // policies, power policy etc) // // Applications may choose to skip this step if the developer is sure // that the device is in its default state at start of applicaton // // Note that all profiles and persistent settings that were done on the // device will be lost // lRetVal = ConfigureSimpleLinkToDefaultState(); if(lRetVal < 0) { if (DEVICE_NOT_IN_STATION_MODE == lRetVal) UART_PRINT("Failed to configure the device in its " "default state /n/r"); LOOP_FOREVER(); } UART_PRINT("Device is configured in default state /n/r"); CLR_STATUS_BIT_ALL(g_ulStatus); //Start simplelink lRetVal = sl_Start(0,0,0); if (lRetVal < 0 || ROLE_STA != lRetVal) { UART_PRINT("Failed to start the device /n/r"); LOOP_FOREVER(); } UART_PRINT("Device started as STATION /n/r"); /* Connect to our AP using SmartConfig method */ lRetVal = SmartConfigConnect(); if(lRetVal < 0) { ERR_PRINT(lRetVal); } LOOP_FOREVER();}
开发者ID:bigcat26,项目名称:cc3200-sdk,代码行数:68,
示例27: PushButtonMailSend//*****************************************************************************////! /brief Generates Random Message and Sends Email to the preconfigured//! Recipient Email Id//!//! /param pValue - pointer to Input Data//!//! /return void//! /note//! /warning//*****************************************************************************void PushButtonMailSend(void* pValue){ int iIndex; long lRetVal = -1; // reset Orange LED GPIO_IF_LedOff(MCU_SENDING_DATA_IND); if(!IS_CONNECTED(Network_IF_CurrentMCUState())) { LedTimerConfigNStart(); lRetVal = Network_IF_ConnectAP(SSID_NAME,SecurityParams); if(lRetVal < 0) { UART_PRINT("Error: %d Connecting to an AP./n/r",lRetVal); return; } } // // Disable the LED blinking Timer as Device is connected to AP // LedTimerDeinitStop(); // // Switch ON RED LED to indicate that Device acquired an IP // GPIO_IF_LedOn(MCU_IP_ALLOC_IND); MAP_UtilsDelay(10000); GenerateRandomMessage(); g_cConnectStatus = sl_NetAppEmailConnect(); // If return -1, throw connect error if(g_cConnectStatus == -1) { DispatcherUartSendPacket((char*)pucUARTErrorSocketCreateString, / sizeof(pucUARTErrorSocketCreateString)); } // If return -2, throw socket option error if(g_cConnectStatus == -2) { DispatcherUartSendPacket((char*)pucUARTErrorSocketOptionString, / sizeof(pucUARTErrorSocketOptionString)); } if(g_cConnectStatus == 0) { SlNetAppServerError_t sEmailErrorInfo; long lRetCode = SL_EMAIL_ERROR_FAILED; if((lRetCode = sl_NetAppEmailSend(pcEmailto,pcEmailsubject,/ pcEmailmessage, / &sEmailErrorInfo)) == SL_EMAIL_ERROR_NONE) { // Blink LED7 to indicate email has been sent for(iIndex=0 ;iIndex<5 ;iIndex++) { MAP_UtilsDelay(6000000); GPIO_IF_LedOff(MCU_SENDING_DATA_IND); MAP_UtilsDelay(6000000); GPIO_IF_LedOn(MCU_SENDING_DATA_IND); } DispatcherUartSendPacket((char*)putUARTFinishString, / sizeof(putUARTFinishString)); } else { lRetVal = EmailHandleERROR(lRetCode,(char*)sEmailErrorInfo.Value); } UART_PRINT("Cmd#"); } //Enable GPIO Interrupt Button_IF_EnableInterrupt(SW3); return;}
开发者ID:oter,项目名称:BSPTools,代码行数:85,
注:本文中的GPIO_IF_LedOff函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GPIO_INPUT_GET函数代码示例 C++ GPIO_FUNC函数代码示例 |