这篇教程C++ HalLedSet函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中HalLedSet函数的典型用法代码示例。如果您正苦于以下问题:C++ HalLedSet函数的具体用法?C++ HalLedSet怎么用?C++ HalLedSet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了HalLedSet函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: zb_HandleOsalEvent/** * @brief Esta función es llamada por el SO cuando se debe atender un * evento de la tarea. * @param event Mascara de bits conteniendo los eventos a atender */void zb_HandleOsalEvent(uint16 event){ uint8 logicalType; if (event & SYS_EVENT_MSG) { } if (event & ZB_ENTRY_EVENT) { // inicializa UART initUart(uartRxCB); // blick LED 1 para indicar que se está uniendo a la red HalLedBlink(HAL_LED_1, 0, 50, 500 ); HalLedSet(HAL_LED_2, HAL_LED_MODE_OFF); // lee tipo de logical device desde la memoria NV zb_ReadConfiguration(ZCD_NV_LOGICAL_TYPE, sizeof(uint8), &logicalType); // inicia la red zb_StartRequest(); } if (event & MY_START_EVT) { // inicia la red zb_StartRequest(); } if (event & SEND_UART_MSG) { // envia mensaje por UART a la PC //HalLcdWriteString("UART_EVT", HAL_LCD_LINE_1); sendUartMessage(&msgReport, &alarmFlags); } if (event & MY_TEST_EVT) { // crea mensaje de prueba msgReport.msgType = MSG_TYPE_REPORT; msgReport.sequence++; msgReport.lenData = MSG_LEN_DATA_REPORT; for (uint8 i = 0; i < 8; i++) msgReport.mac[i] = i; // datos de prueba static double d[10] = {220.5, 0.354, 85.12, 88.33, 85.06, 0.98, 1.23, 3.25, 0.97, 4.55}; for (int i = 0; i < 10; i++) memcpy(&(msgReport.data[i*4]), &(d[i]), sizeof(double)); // flags de prueba uint16 flags = 0; // imprime info en LCD HalLcdWriteString("TEST_EVT", HAL_LCD_LINE_1); HalLcdWriteStringValue("#", msgReport.sequence, 10, HAL_LCD_LINE_2); // envia mensaje por UART sendUartMessage(&msgReport, &flags); // crea evento nuevamente osal_start_timerEx(sapi_TaskID, MY_TEST_EVT, 5000); }}
开发者ID:arguelles-manuel,项目名称:smartmeter,代码行数:58,
示例2: zclSampleTemperatureSensor_ProcessIdentifyTimeChange/********************************************************************* * @fn zclSampleTemperatureSensor_ProcessIdentifyTimeChange * * @brief Called to process any change to the IdentifyTime attribute. * * @param none * * @return none */static void zclSampleTemperatureSensor_ProcessIdentifyTimeChange( void ){ if ( zclSampleTemperatureSensor_IdentifyTime > 0 ) { osal_start_timerEx( zclSampleTemperatureSensor_TaskID, SAMPLETEMPERATURESENSOR_IDENTIFY_TIMEOUT_EVT, 1000 ); HalLedBlink ( HAL_LED_4, 0xFF, HAL_LED_DEFAULT_DUTY_CYCLE, HAL_LED_DEFAULT_FLASH_TIME ); } else { if ( zclSampleTemperatureSensor_OnOff ) { HalLedSet ( HAL_LED_4, HAL_LED_MODE_ON ); } else { HalLedSet ( HAL_LED_4, HAL_LED_MODE_OFF ); } osal_stop_timerEx( zclSampleTemperatureSensor_TaskID, SAMPLETEMPERATURESENSOR_IDENTIFY_TIMEOUT_EVT ); }}
开发者ID:niuniu500w,项目名称:led_gprs,代码行数:30,
示例3: zclSampleTemperatureSensor_LcdDisplayUpdate/********************************************************************* * @fn zclSampleTemperatureSensor_LcdDisplayUpdate * * @brief Called to update the LCD display. * * @param none * * @return none */void zclSampleTemperatureSensor_LcdDisplayUpdate( void ){ // turn on red LED for temperatures >= 24.00C if ( zclSampleTemperatureSensor_MeasuredValue >= 2400 ) { HalLedSet ( HAL_LED_1, HAL_LED_MODE_OFF ); HalLedSet ( HAL_LED_2, HAL_LED_MODE_ON ); } // turn on green LED for temperatures <= 20.00C else if ( zclSampleTemperatureSensor_MeasuredValue <= 2000 ) { HalLedSet ( HAL_LED_1, HAL_LED_MODE_ON ); HalLedSet ( HAL_LED_2, HAL_LED_MODE_OFF ); } // turn on both red and green LEDs for temperatures between 20.00C and 24.00C else { HalLedSet ( HAL_LED_1, HAL_LED_MODE_ON ); HalLedSet ( HAL_LED_2, HAL_LED_MODE_ON ); } if ( giTemperatureSensorScreenMode == TEMPSENSE_HELPMODE ) { zclSampleTemperatureSensor_LcdDisplayHelpMode(); } else { zclSampleTemperatureSensor_LcdDisplayMainMode(); }}
开发者ID:niuniu500w,项目名称:led_gprs,代码行数:39,
示例4: zclSampleSw_ProcessZDOMsgs/********************************************************************* * @fn zclSampleSw_ProcessZDOMsgs() * * @brief Process response messages * * @param none * * @return none */void zclSampleSw_ProcessZDOMsgs( zdoIncomingMsg_t *inMsg ){ switch ( inMsg->clusterID ) { case End_Device_Bind_rsp: if ( ZDO_ParseBindRsp( inMsg ) == ZSuccess ) { // Light LED HalLedSet( HAL_LED_4, HAL_LED_MODE_ON ); }#if defined(BLINK_LEDS) else { // Flash LED to show failure HalLedSet ( HAL_LED_4, HAL_LED_MODE_FLASH ); }#endif break; case Match_Desc_rsp: { ZDO_ActiveEndpointRsp_t *pRsp = ZDO_ParseEPListRsp( inMsg ); if ( pRsp ) { if ( pRsp->status == ZSuccess && pRsp->cnt ) { zclSampleSw_DstAddr.addrMode = (afAddrMode_t)Addr16Bit; zclSampleSw_DstAddr.addr.shortAddr = pRsp->nwkAddr; // Take the first endpoint, Can be changed to search through endpoints zclSampleSw_DstAddr.endPoint = pRsp->epList[0]; // Light LED HalLedSet( HAL_LED_4, HAL_LED_MODE_ON ); } osal_mem_free( pRsp ); } } break; }}
开发者ID:flofeurstein,项目名称:MTProj,代码行数:49,
示例5: SimpleBLECentral_Init/********************************************************************* * @fn SimpleBLECentral_Init * * @brief Initialization function for the Simple BLE Central App Task. * This is called during initialization and should contain * any application specific initialization (ie. hardware * initialization/setup, table initialization, power up * notification). * * @param task_id - the ID assigned by OSAL. This ID should be * used to send messages and set timers. * * @return none */void SimpleBLECentral_Init( uint8 task_id ){ simpleBLETaskId = task_id; // 串口初始化 NPI_InitTransport(uart_NpiSerialCallback); //NPI_WriteTransport("SimpleBLECentral_Init/r/n", 23); // Setup Central Profile { uint8 scanRes = DEFAULT_MAX_SCAN_RES; GAPCentralRole_SetParameter ( GAPCENTRALROLE_MAX_SCAN_RES, sizeof( uint8 ), &scanRes ); } // Setup GAP GAP_SetParamValue( TGAP_GEN_DISC_SCAN, DEFAULT_SCAN_DURATION ); GAP_SetParamValue( TGAP_LIM_DISC_SCAN, DEFAULT_SCAN_DURATION ); GGS_SetParameter( GGS_DEVICE_NAME_ATT, GAP_DEVICE_NAME_LEN, (uint8 *) simpleBLEDeviceName ); // Setup the GAP Bond Manager { uint32 passkey = DEFAULT_PASSCODE; uint8 pairMode = DEFAULT_PAIRING_MODE; uint8 mitm = DEFAULT_MITM_MODE; uint8 ioCap = DEFAULT_IO_CAPABILITIES; uint8 bonding = DEFAULT_BONDING_MODE; GAPBondMgr_SetParameter( GAPBOND_DEFAULT_PASSCODE, sizeof( uint32 ), &passkey ); GAPBondMgr_SetParameter( GAPBOND_PAIRING_MODE, sizeof( uint8 ), &pairMode ); GAPBondMgr_SetParameter( GAPBOND_MITM_PROTECTION, sizeof( uint8 ), &mitm ); GAPBondMgr_SetParameter( GAPBOND_IO_CAPABILITIES, sizeof( uint8 ), &ioCap ); GAPBondMgr_SetParameter( GAPBOND_BONDING_ENABLED, sizeof( uint8 ), &bonding ); } // Initialize GATT Client VOID GATT_InitClient(); // Register to receive incoming ATT Indications/Notifications GATT_RegisterForInd( simpleBLETaskId ); // Initialize GATT attributes GGS_AddService( GATT_ALL_SERVICES ); // GAP GATTServApp_AddService( GATT_ALL_SERVICES ); // GATT attributes // Register for all key events - This app will handle all key events RegisterForKeys( simpleBLETaskId ); // makes sure LEDs are off HalLedSet( (HAL_LED_1 | HAL_LED_2), HAL_LED_MODE_OFF ); // Setup a delayed profile startup osal_set_event( simpleBLETaskId, START_DEVICE_EVT );}
开发者ID:tanxjian,项目名称:BLE-CC254x-1.3.2,代码行数:66,
示例6: SampleApp_MessageMSGCB/********************************************************************* * @fn SampleApp_MessageMSGCB * * @brief Data message processor callback. This function processes * any incoming data - probably from other devices. So, based * on cluster ID, perform the intended action. * * @param none * * @return none */void SampleApp_MessageMSGCB( afIncomingMSGPacket_t *pkt ) //接收 C++ Halt函数代码示例 C++ HalLcdWriteString函数代码示例
|