本文整理汇总了C++中set_gpio_val函数的典型用法代码示例。如果您正苦于以下问题:C++ set_gpio_val函数的具体用法?C++ set_gpio_val怎么用?C++ set_gpio_val使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_gpio_val函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:Sophrinix,项目名称:Meson-3-Kernel,代码行数:34,代码来源:board-m3-reff16.c
示例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
}
开发者ID:Doxlon,项目名称:buildroot-uboot,代码行数:29,代码来源:lcd.c
示例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);
}
开发者ID:bogdanov-d-a,项目名称:Amlogic-reff16-uboot,代码行数:34,代码来源:lvds.c
示例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);
}
开发者ID:Doxlon,项目名称:buildroot-uboot,代码行数:26,代码来源:8726m_mid_refb09new512M.c
示例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;
}
开发者ID:Doxlon,项目名称:buildroot-uboot,代码行数:29,代码来源:m3_mid_reff07.c
示例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;
}
开发者ID:bogdanov-d-a,项目名称:Amlogic-reff16-uboot,代码行数:27,代码来源:aml_tv_m2c_2pc_4l_refe07.c
示例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
}
开发者ID:xtra72,项目名称:s805,代码行数:30,代码来源:m6_g33_1G_v2.c
示例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);
}
开发者ID:CoreTech-Development,项目名称:buildroot-linux-kernel,代码行数:9,代码来源:ml10.c
示例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);
}
开发者ID:bogdanov-d-a,项目名称:Amlogic-reff16-uboot,代码行数:10,代码来源:m3_mid_reff11.c
示例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);
}
}
开发者ID:Doxlon,项目名称:buildroot-uboot,代码行数:11,代码来源:m3_socket.c
示例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);
}
}
开发者ID:Michael-Pizzileo,项目名称:buildroot-linux-kernel-m3,代码行数:11,代码来源:am_gpio.c
示例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
}
开发者ID:Doxlon,项目名称:buildroot-uboot,代码行数:12,代码来源:8726m_mid_refb14.c
示例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);
}
}
开发者ID:Sophrinix,项目名称:Meson-3-Kernel,代码行数:13,代码来源:board-m3-reff16.c
示例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
}
开发者ID:Doxlon,项目名称:buildroot-uboot,代码行数:13,代码来源:8726m_mid_refb09new.c
示例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);
}
开发者ID:Doxlon,项目名称:buildroot-uboot,代码行数:14,代码来源:battery_charging.c
示例16: set_usb_a_vbus_power
static void set_usb_a_vbus_power(char is_power_on)
{
#define USB_A_POW_GPIO_BIT 20
if(is_power_on){
printk(KERN_INFO "set usb port power on (board gpio %d)!\n",USB_A_POW_GPIO_BIT);
set_gpio_mode(PREG_HGPIO,USB_A_POW_GPIO_BIT,GPIO_OUTPUT_MODE);
set_gpio_val(PREG_HGPIO,USB_A_POW_GPIO_BIT,1);
}
else {
printk(KERN_INFO "set usb port power off (board gpio %d)!\n",USB_A_POW_GPIO_BIT);
set_gpio_mode(PREG_HGPIO,USB_A_POW_GPIO_BIT,GPIO_OUTPUT_MODE);
set_gpio_val(PREG_HGPIO,USB_A_POW_GPIO_BIT,0);
}
}
开发者ID:RoelandK,项目名称:Amlogic-reff16-uboot,代码行数:14,代码来源:dvbc_aml8726m_public.c
示例17: board_eth_init
int board_eth_init(bd_t *bis)
{
unsigned v;
CLEAR_CBUS_REG_MASK(PERIPHS_PIN_MUX_6,(3<<17));//reg6[17/18]=0
#ifdef CONFIG_NET_CLK_EXTERNAL
//rmii 50 in
//set clock
eth_clk_set_invert(7,50*CLK_1M,50*CLK_1M);
eth_set_pinmux(ETH_BANK0_GPIOY1_Y9, ETH_CLK_IN_GPIOY0_REG6_18, 0);
#else
/* 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);
#endif //CONFIG_NET_CLK_EXTERNAL
/*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 GPIOD_7*/
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);
udelay(2000);
set_gpio_val(GPIOD_bank_bit0_9(7), GPIOD_bit_bit0_9(7), 1);
udelay(2000); //waiting reset end;
/* reset phy with GPIOAO_6*/
/* v = ~((1<<6)|(1<22));
writel(v,0xC81000024);
udelay(2000);
v |= (1<22);
writel(v,0xC81000024);
udelay(2000); //waiting reset end;
*/
aml_eth_init(bis);
return 0;
}
开发者ID:RoelandK,项目名称:Amlogic-reff16-uboot,代码行数:48,代码来源:m3_mbox.c
示例18: power_on_backlight
void power_on_backlight(void)
{
msleep(20);
lvds_port_enable();
msleep(50);
//BL_EN: GPIOD_1(V_LED)
#if (BL_CTL==BL_CTL_GPIO)
WRITE_MPEG_REG(PERIPHS_PIN_MUX_0, READ_MPEG_REG(PERIPHS_PIN_MUX_0) & ~(1 << 19));
WRITE_MPEG_REG(PERIPHS_PIN_MUX_3, READ_MPEG_REG(PERIPHS_PIN_MUX_3) & ~((1 << 24)|(1 << 25)));
WRITE_MPEG_REG(PERIPHS_PIN_MUX_7, READ_MPEG_REG(PERIPHS_PIN_MUX_7) & ~(1 << 17));
set_gpio_val(GPIOC_bank_bit0_15(9), GPIOC_bit_bit0_15(9), 1); //set GPIOC_9 as BL_EN low to power off backlight
set_gpio_mode(GPIOC_bank_bit0_15(9), GPIOC_bit_bit0_15(9), GPIO_OUTPUT_MODE);//set CM_PWDN1 output
#elif (BL_CTL==BL_CTL_PWM)
int pwm_div=0; //pwm_freq=24M/(pwm_div+1)/PWM_MAX
WRITE_MPEG_REG(PWM_PWM_D, (PWM_MAX<<16) | (0<<0)); //set pwm duty 100%
WRITE_MPEG_REG(PWM_MISC_REG_CD, READ_MPEG_REG(PWM_MISC_REG_CD) | ((1 << 23) | (pwm_div<<16) | (1<<1))); //set pwm clk & enable pwm
WRITE_MPEG_REG(PERIPHS_PIN_MUX_2, READ_MPEG_REG(PERIPHS_PIN_MUX_2) | (1<<3)); //enable pwm pinmux
#endif
msleep(100);
printk("\n\npower_on_backlight.\n\n");
}
开发者ID:CoreTech-Development,项目名称:buildroot-linux-kernel-m3,代码行数:25,代码来源:HV070WSA_100.c
示例19: set_usb_b_vbus_power
static void set_usb_b_vbus_power(char is_power_on)
{ /*wifi rtl8188cus power control*/
#define USB_B_POW_GPIO GPIOC_bank_bit0_15(5)
#define USB_B_POW_GPIO_BIT GPIOC_bit_bit0_15(5)
#define USB_B_POW_GPIO_BIT_ON 1
#define USB_B_POW_GPIO_BIT_OFF 0
if(is_power_on) {
printk(KERN_INFO "set usb b port power on (board gpio %d)!\n",USB_B_POW_GPIO_BIT);
set_gpio_mode(USB_B_POW_GPIO, USB_B_POW_GPIO_BIT, GPIO_OUTPUT_MODE);
set_gpio_val(USB_B_POW_GPIO, USB_B_POW_GPIO_BIT, USB_B_POW_GPIO_BIT_ON);
} else {
printk(KERN_INFO "set usb b port power off (board gpio %d)!\n",USB_B_POW_GPIO_BIT);
set_gpio_mode(USB_B_POW_GPIO, USB_B_POW_GPIO_BIT, GPIO_OUTPUT_MODE);
set_gpio_val(USB_B_POW_GPIO, USB_B_POW_GPIO_BIT, USB_B_POW_GPIO_BIT_OFF);
}
}
开发者ID:Sophrinix,项目名称:Meson-3-Kernel,代码行数:16,代码来源:board-m3-reff16.c
示例20: power_on_backlight
void power_on_backlight(void)
{
//BL_PWM -> GPIOA_7: 1
msleep(200);
#if 0
set_gpio_val(GPIOA_bank_bit(7), GPIOA_bit_bit0_14(7), 1);
set_gpio_mode(GPIOA_bank_bit(7), GPIOA_bit_bit0_14(7), GPIO_OUTPUT_MODE);
#else
msleep(100);
SET_CBUS_REG_MASK(PWM_MISC_REG_AB, (1 << 0));
msleep(100);
SET_CBUS_REG_MASK(PERIPHS_PIN_MUX_2, (1<<31));
//BL_PWM -> GPIOD_18: 1
set_gpio_val(GPIOD_bank_bit2_24(18), GPIOD_bit_bit2_24(18), 1);
set_gpio_mode(GPIOD_bank_bit2_24(18), GPIOD_bit_bit2_24(18), GPIO_OUTPUT_MODE);
#endif
}
开发者ID:Doxlon,项目名称:buildroot-uboot,代码行数:17,代码来源:lcd.c
注:本文中的set_gpio_val函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论