當前位置: 首頁>>代碼示例>>C++>>正文


C++ GpioWrite函數代碼示例

本文整理匯總了C++中GpioWrite函數的典型用法代碼示例。如果您正苦於以下問題:C++ GpioWrite函數的具體用法?C++ GpioWrite怎麽用?C++ GpioWrite使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GpioWrite函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: BoardInitPeriph

void BoardInitPeriph( void )
{
    /* Init the GPIO extender pins */
//		GpioInit( &IrqMpl3115, IRQ_MPL3115, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );
//		GpioInit( &IrqMag3110, IRQ_MAG3110, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );
//    GpioInit( &GpsPowerEn, GPS_POWER_ON, PIN_OUTPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );
//    GpioInit( &NcIoe3, SPARE_IO_EXT_3, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );
//    GpioInit( &NcIoe4, SPARE_IO_EXT_4, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );
//    GpioInit( &NcIoe5, SPARE_IO_EXT_5, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );
//    GpioInit( &NcIoe6, SPARE_IO_EXT_6, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );
//    GpioInit( &NcIoe7, SPARE_IO_EXT_7, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );
//    GpioInit( &NIrqSx9500, N_IRQ_SX9500, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );
//    GpioInit( &Irq1Mma8451, IRQ_1_MMA8451, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );
//    GpioInit( &Irq2Mma8451, IRQ_2_MMA8451, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );
//    GpioInit( &TxEnSx9500, TX_EN_SX9500, PIN_OUTPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );
    GpioInit( &Led1, LED_1, PIN_OUTPUT, PIN_PUSH_PULL, PIN_NO_PULL, 0 );
    GpioInit( &Led2, LED_2, PIN_OUTPUT, PIN_PUSH_PULL, PIN_NO_PULL, 0 );
		GpioInit( &testInterupt, TEST_INTERUPT, PIN_INPUT, PIN_PUSH_PULL, PIN_PULL_DOWN, 0 );
		GpioSetInterrupt( &testInterupt, IRQ_RISING_EDGE, IRQ_HIGH_PRIORITY, testIrq[0] );
    //GpioInit( &Led3, LED_3, PIN_OUTPUT, PIN_PUSH_PULL, PIN_NO_PULL, 0 );

    // Switch LED 1, 2, 3 OFF
    GpioWrite( &Led1, 0 );
    GpioWrite( &Led2, 0 );
    //GpioWrite( &Led3, 1 );
}
開發者ID:XueZhiQiang123,項目名稱:FloRa,代碼行數:26,代碼來源:board.c

示例2: gps_start

void gps_start()
{
	GPS_UART_PWR_ON;
	gps_uart.Init(GPS_UART, 9600);
	gps_uart.SetInterruptPriority(MEDIUM);

	GpioSetDirection(GPS_EN, OUTPUT);	 //active high
	GpioWrite(GPS_EN, LOW);

	GpioSetDirection(GPS_TIMER, INPUT);  //active low, otherwise open-drain
	GpioSetPull(GPS_TIMER, gpio_pull_up);
	GpioSetInterrupt(GPS_TIMER, gpio_interrupt1, gpio_falling);

	GpioSetDirection(GPS_RESET, OUTPUT); //active low
	GpioWrite(GPS_RESET, LOW);

	GpioWrite(GPS_EN, HIGH);
	_delay_ms(10);
	GpioWrite(GPS_RESET, LOW);
	_delay_ms(20);
	GpioWrite(GPS_RESET, HIGH);

	gps_parser_state = GPS_IDLE;
	fc.gps_data.valid = false;
	fc.gps_data.fix = 0;
	fc.gps_data.fix_cnt = 0;

	for (uint8_t i = 0; i < GPS_SAT_CNT; i++)
	{
		fc.gps_data.sat_id[i] = 0;
		fc.gps_data.sat_snr[i] = 0;
	}
}
開發者ID:rgagne002,項目名稱:SkyDrop,代碼行數:33,代碼來源:gps_l80.cpp

示例3: bt_init

void bt_init()
{
	DEBUG("bt_init\n");

	//get module type
	eeprom_busy_wait();
	bt_module_type = eeprom_read_byte(&config_ro.bt_module_type);

	//init bt_uart
	bt_uart.InitBuffers(BUFFER_SIZE * 2, BUFFER_SIZE);

	//pin init
	GpioSetDirection(BT_EN, OUTPUT);
	GpioSetDirection(BT_RESET, OUTPUT);
	GpioSetDirection(BT_RTS, OUTPUT);

	//power is off
	GpioWrite(BT_RTS, LOW);
	GpioWrite(BT_EN, LOW);
	GpioWrite(BT_RESET, LOW);

	//IRQ init
	GpioSetDirection(BT_CTS, INPUT);
	GpioSetPull(BT_CTS, gpio_pull_down);
	GpioSetInterrupt(BT_CTS, gpio_interrupt1, gpio_rising);
}
開發者ID:MaxNero,項目名稱:SkyDrop,代碼行數:26,代碼來源:bt.cpp

示例4: bt_step

void bt_step()
{
	if (bt_module_state == BT_MOD_STATE_OFF)
		return;

	if (bt_reset_counter)
	{
		if (bt_reset_counter > task_get_ms_tick())
			return;

		DEBUG("BT RESET STEP: %d\n", bt_reset_counter_step);

		switch(bt_reset_counter_step)
		{
			case(0):
				GpioWrite(BT_EN, HIGH);
				bt_reset_counter = task_get_ms_tick() + 500;
				bt_reset_counter_step = 1;
			break;

			case(1):
				//enable bt uart
				BT_UART_PWR_ON;
				bt_uart.Init(BT_UART, 115200);
				bt_uart.SetInterruptPriority(MEDIUM);

//				while(1)
//				{
//					_delay_ms(100);
//					bt_uart.Write(0x00);
//					_delay_ms(1);
//					bt_uart.Write(0xAA);
//					ewdt_reset();
//				}

				bt_reset_counter = task_get_ms_tick() + 10;
				bt_reset_counter_step = 2;
			break;

			case(2):
				GpioWrite(BT_RESET, HIGH);
				bt_reset_counter_step = 0;
				bt_reset_counter = 0;
			break;
		}

		return;
	}

	if (bt_module_type == BT_PAN1322)
		bt_pan1322.Step();

	if (bt_module_type == BT_PAN1026)
		bt_pan1026.Step();

	if (bt_module_type == BT_UNKNOWN)
		bt_unknown_parser();
}
開發者ID:Flyingplanet,項目名稱:SkyDrop,代碼行數:58,代碼來源:bt.cpp

示例5: BoardInitPeriph

void BoardInitPeriph( void )
{
    /* Init the GPIO extender pins */
    GpioInit( &Led1, LED_1, PIN_OUTPUT, PIN_PUSH_PULL, PIN_NO_PULL, 0 );
    GpioInit( &Led2, LED_2, PIN_OUTPUT, PIN_PUSH_PULL, PIN_NO_PULL, 0 );
    // Switch LED 1, 2, 3 OFF
    GpioWrite( &Led1, 1 );
    GpioWrite( &Led2, 1 );
}
開發者ID:2thetop,項目名稱:XRange,代碼行數:9,代碼來源:board.c

示例6: bt_module_deinit

void bt_module_deinit()
{
	GpioWrite(BT_EN, LOW);
	GpioWrite(BT_RESET, LOW);

	bt_irqh(BT_IRQ_DEINIT, 0);
	bt_uart.Stop();
	BT_UART_PWR_OFF;
}
開發者ID:DD1984,項目名稱:skydrop_stm32,代碼行數:9,代碼來源:bt.cpp

示例7: mems_power_off

void mems_power_off()
{
	GpioWrite(MEMS_EN, LOW);

	if (hw_revision == HW_REW_1504)
	{
		GpioWrite(REV_1504_MEMS_EN_2, LOW);
		GpioWrite(REV_1504_I2C_EN, LOW);
	}
}
開發者ID:MaxNero,項目名稱:SkyDrop,代碼行數:10,代碼來源:common.cpp

示例8: SX1272SetAntSw

void SX1272SetAntSw( uint8_t opMode )
{
    switch( opMode )
    {
    case RFLR_OPMODE_TRANSMITTER:
        if( ( Radio.Read( REG_PACONFIG ) & RF_PACONFIG_PASELECT_PABOOST ) == RF_PACONFIG_PASELECT_PABOOST )
        {
            GpioWrite( &RadioSwitchCtrl1, 1 );
            GpioWrite( &RadioSwitchCtrl2, 0 );
        }
        else
        {
            GpioWrite( &RadioSwitchCtrl1, 0 );
            GpioWrite( &RadioSwitchCtrl2, 1 );
        }
        break;
    case RFLR_OPMODE_RECEIVER:
    case RFLR_OPMODE_RECEIVER_SINGLE:
    case RFLR_OPMODE_CAD:
        GpioWrite( &RadioSwitchCtrl1, 1 );
        GpioWrite( &RadioSwitchCtrl2, 1 );
        break;
    default:
        GpioWrite( &RadioSwitchCtrl1, 0 );
        GpioWrite( &RadioSwitchCtrl2, 0 );
        GpioWrite( &RadioPwrAmpCtrl, 0 );
        break;
    }
}
開發者ID:abouillot,項目名稱:LoRaMac-node,代碼行數:29,代碼來源:sx1272-board.c

示例9: bt_module_reset

void bt_module_reset()
{
	GpioWrite(BT_EN, LOW);
	GpioWrite(BT_RESET, LOW);

	_delay_ms(200);
	GpioWrite(BT_EN, HIGH);
	_delay_ms(200);
	GpioWrite(BT_RESET, HIGH);
	_delay_ms(300);
}
開發者ID:MaxNero,項目名稱:SkyDrop,代碼行數:11,代碼來源:bt.cpp

示例10: testPCO

void testPCO( void )
{
	printf("----------------\n");
	printf("ON_TEST_INTERUPT\n");
	printf("----------------\n");
	if(GpioRead( &Led2 ) == 0){
		GpioWrite( &Led2, 1 );
	}else{
		GpioWrite( &Led2, 0 );
	}	
}
開發者ID:XueZhiQiang123,項目名稱:FloRa,代碼行數:11,代碼來源:sx1272-board.c

示例11: bt_module_reset

void bt_module_reset()
{
	GpioWrite(BT_EN, LOW);
	GpioWrite(BT_RESET, LOW);

	bt_uart.Stop();
	BT_UART_PWR_OFF;

	bt_reset_counter = task_get_ms_tick() + 4000;
	bt_reset_counter_step = 0;
}
開發者ID:Flyingplanet,項目名稱:SkyDrop,代碼行數:11,代碼來源:bt.cpp

示例12: loop

// the loop routine runs over and over again forever:
void loop()
{
  // TODO: Add your code here

  GpioWrite(led, LOW);    // turn the LED off by making the voltage LOW
  Log(L"LED OFF\n");
  delay(1000);               // wait for a second
  GpioWrite(led, HIGH);   // turn the LED on by making the voltage HIGH
  Log(L"LED ON\n");
  delay(1000);               // wait for a second
}
開發者ID:BretStateham,項目名稱:IoT,代碼行數:12,代碼來源:Main.cpp

示例13: MotorSet

void MotorSet(motor_t * motor, uint8_t pwm, dir_t dir){

	pwm =pwm%101;

	if(dir == FORWARD){
		GpioWrite(&motor->dir_pin,GPIO_LOW);
		SctSetDutyCycle(&motor->pwm_pin,pwm);
	}else if(dir == BACKWARD){
		GpioWrite(&motor->dir_pin,GPIO_HIGH);
		SctSetDutyCycle(&motor->pwm_pin,100-pwm);
	}
}
開發者ID:jlnbotello,項目名稱:plantilla,代碼行數:12,代碼來源:motor_ctrl.c

示例14: OpenLed

void OpenLed(LED_TYPE led, COLOR_TYPE color)
{
		switch(led)
		{
			case CONNECT_LED 	: 	GpioWrite(APP_CONNECT_LED,on_stat);break;
			case CONTROL_LED 	:		GpioWrite(PURIFIER_LED_PIN_NO,on_stat);break;
			case WARN_LED 		:		OpenRGBLed(WARN_LED,color);break;
			case AQI_LED 			: 	OpenRGBLed(AQI_LED ,color);break;
			default 					:		break;
		}
	
}
開發者ID:SCUT-Mida,項目名稱:Airpurifier,代碼行數:12,代碼來源:led.c

示例15: CloseLed

void CloseLed(LED_TYPE led)
{
		switch(led)
		{
			case CONNECT_LED 	: 	GpioWrite(APP_CONNECT_LED,off_stat);break;
			case CONTROL_LED 	:		GpioWrite(PURIFIER_LED_PIN_NO,off_stat);break;
			case WARN_LED 		:		CloseWarnLed();break;
			case AQI_LED 			: 	CloseAQILed();break;
			case ALL_LED 			:		GpioWrite(APP_CONNECT_LED,off_stat);
														GpioWrite(PURIFIER_LED_PIN_NO,off_stat);
														CloseWarnLed();CloseAQILed();break;
		}
}
開發者ID:SCUT-Mida,項目名稱:Airpurifier,代碼行數:13,代碼來源:led.c


注:本文中的GpioWrite函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。