本文整理汇总了C++中set_gpio_val函数的典型用法代码示例。如果您正苦于以下问题:C++ set_gpio_val函数的具体用法?C++ set_gpio_val怎么用?C++ set_gpio_val使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_gpio_val函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eth_pinmux_init
//#define NET_EXT_CLK 1
static void __init eth_pinmux_init(void)
{
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_6,(3<<17));//reg6[17/18]=0
#ifdef NET_EXT_CLK
eth_set_pinmux(ETH_BANK0_GPIOY1_Y9, ETH_CLK_IN_GPIOY0_REG6_18, 0);
#else
eth_set_pinmux(ETH_BANK0_GPIOY1_Y9, ETH_CLK_OUT_GPIOY0_REG6_17, 0);
#endif
//power hold
//setbits_le32(P_PREG_AGPIO_O,(1<<8));
//clrbits_le32(P_PREG_AGPIO_EN_N,(1<<8));
//set_gpio_mode(GPIOA_bank_bit(4),GPIOA_bit_bit0_14(4),GPIO_OUTPUT_MODE);
//set_gpio_val(GPIOA_bank_bit(4),GPIOA_bit_bit0_14(4),1);
CLEAR_CBUS_REG_MASK(PREG_ETHERNET_ADDR0, 1); // Disable the Ethernet clocks
// ---------------------------------------------
// Test 50Mhz Input Divide by 2
// ---------------------------------------------
// Select divide by 2
CLEAR_CBUS_REG_MASK(PREG_ETHERNET_ADDR0, (1<<3)); // desc endianess "same order"
CLEAR_CBUS_REG_MASK(PREG_ETHERNET_ADDR0, (1<<2)); // ata endianess "little"
SET_CBUS_REG_MASK(PREG_ETHERNET_ADDR0, (1 << 1)); // divide by 2 for 100M
SET_CBUS_REG_MASK(PREG_ETHERNET_ADDR0, 1); // enable Ethernet clocks
udelay(100);
// ethernet reset
set_gpio_mode(GPIOD_bank_bit0_9(7), GPIOD_bit_bit0_9(7), GPIO_OUTPUT_MODE);
set_gpio_val(GPIOD_bank_bit0_9(7), GPIOD_bit_bit0_9(7), 0);
mdelay(100);
set_gpio_val(GPIOD_bank_bit0_9(7), GPIOD_bit_bit0_9(7), 1);
}
示例2: power_off_backlight
void power_off_backlight(void)
{
//BL_PWM -> GPIOD_18: 0
#if 0
set_gpio_val(GPIOA_bank_bit(7), GPIOA_bit_bit0_14(7), 0);
set_gpio_mode(GPIOA_bank_bit(7), GPIOA_bit_bit0_14(7), GPIO_OUTPUT_MODE);
#else
set_gpio_val(GPIOD_bank_bit2_24(18), GPIOD_bit_bit2_24(18), 0);
set_gpio_mode(GPIOD_bank_bit2_24(18), GPIOD_bit_bit2_24(18), GPIO_OUTPUT_MODE);
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_2, (1<<31));
CLEAR_CBUS_REG_MASK(PWM_MISC_REG_AB, (1 << 0));
set_gpio_val(GPIOA_bank_bit(7), GPIOA_bit_bit0_14(7), 0);
set_gpio_mode(GPIOA_bank_bit(7), GPIOA_bit_bit0_14(7), GPIO_OUTPUT_MODE);
#endif
printf("test lcd power and backlight off\n");
//test
*((unsigned long*)0xC1108048) &= ~(1<<16); //GPIOD18 backlight enable
*((unsigned long*)0xC110804c) &= (1<<16); //GPIOD18 backlight enable
*((unsigned long*)0xC1108030) &= ~(1<<11); //GPIOA7 backlight pwm
*((unsigned long*)0xC1108034) &= (1<<11); //GPIOA7 backlight pwm
*((unsigned long*)0xC1108048) &= ~(1<<10); //GPIOD12 lcd power
*((unsigned long*)0xC110804c) &= ~(1<<10); //GPIOD12 lcd power
*((unsigned long*)0xC1108048) &= ~(1<<11); //GPIOD13 lcd vcc
*((unsigned long*)0xC110804c) |= ~(1<<11); //GPIOD13 lcd vcc
}
示例3: u_boot_init_lvds
void u_boot_init_lvds()
{
int j;
int m = 10, n = 34;
unsigned long reverse = simple_strtoul(getenv ("port_reverse"), NULL, 16);
if(reverse == 1) {
port_reverse = 1;
}
//GPIOX_54 LVDS power off
set_gpio_val(GPIOX_bank_bit32_63(54), GPIOX_bit_bit32_63(54), 0);
set_gpio_mode(GPIOX_bank_bit32_63(54), GPIOX_bit_bit32_63(54), 0);
//GPIOX_54 LVDS power on
set_gpio_val(GPIOX_bank_bit32_63(54), GPIOX_bit_bit32_63(54), 1);
set_gpio_mode(GPIOX_bank_bit32_63(54), GPIOX_bit_bit32_63(54), 0);
for (j=0; j<n; j++)
udelay(1000);
Wr(REG_LVDS_PHY_CNTL4, Rd(REG_LVDS_PHY_CNTL4)|0xfff); //LVDS_MDR_PU
Wr(REG_LVDS_PHY_CNTL5, Rd(REG_LVDS_PHY_CNTL5)|(0xf<<11)); //LVDS_REFCTL<4:0>=<01111>
Wr(REG_LVDS_PHY_CNTL0,0xfff); //LVDS_PDN_A*=1, LVDS_PDN_B*=1
/*for (j=0; j<m; j++)
udelay(1000);*/
//GPIOB_6 Backlight power on
set_gpio_val(GPIOB_bank_bit0_7(6), GPIOB_bank_bit0_7(6), 0);
set_gpio_mode(GPIOB_bank_bit0_7(6), GPIOB_bank_bit0_7(6), 0);
lvds_set_current_vmode(VMODE_LVDS_1080P);
}
示例4: powerkey_led_on
static void powerkey_led_on(void)
{
//red light off
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_8, (1<<5));
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_12, (1<<11));
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_0, (1<<13));
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_1, (1<<2));
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_9, (1<<18));
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_11, (1<<4));
set_gpio_val(GPIOA_bank_bit(3), GPIOA_bit_bit0_14(3), 1);
set_gpio_mode(GPIOA_bank_bit(3), GPIOA_bit_bit0_14(3), GPIO_OUTPUT_MODE);
//green light on
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_5, ((1<<29)|(1<<30)));
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_11, (1<<22));
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_6, (1<<10));
set_gpio_val(GPIOE_bank_bit16_21(20), GPIOE_bit_bit16_21(20), 0);
set_gpio_mode(GPIOE_bank_bit16_21(20), GPIOE_bit_bit16_21(20), GPIO_OUTPUT_MODE);
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_12, (1<<29));
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_5, ((1<<14)|(1<<20)));
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_7, ((1<<12)|(1<<13)));
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_8, (1<<21));
set_gpio_val(GPIOD_bank_bit2_24(23), GPIOD_bit_bit2_24(23), 1);
set_gpio_mode(GPIOD_bank_bit2_24(23), GPIOD_bit_bit2_24(23), GPIO_OUTPUT_MODE);
}
示例5: board_eth_init
int board_eth_init(bd_t *bis)
{
/* Use Misc PLL for the source of ethernet */
eth_clk_set(ETH_CLKSRC_MISC_CLK, get_misc_pll_clk(), (50 * CLK_1M));
/* Use Internal clock output from GPIOY0*/
eth_set_pinmux(ETH_BANK0_GPIOY1_Y9, ETH_CLK_OUT_GPIOY0_REG6_17, 0);
/*disalbe*/
//reset:LCD_G5
writel(readl(ETH_PLL_CNTL) & ~(1 << 0), ETH_PLL_CNTL); // Disable the Ethernet clocks
// ---------------------------------------------
// Test 50Mhz Input Divide by 2
// ---------------------------------------------
// Select divide by 2
writel(readl(ETH_PLL_CNTL) | (0 << 3), ETH_PLL_CNTL); // desc endianess "same order"
writel(readl(ETH_PLL_CNTL) | (0 << 2), ETH_PLL_CNTL); // data endianess "little"
writel(readl(ETH_PLL_CNTL) | (1 << 1), ETH_PLL_CNTL); // divide by 2 for 100M
writel(readl(ETH_PLL_CNTL) | (1 << 0), ETH_PLL_CNTL); // enable Ethernet clocks
udelay(100);
/* reset phy with GPIOA_23*/
set_gpio_mode(GPIOA_bank_bit0_27(23), GPIOA_bit_bit0_27(23), GPIO_OUTPUT_MODE);
set_gpio_val(GPIOA_bank_bit0_27(23), GPIOA_bit_bit0_27(23), 0);
udelay(100); //GPIOE_bank_bit16_21(16) reset end;
set_gpio_val(GPIOA_bank_bit0_27(23), GPIOA_bit_bit0_27(23), 1);
udelay(100); //waiting reset end;
aml_eth_init(bis);
return 0;
}
示例6: board_eth_init
int board_eth_init(bd_t *bis)
{
/*
@todo implement this function
*/
//eth_clk_set(ETH_CLKSRC_SYS_D3,900*CLK_1M/3,50*CLK_1M);
eth_clk_set(ETH_CLKSRC_SYS_D3,get_cpu_clk()*2/3,50*CLK_1M);
// GPIOX59-X67 for M2_socket
// GPIOE_57/NA nRst;
eth_set_pinmux(ETH_BANK1_GPIOX59_X67,ETH_CLK_OUT_GPIOX68_REG3_14,0);
CLEAR_CBUS_REG_MASK(PREG_ETHERNET_ADDR0, 1);
SET_CBUS_REG_MASK(PREG_ETHERNET_ADDR0, (1 << 1));
SET_CBUS_REG_MASK(PREG_ETHERNET_ADDR0, 1);
udelay(100);
/*reset*/
set_gpio_val(GPIOX_bank_bit32_63(57), GPIOX_bit_bit32_63(57), 0);
set_gpio_mode(GPIOX_bank_bit32_63(57), GPIOX_bit_bit32_63(57), GPIO_OUTPUT_MODE);
udelay(100);
set_gpio_val(GPIOX_bank_bit32_63(57), GPIOX_bit_bit32_63(57), 1);
set_gpio_mode(GPIOX_bank_bit32_63(57), GPIOX_bit_bit32_63(57), GPIO_OUTPUT_MODE);
udelay(10); //waiting reset end;
aml_eth_init(bis);
return 0;
}
示例7: gpio_set_vbus_power
//@board schematic: m3_skt_v1.pdf
//@pinmax: AppNote-M3-CorePinMux.xlsx
//GPIOA_26 used to set VCCX2_EN: 0 to enable power and 1 to disable power
static void gpio_set_vbus_power(char is_power_on)
{
#if 0
if(is_power_on)
{
//@WA-AML8726-M3_REF_V1.0.pdf
//GPIOA_26 -- VCCX2_EN
set_gpio_mode(GPIOA_bank_bit0_27(26), GPIOA_bit_bit0_27(26), GPIO_OUTPUT_MODE);
set_gpio_val(GPIOA_bank_bit0_27(26), GPIOA_bit_bit0_27(26), 0);
//@WA-AML8726-M3_REF_V1.0.pdf
//GPIOD_9 -- USB_PWR_CTL
set_gpio_mode(GPIOD_bank_bit0_9(9), GPIOD_bit_bit0_9(9), GPIO_OUTPUT_MODE);
set_gpio_val(GPIOD_bank_bit0_9(9), GPIOD_bit_bit0_9(9), 1);
udelay(100000);
}
else
{
set_gpio_mode(GPIOD_bank_bit0_9(9), GPIOD_bit_bit0_9(9), GPIO_OUTPUT_MODE);
set_gpio_val(GPIOD_bank_bit0_9(9), GPIOD_bit_bit0_9(9), 0);
set_gpio_mode(GPIOA_bank_bit0_27(26), GPIOA_bit_bit0_27(26), GPIO_OUTPUT_MODE);
set_gpio_val(GPIOA_bank_bit0_27(26), GPIOA_bit_bit0_27(26), 1);
}
#endif
}
示例8: power_off_lcd
void power_off_lcd(void)
{
/* PIN_F20, GPIOC_12, Pull low, For LVDS IC */
set_gpio_val(GPIOC_bank_bit0_26(12), GPIOC_bit_bit0_26(12), 0);
set_gpio_mode(GPIOC_bank_bit0_26(12), GPIOC_bit_bit0_26(12), GPIO_OUTPUT_MODE);
/* PIN_F21, GPIOC_11, Pull high, For LCD_3.3V */
set_gpio_val(GPIOC_bank_bit0_26(11), GPIOC_bit_bit0_26(11), 1);
set_gpio_mode(GPIOC_bank_bit0_26(11), GPIOC_bit_bit0_26(11), GPIO_OUTPUT_MODE);
}
示例9: camera_power_off
int camera_power_off(void)
{
printf( "amlogic camera driver: ov2655_v4l2_uninit. \n");
set_gpio_val(GPIOA_bank_bit0_27(24), GPIOA_bit_bit0_27(24), 1); // set camera power disable
set_gpio_mode(GPIOA_bank_bit0_27(24), GPIOA_bit_bit0_27(24), GPIO_OUTPUT_MODE);
printf( "amlogic camera driver: gc0308_v4l2_uninit. \n");
set_gpio_val(GPIOA_bank_bit0_27(25), GPIOA_bit_bit0_27(25), 1); // set camera power disable
set_gpio_mode(GPIOA_bank_bit0_27(25), GPIOA_bit_bit0_27(25), GPIO_OUTPUT_MODE);
}
示例10: gpio_set_vbus_power
static void gpio_set_vbus_power(char is_power_on)
{
if(is_power_on){
set_gpio_mode(GPIOA_bank_bit0_27(26), GPIOA_bit_bit0_27(26), GPIO_OUTPUT_MODE);
set_gpio_val(GPIOA_bank_bit0_27(26), GPIOA_bit_bit0_27(26), 0);
udelay(100000);
}else{
set_gpio_mode(GPIOA_bank_bit0_27(26), GPIOA_bit_bit0_27(26), GPIO_OUTPUT_MODE);
set_gpio_val(GPIOA_bank_bit0_27(26), GPIOA_bit_bit0_27(26), 1);
}
}
示例11: set_power_led_onoff
static void set_power_led_onoff(char *onoff)// 1:on; 0:off
{
/* GPIO AO_10 */
if (0 == strcmp(onoff, "powerkey led on")) { //led on
set_gpio_val(GPIOAO_bank_bit0_11(10), GPIOAO_bit_bit0_11(10), 1);
set_gpio_mode(GPIOAO_bank_bit0_11(10), GPIOAO_bit_bit0_11(10), GPIO_OUTPUT_MODE);
} else {
set_gpio_val(GPIOAO_bank_bit0_11(10), GPIOAO_bit_bit0_11(10), 0);
set_gpio_mode(GPIOAO_bank_bit0_11(10), GPIOAO_bit_bit0_11(10), GPIO_OUTPUT_MODE);
}
}
示例12: sn7325_pwr_rst
void sn7325_pwr_rst(void)
{
//reset GPIOD_20(AA5)
set_gpio_val(GPIOD_bank_bit2_24(20), GPIOD_bit_bit2_24(20), 0); //low
set_gpio_mode(GPIOD_bank_bit2_24(20), GPIOD_bit_bit2_24(20), GPIO_OUTPUT_MODE);
udelay(2); //delay 2us
set_gpio_val(GPIOD_bank_bit2_24(20), GPIOD_bit_bit2_24(20), 1); //high
set_gpio_mode(GPIOD_bank_bit2_24(20), GPIOD_bit_bit2_24(20), GPIO_OUTPUT_MODE);
//end
}
示例13: mute_spk
void mute_spk(struct snd_soc_codec* codec, int flag)
{
#ifdef _AML_M3_HW_DEBUG_
printk("***Entered %s:%s\n", __FILE__,__func__);
#endif
if(flag){
set_gpio_val(GPIOC_bank_bit0_15(4), GPIOC_bit_bit0_15(4), 1); // mute speak
set_gpio_mode(GPIOC_bank_bit0_15(4), GPIOC_bit_bit0_15(4), GPIO_OUTPUT_MODE);
}else{
set_gpio_val(GPIOC_bank_bit0_15(4), GPIOC_bit_bit0_15(4), 0); // unmute speak
set_gpio_mode(GPIOC_bank_bit0_15(4), GPIOC_bit_bit0_15(4), GPIO_OUTPUT_MODE);
}
}
示例14: sn7325_pwr_rst
void sn7325_pwr_rst(void)
{
//reset
printk( "amlogic sn7325 driver: init.\n");
set_gpio_val(GPIOD_bank_bit2_24(20), GPIOD_bit_bit2_24(20), 0); //low
set_gpio_mode(GPIOD_bank_bit2_24(20), GPIOD_bit_bit2_24(20), GPIO_OUTPUT_MODE);
udelay(2); //delay 2us
set_gpio_val(GPIOD_bank_bit2_24(20), GPIOD_bit_bit2_24(20), 1); //high
set_gpio_mode(GPIOD_bank_bit2_24(20), GPIOD_bit_bit2_24(20), GPIO_OUTPUT_MODE);
//end
}
示例15: set_charging_mode
static void set_charging_mode(int flags)
{
//GPIOD_22 low: fast charge high: slow charge
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_7, (1<<18));
if(flags == 1)
{
set_gpio_val(GPIOD_bank_bit2_24(22), GPIOD_bit_bit2_24(22), 0); //fast charge
}
else
{
set_gpio_val(GPIOD_bank_bit2_24(22), GPIOD_bit_bit2_24(22), 1); //slow charge
}
set_gpio_mode(GPIOD_bank_bit2_24(22), GPIOD_bit_bit2_24(22), GPIO_OUTPUT_MODE);
}