RK3288-ANDROID8.1-电源指示灯

一,电源上电灯

                                                       没有控制,上电即亮

二,系统闪烁灯

 GPIO6_A6是对应的GPIO

别眨眼,好戏开场了~

 

 gpios_led_status这个名称注册

对应驱动内获取这个值

void out_poweron_sec_to_mcu(unsigned int sec){
int  i;
int temp=sec;
printk("sec=%x \n",sec);
gpio_direction_output(gpios_led_status, 1);
for(i=0;i<9;i++){
gpio_direction_output(gpios_led_status, 0);
mdelay(16);
gpio_direction_output(gpios_led_status, 1);
mdelay(16);
}
for(i=0;i<32;i++){
if(temp&(1<<(31-i))) {
gpio_direction_output(gpios_led_status, 0);
mdelay(12);
gpio_direction_output(gpios_led_status, 1);
mdelay(12);
}
else {
gpio_direction_output(gpios_led_status, 0);
mdelay(8);
gpio_direction_output(gpios_led_status, 1);
mdelay(8);
}
temp>>1;
}
temp=~temp;
//printk("temp2=%x \n",temp);
for(i=0;i<32;i++){
if(temp&(1<<(31-i))) {
//printk("out 1\n");
gpio_direction_output(gpios_led_status, 0);
mdelay(12);
gpio_direction_output(gpios_led_status, 1);
mdelay(12);
}
else {
gpio_direction_output(gpios_led_status, 0);
mdelay(8);
gpio_direction_output(gpios_led_status, 1);
mdelay(8);
}
temp>>1;	
}
gpio_direction_output(gpios_led_status, 0);
mdelay(1);
gpio_direction_output(gpios_led_stat
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
以下是一份针对RK3288-EVB-Android SDK的DTS文件修改示例,可以实现SD卡启动: ``` /dts-v1/; /plugin/; / { model = "Rockchip RK3288-EVB board"; compatible = "rockchip,rk3288-evb"; memory@60000000 { device_type = "memory"; reg = <0x60000000 0x40000000>; }; chosen { bootargs = "console=ttyS2,115200n8 root=/dev/mmcblk1p2 rw rootwait earlyprintk"; stdout-path = &uart2; }; uart2: serial@11004000 { compatible = "rockchip,rk3288-uart", "snps,dw-apb-uart"; reg = <0x11004000 0x1000>; interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>; clocks = <&uart2_clk>; clock-names = "uartclk"; status = "okay"; }; sdhci@11014000 { compatible = "rockchip,rk3288-dw-mshc"; reg = <0x11014000 0x1000>; interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cru SCLK_SDMMC>, <&cru PCLK_SDMMC>; clock-names = "sdmmc", "apb_pclk"; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4 &sdmmc_bus8 &sdmmc_cd_n>; status = "okay"; mmc-slot@0 { reg = <0>; bus-width = <8>; cd-gpios = <&gpio7 3 GPIO_ACTIVE_LOW>; non-removable; status = "okay"; }; }; &dpu { status = "okay"; }; &lcdc { status = "okay"; }; &backlight { status = "okay"; }; &act8846_reg { status = "okay"; }; &i2c1 { status = "okay"; act8846: act8846@5b { compatible = "active-semi,act8846"; reg = <0x5b>; gpio-controller; #gpio-cells = <2>; interrupt-parent = <&gpio2>; interrupts = <6 IRQ_TYPE_LEVEL_LOW>; status = "okay"; }; }; &mmc { status = "okay"; }; &mmc1 { status = "okay"; }; &mmc2 { status = "okay"; }; &mmc3 { status = "okay"; }; &mmc4 { status = "okay"; }; &sdmmc_clk { rockchip,pins = <RK_GPIO3 8 RK_FUNC_2 &pcfg_pull_none>; }; &sdmmc_cmd { rockchip,pins = <RK_GPIO3 9 RK_FUNC_2 &pcfg_pull_none>; }; &sdmmc_bus4 { rockchip,pins = <RK_GPIO3 10 RK_FUNC_2 &pcfg_pull_none>; }; &sdmmc_bus8 { rockchip,pins = <RK_GPIO3 11 RK_FUNC_2 &pcfg_pull_none>; }; &sdmmc_cd_n { rockchip,pins = <RK_GPIO7 3 RK_FUNC_GPIO &pcfg_pull_up>; }; }; ``` 此外,你还需要在编译内核时加入SD卡启动相关的配置选项。具体方法可以参考RK3288-Android SDK的文档。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

旋风旋风

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值