• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GpioWrite函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GpioWrite函数的典型用法代码示例。如果您正苦于以下问题:C++ GpioWrite函数的具体用法?C++ GpioWrite怎么用?C++ GpioWrite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GpioWrite函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: SX126xWriteBuffer

void SX126xWriteBuffer( uint8_t offset, uint8_t *buffer, uint8_t size )
{
    SX126xCheckDeviceReady( );

    GpioWrite( &SX126x.Spi.Nss, 0 );

    SpiInOut( &SX126x.Spi, RADIO_WRITE_BUFFER );
    SpiInOut( &SX126x.Spi, offset );
    for( uint16_t i = 0; i < size; i++ )
    {
        SpiInOut( &SX126x.Spi, buffer[i] );
    }
    GpioWrite( &SX126x.Spi.Nss, 1 );

    SX126xWaitOnBusy( );
}
开发者ID:Lora-net,项目名称:LoRaMac-node,代码行数:16,代码来源:sx1262dvk1cas-board.c


示例17: bat_en_low

void bat_en_low(uint8_t mask)
{
	bat_en_mask &= ~mask;

	if (bat_en_mask == 0)
		GpioWrite(BAT_EN, LOW);
}
开发者ID:leachim1,项目名称:SkyDrop,代码行数:7,代码来源:common.cpp


示例18: SX126xWakeup

void SX126xWakeup( void )
{
    BoardDisableIrq( );

    GpioWrite( &SX126x.Spi.Nss, 0 );

    SpiInOut( &SX126x.Spi, RADIO_GET_STATUS );
    SpiInOut( &SX126x.Spi, 0x00 );

    GpioWrite( &SX126x.Spi.Nss, 1 );

    // Wait for chip to be ready.
    SX126xWaitOnBusy( );

    BoardEnableIrq( );
}
开发者ID:Lora-net,项目名称:LoRaMac-node,代码行数:16,代码来源:sx1262dvk1cas-board.c


示例19: McpsConfirm

/*!
 * \brief   MCPS-Confirm event function
 *
 * \param   [IN] mcpsConfirm - Pointer to the confirm structure,
 *               containing confirm attributes.
 */
static void McpsConfirm( McpsConfirm_t *mcpsConfirm )
{
    if( mcpsConfirm->Status == LORAMAC_EVENT_INFO_STATUS_OK )
    {
        switch( mcpsConfirm->McpsRequest )
        {
            case MCPS_UNCONFIRMED:
            {
                // Check Datarate
                // Check TxPower
                break;
            }
            case MCPS_CONFIRMED:
            {
                // Check Datarate
                // Check TxPower
                // Check AckReceived
                // Check NbTrials
                break;
            }
            case MCPS_PROPRIETARY:
            {
                break;
            }
            default:
                break;
        }

        // Switch LED 1 ON
        GpioWrite( &Led1, 1 );
        TimerStart( &Led1Timer );
    }
    NextTx = true;
}
开发者ID:Lora-net,项目名称:LoRaMac-node,代码行数:40,代码来源:main.c


示例20: OnRxDone

void OnRxDone( uint8_t *payload, uint16_t size, int8_t rssi, int8_t snr )
{
    static uint8_t ledState = 1;
    // Toggle LED 1
    ledState ^= 1;
    GpioWrite( &Led1, ledState );
}
开发者ID:AlessandroLipari,项目名称:LoRaMac-node,代码行数:7,代码来源:main.c



注:本文中的GpioWrite函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GrClose函数代码示例发布时间:2022-05-30
下一篇:
C++ GpioInit函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap