本文整理汇总了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 );
}
示例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;
}
}
示例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);
}
示例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();
}
示例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 );
}
示例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;
}
示例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);
}
}
示例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;
}
}
示例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);
}
示例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 );
}
}
示例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;
}
示例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
}
示例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);
}
}
示例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;
}
}
示例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;
}
}