这篇教程C++ GPIO函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GPIO函数的典型用法代码示例。如果您正苦于以下问题:C++ GPIO函数的具体用法?C++ GPIO怎么用?C++ GPIO使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GPIO函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: configure_3gstatic void configure_3g(void){ /* Force 3G modem off to avoid confusing the EHCI host and * causing problems during enumeration/init */ gpio_output(GPIO(5, C, 1), 1); /* 3G_SHUTDOWN */ gpio_output(GPIO(4, D, 2), 0); /* 3G_ON_OFF */}
开发者ID:AdriDlu,项目名称:coreboot,代码行数:7,
示例2: set_external_breakpoint_pin_statevoid set_external_breakpoint_pin_state(uint16_t bitmask, bool state){ if (state) GPIO(PORT_CODEPOINT, OUT) |= bitmask << PIN_CODEPOINT_0; else GPIO(PORT_CODEPOINT, OUT) &= ~(bitmask << PIN_CODEPOINT_0);}
开发者ID:CMUAbstract,项目名称:edb-firmware,代码行数:7,
示例3: ambarella_init_filbert/* ==========================================================================*/static void __init ambarella_init_filbert(void){ int i; ambarella_init_machine("Filbert"); platform_add_devices(ambarella_devices, ARRAY_SIZE(ambarella_devices)); for (i = 0; i < ARRAY_SIZE(ambarella_devices); i++) { device_set_wakeup_capable(&ambarella_devices[i]->dev, 1); device_set_wakeup_enable(&ambarella_devices[i]->dev, 0); } /* Config Eth0*/ ambarella_eth0_platform_info.mii_reset.gpio_id = GPIO(124); ambarella_eth0_platform_info.mii_reset.active_level = GPIO_LOW; ambarella_eth0_platform_info.mii_reset.active_delay = 20; /* Config Eth1*/ ambarella_eth1_platform_info.mii_reset.gpio_id = GPIO(125); ambarella_eth1_platform_info.mii_reset.active_level = GPIO_LOW; ambarella_eth1_platform_info.mii_reset.active_delay = 20; /* Config SD*/ fio_default_owner = SELECT_FIO_SDIO; ambarella_platform_sd_controller0.clk_limit = 48000000; ambarella_platform_sd_controller0.slot[0].cd_delay = HZ; ambarella_platform_sd_controller0.slot[0].use_bounce_buffer = 1; ambarella_platform_sd_controller0.slot[0].max_blk_sz = SD_BLK_SZ_128KB; ambarella_platform_sd_controller0.slot[1].cd_delay = HZ; ambarella_platform_sd_controller0.slot[1].gpio_cd.irq_gpio = GPIO(75); ambarella_platform_sd_controller0.slot[1].gpio_cd.irq_line = gpio_to_irq(75); ambarella_platform_sd_controller0.slot[1].gpio_cd.irq_type = IRQ_TYPE_EDGE_BOTH; ambarella_platform_sd_controller0.slot[1].gpio_wp.gpio_id = GPIO(76);}
开发者ID:WayWingsDev,项目名称:gopro-linux,代码行数:35,
示例4: UART_teardownvoid UART_teardown(unsigned interface){ // Put pins into High-Z state switch(interface) {#ifdef UART_HOST case UART_INTERFACE_USB: UART(UART_HOST, IE) &= ~UCRXIE; // disable Tx + Rx interrupts UART(UART_HOST, CTL1) |= UCSWRST; // put state machine in reset GPIO(PORT_UART_USB, SEL) &= ~(BIT(PIN_UART_USB_TX) | BIT(PIN_UART_USB_RX)); GPIO(PORT_UART_USB, DIR) &= ~(BIT(PIN_UART_USB_TX) | BIT(PIN_UART_USB_RX)); break;#endif // PORT_UART_USB#ifdef UART_TARGET case UART_INTERFACE_WISP: UART(UART_TARGET, IE) &= ~UCRXIE; // disable Tx + Rx interrupts UART(UART_TARGET, CTL1) |= UCSWRST; // put state machine in reset GPIO(PORT_UART_TARGET, SEL) &= ~(BIT(PIN_UART_TARGET_TX) | BIT(PIN_UART_TARGET_RX)); GPIO(PORT_UART_TARGET, DIR) &= ~(BIT(PIN_UART_TARGET_TX) | BIT(PIN_UART_TARGET_RX)); break;#endif // PORT_UART_TARGET }}
开发者ID:CMUAbstract,项目名称:edb-firmware,代码行数:27,
示例5: initvoid init() { initClocks(); // Ensure right location of interrupt vectors // The bootloader leaves its own after flashing SYSCFG.MEMRMP()->setMEM_MODE(SYSCFG::MEMRMP::MemMode::MainFlashmemory); CM4.VTOR()->setVTOR((void*) 0); // Put all inputs as Analog Input, No pull-up nor pull-down // Except for the SWD port (PB3, PA13, PA14) GPIOA.MODER()->set(0xEBFFFFFF); GPIOA.PUPDR()->set(0x24000000); GPIOB.MODER()->set(0xFFFFFFBF); GPIOB.PUPDR()->set(0x00000000); for (int g=2; g<5; g++) { GPIO(g).MODER()->set(0xFFFFFFFF); // All to "Analog" GPIO(g).PUPDR()->set(0x00000000); // All to "None" }#if EPSILON_DEVICE_BENCH bool consolePeerConnectedOnBoot = Ion::Console::Device::peerConnected();#endif initPeripherals();#if EPSILON_DEVICE_BENCH if (consolePeerConnectedOnBoot) { Ion::Device::Bench::run(); }#endif}
开发者ID:Tilka,项目名称:epsilon,代码行数:31,
示例6: configure_vopstatic void configure_vop(void){ write32(&rk3288_grf->iomux_lcdc, IOMUX_LCDC); /* lcdc(vop) iodomain select 1.8V */ write32(&rk3288_grf->io_vsel, RK_SETBITS(1 << 0)); switch (board_id()) { case 0: rk808_configure_switch(2, 1); /* VCC18_LCD */ rk808_configure_ldo(7, 2500); /* VCC10_LCD_PWREN_H */ rk808_configure_switch(1, 1); /* VCC33_LCD */ break; default: gpio_output(GPIO(2, B, 5), 1); /* AVDD_1V8_DISP_EN */ rk808_configure_ldo(7, 2500); /* VCC10_LCD_PWREN_H */ gpio_output(GPIO(7, B, 6), 1); /* LCD_EN */ rk808_configure_switch(1, 1); /* VCC33_LCD */ /* enable edp HPD */ gpio_input_pulldown(GPIO(7, B, 3)); write32(&rk3288_grf->iomux_edp_hotplug, IOMUX_EDP_HOTPLUG); break; }}
开发者ID:zamaudio,项目名称:coreboot,代码行数:25,
示例7: bootblock_mainboard_early_initvoid bootblock_mainboard_early_init(void){ /* Let gpio2ab io domains works at 1.8V. * * If io_vsel[0] == 0(default value), gpio2ab io domains is 3.0V * powerd by APIO2_VDD, otherwise, 1.8V supplied by APIO2_VDDPST. * But from the schematic of kevin rev0, the APIO2_VDD and * APIO2_VDDPST both are 1.8V(intentionally?). * * So, by default, CPU1_SDIO_PWREN(GPIO2_A2) can't output 3.0V * because the supply is 1.8V. * Let ask GPIO2_A2 output 1.8V to make GPIO interal logic happy. */ write32(&rk3399_grf->io_vsel, RK_SETBITS(1 << 0)); /* * Let's enable these power rails here, we are already running the SPI * Flash based code. */ gpio_output(GPIO(0, B, 2), 1); /* PP1500_EN */ gpio_output(GPIO(0, B, 4), 1); /* PP3000_EN */ if (IS_ENABLED(CONFIG_DRIVERS_UART)) { _Static_assert(CONFIG_CONSOLE_SERIAL_UART_ADDRESS == UART2_BASE, "CONSOLE_SERIAL_UART should be UART2"); /* iomux: select gpio4c[4:3] as uart2 dbg port */ write32(&rk3399_grf->iomux_uart2c, IOMUX_UART2C); /* grf soc_con7[11:10] use for uart2 select */ write32(&rk3399_grf->soc_con7, UART2C_SEL); }}
开发者ID:kk1987,项目名称:coreboot,代码行数:33,
示例8: append_watchpoint_eventstatic void append_watchpoint_event(unsigned index){ if (watchpoint_events_count[watchpoint_events_buf_idx] < param_num_watchpoint_events_buffered) { watchpoint_event_t *watchpoint_event = &watchpoint_events_buf[watchpoint_events_count[watchpoint_events_buf_idx]++]; watchpoint_event->timestamp = SYSTICK_CURRENT_TIME; watchpoint_event->index = index; if (watchpoints_vcap_snapshot & (1 << index)) watchpoint_event->vcap = ADC_read(ADC_CHAN_INDEX_VCAP); else // TODO: don't stream vcap at all if snapshot is not enabled watchpoint_event->vcap = 0; } if (watchpoint_events_count[watchpoint_events_buf_idx] == param_num_watchpoint_events_buffered) {// buffer full if (!(main_loop_flags & FLAG_WATCHPOINT_READY)) { // the other buffer is free swap_buffers(); // clear error indicator GPIO(PORT_LED, OUT) &= ~BIT(PIN_LED_RED); } else { // both buffers are full // indicate error on LED GPIO(PORT_LED, OUT) |= BIT(PIN_LED_RED); // drop the watchpoints on the floor } } else { // clear error indicator GPIO(PORT_LED, OUT) &= ~BIT(PIN_LED_RED); }}
开发者ID:CMUAbstract,项目名称:edb-firmware,代码行数:34,
示例9: target_set_debug_ledvoid target_set_debug_led(unsigned int led, bool on){ switch (led) { case 0: gpio_set(GPIO(GPIO_PORT_F, 1), on); break; case 1: gpio_set(GPIO(GPIO_PORT_F, 2), on); break; case 2: gpio_set(GPIO(GPIO_PORT_F, 3), on); break; }}
开发者ID:DSKIM3,项目名称:lk,代码行数:8,
示例10: io_mcp_get_pin_infoirom io_error_t io_mcp_get_pin_info(string_t *dst, const struct io_info_entry_T *info, io_data_pin_entry_t *pin_data, const io_config_pin_entry_t *pin_config, int pin){ int bank, bankpin, tv; int io, olat, cached; mcp_data_pin_t *mcp_pin_data; bank = (pin & 0x08) >> 3; bankpin = pin & 0x07; mcp_pin_data = &mcp_data_pin_table[info->instance][pin]; switch(pin_config->llmode) { case(io_pin_ll_input_analog): { if(read_register(dst, info->address, GPIO(bank), &tv) != io_ok) return(io_error); string_format(dst, "current io: %s", onoff(tv & (1 << bankpin))); break; } case(io_pin_ll_counter): { if(read_register(dst, info->address, GPIO(bank), &tv) != io_ok) return(io_error); string_format(dst, "current io: %s, debounce: %d", onoff(tv & (1 << bankpin)), mcp_pin_data->debounce); break; } case(io_pin_ll_output_digital): { if(read_register(dst, info->address, GPIO(bank), &tv) != io_ok) return(io_error); io = tv & (1 << bankpin); if(read_register(dst, info->address, OLAT(bank), &tv) != io_ok) return(io_error); olat = tv & (1 << bankpin); cached = pin_output_cache[bank] & (1 << bankpin); string_format(dst, "current latch: %s, io: %s, cache: %s", onoff(io), onoff(olat), onoff(cached)); break; } default: { } } return(io_ok);}
开发者ID:ESP32DE,项目名称:esp8266-universal-io-bridge,代码行数:58,
示例11: board_iduint32_t board_id(void){ const gpio_t pins[] = {[2] = GPIO(51), [1] = GPIO(62), [0] = GPIO(38)}; static uint32_t id = UNDEFINED_STRAPPING_ID; if (id == UNDEFINED_STRAPPING_ID) id = gpio_base2_value(pins, ARRAY_SIZE(pins)); return id;}
开发者ID:canistation,项目名称:coreboot,代码行数:10,
示例12: rush_backlight_update/* Turn on or turn off the backlight */static int rush_backlight_update(DisplayOps *me, uint8_t enable){ TegraGpio *backlight_vdd_enable = new_tegra_gpio_output(GPIO(P, 2)); TegraGpio *backlight_enable = new_tegra_gpio_output(GPIO(H, 2)); gpio_set(&backlight_vdd_enable->ops, enable); mdelay(10); gpio_set(&backlight_enable->ops, enable); return 0;}
开发者ID:rockchip-linux,项目名称:depthcharge,代码行数:12,
示例13: ram_codeuint32_t ram_code(void){ uint32_t code; static gpio_t pins[] = {[3] = GPIO(8, A, 3), [2] = GPIO(8, A, 2), [1] = GPIO(8, A, 1), [0] = GPIO(8, A, 0)}; /* GPIO8_A0 is LSB */ code = gpio_base2_value(pins, ARRAY_SIZE(pins)); printk(BIOS_SPEW, "RAM Config: %u./n", code); return code;}
开发者ID:tidatida,项目名称:coreboot,代码行数:11,
示例14: UART_Initvoid UART_Init(int id, UINT32 baud){ if (id == 0) { GPIO_SetP0Function(GPIO(0,0), 1); // P0.0 Function TxD UART0 GPIO_SetP0Function(GPIO(0,1), 1); // P0.1 Function RxD UART0 } else if (id == 1) { GPIO_SetP0Function(GPIO(0,8), 1); // P0.8 Function TxD UART0 GPIO_SetP0Function(GPIO(0,9), 1); // P0.9 Function RxD UART0 } UART_SetBaud(id, baud);}
开发者ID:toxicgumbo,项目名称:m1,代码行数:12,
示例15: mainboard_keyboard_initvoid mainboard_keyboard_init(struct pk_sm_desc *desc){ pwr_btn_gpio = sysinfo_lookup_gpio("power", 1, new_tegra_gpio_input_from_coreboot); die_if(!pwr_btn_gpio, "No GPIO for power!!/n"); /* Inputs volup and voldown are active low. */ vol_down_gpio = new_gpio_not(&new_tegra_gpio_input(GPIO(X, 7))->ops); vol_up_gpio = new_gpio_not(&new_tegra_gpio_input(GPIO(X, 6))->ops); foster_sm_init(desc);}
开发者ID:coreboot,项目名称:depthcharge,代码行数:12,
示例16: board_iduint8_t board_id(void){ static int id = -1; static gpio_t pins[] = {[3] = GPIO(2, A, 7), [2] = GPIO(2, A, 2), [1] = GPIO(2, A, 1), [0] = GPIO(2, A, 0)}; /* GPIO2_A0 is LSB */ if (id < 0) { id = gpio_base2_value(pins, ARRAY_SIZE(pins)); printk(BIOS_SPEW, "Board ID: %d./n", id); } return id;}
开发者ID:tidatida,项目名称:coreboot,代码行数:13,
示例17: enable_watchpointsvoid enable_watchpoints(){ // enable rising-edge interrupt on enabled codepoint pins (harmless to do every time) uint8_t enabled_pins = 0; for (int i = 0; i < NUM_CODEPOINT_PINS; ++i) { enabled_pins |= (watchpoints & (1 << i)) ? ((1 << i) << PIN_CODEPOINT_0) : 0; } GPIO(PORT_CODEPOINT, DIR) &= ~BITS_CODEPOINT; GPIO(PORT_CODEPOINT, IES) &= ~BITS_CODEPOINT; GPIO(PORT_CODEPOINT, IFG) &= ~BITS_CODEPOINT; GPIO(PORT_CODEPOINT, IE) |= enabled_pins;}
开发者ID:CMUAbstract,项目名称:edb-firmware,代码行数:14,
示例18: configure_hdmistatic void configure_hdmi(void){ rk808_configure_switch(2, 1); /* VCC18_LCD (HDMI_AVDD_1V8) */ rk808_configure_ldo(7, 1000); /* VDD10_LCD (HDMI_AVDD_1V0) */ /* set POWER_HDMI_EN */ switch (board_id()) { case 0: gpio_output(GPIO(7, A, 2), 1); break; default: gpio_output(GPIO(5, C, 3), 1); break; }}
开发者ID:AdriDlu,项目名称:coreboot,代码行数:15,
示例19: fill_lb_gpiosvoid fill_lb_gpios(struct lb_gpios *gpios){ int count = 0; /* Write Protect: active low */ gpios->gpios[count].port = GPIO_R1_INDEX; gpios->gpios[count].polarity = ACTIVE_LOW; gpios->gpios[count].value = gpio_get_in_value(GPIO(R1)); strncpy((char *)gpios->gpios[count].name, "write protect", GPIO_MAX_NAME_LENGTH); count++; /* Recovery: active high */ gpios->gpios[count].port = -1; gpios->gpios[count].polarity = ACTIVE_HIGH; gpios->gpios[count].value = get_recovery_mode_switch(); strncpy((char *)gpios->gpios[count].name, "recovery", GPIO_MAX_NAME_LENGTH); count++; /* Lid: active high */ gpios->gpios[count].port = GPIO_R4_INDEX; gpios->gpios[count].polarity = ACTIVE_HIGH; gpios->gpios[count].value = gpio_get_in_value(GPIO(R4)); strncpy((char *)gpios->gpios[count].name, "lid", GPIO_MAX_NAME_LENGTH); count++; /* Power: active low */ gpios->gpios[count].port = GPIO_Q0_INDEX; gpios->gpios[count].polarity = ACTIVE_LOW; gpios->gpios[count].value = gpio_get_in_value(GPIO(Q0)); strncpy((char *)gpios->gpios[count].name, "power", GPIO_MAX_NAME_LENGTH); count++; /* Developer: virtual GPIO active high */ gpios->gpios[count].port = -1; gpios->gpios[count].polarity = ACTIVE_HIGH; gpios->gpios[count].value = get_developer_mode_switch(); strncpy((char *)gpios->gpios[count].name, "developer", GPIO_MAX_NAME_LENGTH); count++; gpios->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio)); gpios->count = count; printk(BIOS_ERR, "Added %d GPIOS size %d/n", count, gpios->size);}
开发者ID:kmalkki,项目名称:coreboot,代码行数:48,
示例20: bootblock_mainboard_initvoid bootblock_mainboard_init(void){ if (rkclk_was_watchdog_reset()) reboot_from_watchdog(); gpio_output(GPIO(0, B, 3), 1); /* Power LED */ /* Up VDD_CPU (BUCK1) to 1.4V to support max CPU frequency (1.8GHz). */ setbits_le32(&rk3288_pmu->iomux_i2c0scl, IOMUX_I2C0SCL); setbits_le32(&rk3288_pmu->iomux_i2c0sda, IOMUX_I2C0SDA); assert(CONFIG_PMIC_BUS == 0); /* must correspond with IOMUX */ i2c_init(CONFIG_PMIC_BUS, 400*KHz); /* Slowly raise to max CPU voltage to prevent overshoot */ rk808_configure_buck(1, 1200); udelay(175);/* Must wait for voltage to stabilize,2mV/us */ rk808_configure_buck(1, 1400); udelay(100);/* Must wait for voltage to stabilize,2mV/us */ rkclk_configure_cpu(APLL_1800_MHZ); /* i2c1 for tpm */ write32(&rk3288_grf->iomux_i2c1, IOMUX_I2C1); i2c_init(1, 400*KHz); /* spi2 for firmware ROM */ write32(&rk3288_grf->iomux_spi2csclk, IOMUX_SPI2_CSCLK); write32(&rk3288_grf->iomux_spi2txrx, IOMUX_SPI2_TXRX); rockchip_spi_init(CONFIG_BOOT_MEDIA_SPI_BUS, 24750*KHz); setup_chromeos_gpios();}
开发者ID:AdriDlu,项目名称:coreboot,代码行数:31,
示例21: configure_usbstatic void configure_usb(void){ gpio_output(GPIO(0, B, 3), 1); /* HOST1_PWR_EN */ gpio_output(GPIO(0, B, 4), 1); /* USBOTG_PWREN_H */ switch (board_id()) { case 0: gpio_output(GPIO(7, B, 3), 1); /* 5V_DRV */ break; case 1: break; /* 5V_DRV moved to EC in rev2 */ default: gpio_output(GPIO(7, C, 5), 1); /* 5V_DRV, again */ break; }}
开发者ID:tidatida,项目名称:coreboot,代码行数:16,
示例22: setStatus void MTD_FLASHMEM HTTPGPIOResponseHTML::flush() { setStatus(STR_200_OK); addHeader(STR_Content_Type, STR_TEXTHTML); char const* cmd = getRequest().query[FSTR("cmd")]; if (cmd && f_strcmp(cmd, FSTR("set")) == 0) { // set gpio HTTPHelperConfiguration::GPIOSetValue(this); } else if (cmd && f_strcmp(cmd, FSTR("conf")) == 0) { // conf gpio HTTPHelperConfiguration::GPIOConf(this); } char const* gpio = getRequest().query[STR_gpio]; if (gpio) { uint8_t gpion = strtol(gpio, NULL, 10); addContent(GPIO(gpion).read()? STR_1 : STR_0); } HTTPResponse::flush(); }
开发者ID:wony365,项目名称:ESPWebFramework,代码行数:26,
示例23: getRequest void MTD_FLASHMEM HTTPGPIOConfigurationResponse::flush() { if (getRequest().method == HTTPHandler::Post) { char const* gpio = getRequest().form[FSTR("GPIO")]; if (getRequest().form[FSTR("configured")]) { // gpio enabled char const* mode = getRequest().form[STR_mode]; char const* pullUp = getRequest().form[STR_pullup]; ConfigurationManager::setGPIOParams(strtol(gpio, NULL, 10), true, f_strcmp(mode, STR_out) == 0, pullUp != NULL, false); ConfigurationManager::applyGPIO(); } else if (gpio) { // gpio disabled (not configured) ConfigurationManager::setGPIOParams(strtol(gpio, NULL, 10), false, false, false, false); } } HTTPHelperConfiguration::GPIOSetValue(this); LinkedCharChunks* linkedChunks = addParamCharChunks(FSTR("GPIOS")); for (uint32_t i = 0; i != 16; ++i) { if (i != 1 && i != 3 && (i < 6 || i > 11)) { bool configured, isOutput, pullUp, value; ConfigurationManager::getGPIOParams(i, &configured, &isOutput, &pullUp, &value); linkedChunks->addChunk(f_printf(FSTR("<tr> <td>%d</td> <td><form method='POST'>"), i), true); linkedChunks->addChunk(f_printf(FSTR("Enabled <input type='checkbox' name='configured' value='1' onclick=/"document.getElementById('GPIO%d').disabled=!this.checked/" %s>"), i, configured? STR_checked:STR_), true); linkedChunks->addChunk(f_printf(FSTR("<fieldset class='inline' id='GPIO%d' %s>"), i, configured? STR_:STR_disabled), true); linkedChunks->addChunk(f_printf(FSTR("<select name='mode'><option value='in' %s>IN</option><option value='out' %s>OUT</option></select>"), isOutput? STR_:STR_selected, isOutput? STR_selected:STR_), true); linkedChunks->addChunk(f_printf(FSTR(" PullUp <input type='checkbox' name='pullup' value='1' %s> </fieldset>"), pullUp? STR_checked:STR_), true); linkedChunks->addChunk(f_printf(FSTR("<input type='hidden' name='GPIO' value='%d'>"), i), true); linkedChunks->addChunk(FSTR("<input type='submit' value='Save'></form></td>")); if (configured) { if (isOutput) { linkedChunks->addChunk(f_printf(FSTR("<td><a href='confgpio?gpio=%d&val=%d&store=1' class='link_button2'>%s</a></td> </tr>"), i, !value, value? STR_HI:STR_LO), true); } else { linkedChunks->addChunk(f_printf(FSTR("<td>%s</td> </tr>"), GPIO(i).read()? STR_HI:STR_LO), true); } } else { linkedChunks->addChunk(FSTR("<td></td></tr>")); } } } HTTPTemplateResponse::flush(); }
开发者ID:wony365,项目名称:ESPWebFramework,代码行数:60,
示例24: init_instatic int init_in(int argc, char **argv){ int port, pin, pull; if (argc < 3) { printf("usage: %s <port> <pin> [pull_config]/n", argv[0]); puts(" pull_config: 0: no pull resistor (default)/n" " 1: pull up/n" " 2: pull down"); return 1; } port = atoi(argv[1]); pin = atoi(argv[2]); if (argc >= 4) { pull = parse_pull(argv[3]); if (pull < 0) { return 1; } } else { pull = GPIO_NOPULL; } if (gpio_init(GPIO(port, pin), GPIO_DIR_IN, pull) < 0) { printf("Error while initializing PORT_%i.%02i as input/n", port, pin); return 1; } printf("PORT_%i.%02i initialized successful as input/n", port, pin); return 0;}
开发者ID:bumpy-b,项目名称:RIOT,代码行数:30,
示例25: target_early_initvoid target_early_init(void){ /* configure the usart3 pins */ GPIO_PinRemapConfig(GPIO_FullRemap_USART3, ENABLE); gpio_config(GPIO(GPIO_PORT_D, 8), GPIO_STM32_AF); gpio_config(GPIO(GPIO_PORT_D, 9), GPIO_INPUT); stm32_debug_early_init(); /* configure some status leds */ gpio_set(GPIO_LED0, 0); gpio_set(GPIO_LED1, 0); gpio_config(GPIO_LED0, GPIO_OUTPUT); gpio_config(GPIO_LED1, GPIO_OUTPUT);}
开发者ID:DSKIM3,项目名称:lk,代码行数:17,
示例26: configure_emmcstatic void configure_emmc(void){ write32(&rk3288_grf->iomux_emmcdata, IOMUX_EMMCDATA); write32(&rk3288_grf->iomux_emmcpwren, IOMUX_EMMCPWREN); write32(&rk3288_grf->iomux_emmccmd, IOMUX_EMMCCMD); gpio_output(GPIO(2, B, 1), 1); /* EMMC_RST_L */}
开发者ID:RafaelRMachado,项目名称:Coreboot,代码行数:8,
注:本文中的GPIO函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GPIODirModeSet函数代码示例 C++ GOTO函数代码示例 |