📄 led.sh
字号:
#!/bin/shGPIO_TOOL=/tmp/gpiotool# Led ON and OFFLed_on_off(){ value=$GPIO_TOOL --read 0x40E00024 $GPIO_TOOL --write 0x40E00024 (value | (1<<3)) \ --msleep 200 value=$GPIO_TOOL --read x40E00018 $GPIO_TOOL --write x40E00018 (value | (1<<3)) \ --msleep 200 #D4 value=$GPIO_TOOL --read 0x40E00024 $GPIO_TOOL --write 0x40E00024 (value | (1<<4)) \ --msleep 200 value=$GPIO_TOOL --read 0x40E00018 $GPIO_TOOL --write 0x40E00018 (value | (1<<4)) \ --msleep 200 #D5 value=$GPIO_TOOL --read 0x40E0002C $GPIO_TOOL --write 0x40E0002C (value | (1<<25)) \ --msleep 200 value=$GPIO_TOOL --read 0x40E00020 $GPIO_TOOL --write 0x40E00020 ( value | (1<<25)) \ --msleep 200 #D1 value=$GPIO_TOOL --read 0x40E00124 $GPIO_TOOL --write 0x40E00124 (value | (1<<11)) \ --msleep 200 value=$GPIO_TOOL --read 0x40E00118 $GPIO_TOOL --write 0x40E00118 (value | (1<<11)) \ --msleep 200 #D2 value=$GPIO_TOOL --read 0x40E00124 $GPIO_TOOL --write 0x40E00124 (value | (1<<12)) \ --msleep 200 value=$GPIO_TOOL --read 0x40E00118 $GPIO_TOOL --write 0x40E00118 (value | (1<<12)) \ --msleep 200 #D3 value=$GPIO_TOOL --read 0x40E00124 $GPIO_TOOL --write 0x40E00124 (value |(1<<0)) \ --msleep 200 value=$GPIO_TOOL --read 0x40E00118 $GPIO_TOOL --write 0x40E00118 (value |(1<<0)) \ --msleep 200 #D4 }# D4, D5 in core boardvalue=$GPIO_TOOL --read 0x40E00054 #set GAFR0_Lecho "GAFR0_L value = $value"$GPIO_TOOL --write 0x40E00054 ($value & (~((3<<6) | (3<<8))))value=$GPIO_TOOL --read 0x0E0000C #set GPDR0echo "GPDR0 value = %value"$GPIO_TOOL --write 0x0E0000C ($value | ((1<<3) | (1<<4)))$GPIO_TOOL --write 0x0E0000C ((1<<3) | (1<<4)) #set GPSR0# D1, D2, D3, D4 in device boardvalue=$GPIO_TOOL --read 0x40E00068 #set GAFR2_Uecho "GAFR2_U value = $value"$GPIO_TOOL --write 0x40E00068 ($value &(~(3<<18)))value=$GPIO_TOOL --read 0x40E00014 #set GPDR2echo "GPDR2 value = $value\n"$GPIO_TOOL --write 0x40E00014 ($value | (1<<25))value=$GPIO_TOOL --read 0x40E00020 #set GPSR2echo "GASR2 value = $value\n"$GPIO_TOOL --write 0x40E00020 ($value | (1<<25))value=$GPIO_TOOL --read 0x40E0006C #set GAFR3_Lecho "GAFR3_L value = $value\n"$GPIO_TOOL --write 0x40E0006C ($value & (~ ((3<<0) | (3<<22) | (3<<24))))value=$GPIO_TOOL --read 0x40E0010C #set GPDR3echo "GPDR3 value = $value"$GPIO_TOOL --write 0x40E0010C ($value | ((1<<0) | (1<<11) | (1<<12)))$GPIO_TOOL --write 0x40E0010C ((1<<0) | (1<<11) | (1<<12)) #set GPSR3count=0while [ $count -lt 5 ]do Led_on_off count=`expr $count + 1`done
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -