501在全志r16平台tinav3.0系统下调通pwm1的10KHZ波形
501在全志r16平台tinav3.0系统下调通pwm1的10KHZ波形
2018/10/19 19:52
版本:V1.0
开发板:SC3817R
SDK:tina v3.0
1、01原始编译全志r16平台tinav3.0系统:
rootroot@cm88:~$ cd /home/wwt
rootroot@cm88:/home/wwt$
rootroot@cm88:~$ cd /home/wwt
rootroot@cm88:/home/wwt$
rootroot@cm88:/home/wwt$
rootroot@cm88:/home/wwt$ md5sum tina_v3.0_20180606_1711git.tar.gz
ebf7ea460473f13a7f64248ed61cf998 tina_v3.0_20180606_1711git.tar.gz
rootroot@cm88:/home/wwt$
rootroot@cm88:/home/wwt$ tar zxvf tina_v3.0_20180606_1711git.tar.gz
rootroot@cm88:/home/wwt$
rootroot@cm88:/home/wwt$ cd tina_v3.0/
rootroot@cm88:/home/wwt/tina_v3.0$
rootroot@cm88:/home/wwt/tina_v3.0$
rootroot@cm88:/home/wwt/tina_v3.0$ source build/envsetup.sh
(请严重注意:lunch之后的选项是环境依赖的,请选择astar_parrot-tina前的实际数值!)
rootroot@cm88:/home/wwt/tina_v3.0$ lunch
You're building on Linux
Lunch menu... pick a combo:
5. astar_parrot-tina
Which would you like?5
rootroot@cm88:/home/wwt/tina_v3.0$ make -j12
rootroot@cm88:/home/wwt/tina_v3.0$ pack -d
2、在内核中打开PWM:
(已经默认选中了)
rootroot@cm88:/home/wwt/tina_v3.0$ make kernel_menuconfig
Device Drivers --->
[*] Pulse-Width Modulation (PWM) Support --->
--- Pulse-Width Modulation (PWM) Support
<*> sunxi pwm support
相关驱动文件在这里:
W:\tina_v3.0\lichee\linux-3.4\drivers\pwm\core.c
W:\tina_v3.0\lichee\linux-3.4\drivers\pwm\pwm-sunxi.c
刷机之后可见,没有输出PWM波形的驱动!
root@TinaLinux:/#
root@TinaLinux:/# find . -name pwm*
./sys/kernel/debug/pwm
root@TinaLinux:/#
root@TinaLinux:/sys/kernel/debug#
root@TinaLinux:/sys/kernel/debug# ll
drwxr-xr-x 24 root root 0 Jan 1 08:00 .
drwxr-xr-x 9 root root 0 Jan 1 08:29 ..
drwxr-xr-x 3 root root 0 Jan 1 08:00 asoc
drwxr-xr-x 2 root root 0 Jan 1 08:29 axpdbg
drwxr-xr-x 16 root root 0 Jan 1 08:00 bdi
drwxr-xr-x 2 root root 0 Jan 1 08:00 bluetooth
drwxr-xr-x 2 root root 0 Jan 1 08:29 ccudbg
drwxr-xr-x 6 root root 0 Jan 1 08:29 clk
drwxr-xr-x 2 root root 0 Jan 1 08:29 cpufreq
drwxr-xr-x 2 root root 0 Jan 1 08:29 ddrfreq
drwxr-xr-x 2 root root 0 Jan 1 08:00 extfrag
-r--r--r-- 1 root root 0 Jan 1 08:00 gpio
drwxr-xr-x 2 root root 0 Jan 1 08:00 hid
drwxr-xr-x 2 root root 0 Jan 1 08:00 hotplug
drwxr-xr-x 2 root root 0 Jan 1 08:00 ieee80211
drwxr-xr-x 2 root root 0 Jan 1 08:00 ion
drwxr-xr-x 8 root root 0 Jan 1 08:29 mali
drwxr-xr-x 2 root root 0 Jan 1 08:00 memblock
drwxr-xr-x 2 root root 0 Jan 1 08:00 mmc0
drwxr-xr-x 4 root root 0 Jan 1 08:00 pinctrl
-r--r--r-- 1 root root 0 Jan 1 08:00 pwm
drwxr-xr-x 2 root root 0 Jan 1 08:00 regmap
drwxr-xr-x 23 root root 0 Jan 1 08:00 regulator
-rw-r--r-- 1 root root 0 Jan 1 08:00 shrinker
drwxr-xr-x 2 root root 0 Jan 1 08:00 sunxi_pinctrl
drwxr-xr-x 2 root root 0 Jan 1 08:00 sunxi_soc_info
-r--r--r-- 1 root root 0 Jan 1 08:00 suspend_stats
-rwxr-xr-x 1 root root 0 Jan 1 08:00 suspend_time
-r--r--r-- 1 root root 0 Jan 1 08:00 sync
drwxr-xr-x 2 root root 0 Jan 1 08:00 usb
-r--r--r-- 1 root root 0 Jan 1 08:00 wakeup_sources
root@TinaLinux:/sys/kernel/debug#
root@TinaLinux:/sys/kernel/debug#
(可见)
root@TinaLinux:/sys/kernel/debug#
root@TinaLinux:/sys/kernel/debug# cat pwm
platform/sunxi_pwm, 2 PWM devices
pwm-0 ((null) ):
pwm-1 (lcd ): requested enabled
root@TinaLinux:/sys/kernel/debug#
(tina v3.0.2中内置:)
W:\tina_v3.0\lichee\linux-3.4\drivers\misc\leds\Kconfig
W:\tina_v3.0\lichee\linux-3.4\drivers\misc\leds\Makefile
W:\tina_v3.0\lichee\linux-3.4\drivers\misc\leds\pwm_leds.c
W:\tina_v3.0\lichee\linux-3.4\drivers\misc\Makefile
obj-y += leds/
W:\tina_v3.0\lichee\linux-3.4\drivers\misc\Kconfig
source "drivers/misc/c2port/Kconfig"
source "drivers/misc/eeprom/Kconfig"
source "drivers/misc/cb710/Kconfig"
source "drivers/misc/iwmc3200top/Kconfig"
source "drivers/misc/ti-st/Kconfig"
source "drivers/misc/lis3lv02d/Kconfig"
source "drivers/misc/carma/Kconfig"
source "drivers/misc/altera-stapl/Kconfig"
source "drivers/misc/sw_3g_module/Kconfig"
source "drivers/misc/rf_pm/Kconfig"
source "drivers/misc/sunxi-clk-prepare/Kconfig"
source "drivers/misc/leds/Kconfig"
endmenu
rootroot@cm88:/home/wwt/tina_v3.0$ make kernel_menuconfig
Device Drivers --->
Misc devices --->
(在最后面,默认选中的)
<M> LEDs by PWM Control driver (NEW)
rootroot@cm88:/home/wwt/tina_v3.0$ make -j12
STMicroeletronics LIS3LV02Dx three-axis digital accelerometer (SPI) (SENSORS_LIS3_SPI) [N/m/y/?] n
STMicroeletronics LIS3LV02Dx three-axis digital accelerometer (I2C) (SENSORS_LIS3_I2C) [N/m/y/?] n
*
* Altera FPGA firmware download module
*
Altera FPGA firmware download module (ALTERA_STAPL) [N/m/y/?] n
Allwinner rf module pm driver (AW_RF_PM) [Y/n/?] y
LEDs by PWM Control driver (MISC_PWM_LEDS) [M/n/y/?] (NEW) y
刷机之后可见:
(通过ADB可见PWM1打开了)
root@TinaLinux:/# cd /sys/class/sunxi_dump
cd /sys/class/sunxi_dump
root@TinaLinux:/sys/class/sunxi_dump#
root@TinaLinux:/sys/class/sunxi_dump# ll
ll
drwxr-xr-x 2 root root 0 Jan 1 08:29 .
drwxr-xr-x 48 root root 0 Jan 1 08:29 ..
-rw-r--r-- 1 root root 4096 Jan 1 08:29 compare
-rw-r--r-- 1 root root 4096 Jan 1 08:29 dump
-rw-r--r-- 1 root root 4096 Jan 1 08:29 write
root@TinaLinux:/sys/class/sunxi_dump#
root@TinaLinux:/sys/class/sunxi_dump#
root@TinaLinux:/sys/class/sunxi_dump# echo 0x01C208FC > dump;cat dump
echo 0x01C208FC > dump;cat dump
0x77222227
root@TinaLinux:/#
root@TinaLinux:/# find . -name pwm*
./sys/devices/virtual/misc/misc_dev/pwm_leds
./sys/kernel/debug/pwm
root@TinaLinux:/#
root@TinaLinux:/# cd /sys/kernel/debug
root@TinaLinux:/sys/kernel/debug# cat pwm
platform/sunxi_pwm, 2 PWM devices
pwm-0 (led_red ): requested
pwm-1 (led_blue ): requested enabled
root@TinaLinux:/sys/kernel/debug#
root@TinaLinux:/#
root@TinaLinux:/# cd /sys/devices/virtual/misc/misc_dev/pwm_leds
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds# ll
drwxr-xr-x 2 root root 0 Jan 1 08:30 .
drwxr-xr-x 4 root root 0 Jan 1 08:29 ..
-rw-rw-r-- 1 root root 4096 Jan 1 08:30 blue_func
-rw-rw-r-- 1 root root 4096 Jan 1 08:30 red_func
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds# cat blue_func
[ 367.939811] **** wyb drivers/misc/leds/pwm_leds.c-245-get_blue_func
9
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
1默认值为9频率416.7HZ
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds# echo 0 > blue_func
[ 387.486088] **** wyb drivers/misc/leds/pwm_leds.c-255-set_blue_func
[ 387.498988] pwm_id = 1,>>>function = 0+++
[ 387.505686] **** wyb drivers/misc/leds/pwm_leds.c-65-set_pwm
[ 387.523484] **** wyb drivers/misc/leds/pwm_leds.c-74-set_pwm
[ 387.529991] **** wyb drivers/misc/leds/pwm_leds.c-300-set_blue_func
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds# cat blue_func
[ 505.578676] **** wyb drivers/misc/leds/pwm_leds.c-245-get_blue_func
0
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
配置值为0频率10KHZ最暗
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds# echo 1 > blue_func
[ 512.697534] **** wyb drivers/misc/leds/pwm_leds.c-255-set_blue_func
[ 512.709935] pwm_id = 1,>>>function = 1+++
[ 512.716597] **** wyb drivers/misc/leds/pwm_leds.c-65-set_pwm
[ 512.726517] **** wyb drivers/misc/leds/pwm_leds.c-74-set_pwm
[ 512.735989] **** wyb drivers/misc/leds/pwm_leds.c-300-set_blue_func
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds# cat blue_func
[ 578.443656] **** wyb drivers/misc/leds/pwm_leds.c-245-get_blue_func
1
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
配置值为1频率10KHZ中等亮度
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds# echo 2 > blue_func [ 607.022921] **** wyb drivers/misc/leds/pwm_leds.c-255-set_blue_func
[ 607.037085] pwm_id = 1,>>>function = 2+++
[ 607.043501] **** wyb drivers/misc/leds/pwm_leds.c-65-set_pwm
[ 607.053190] **** wyb drivers/misc/leds/pwm_leds.c-74-set_pwm
[ 607.064587] **** wyb drivers/misc/leds/pwm_leds.c-300-set_blue_func
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds# echo 2 > blue_func
[ 662.857794] **** wyb drivers/misc/leds/pwm_leds.c-255-set_blue_func
[ 662.870006] pwm_id = 1,>>>function = 2+++
[ 662.877317] **** wyb drivers/misc/leds/pwm_leds.c-65-set_pwm
[ 662.890735] **** wyb drivers/misc/leds/pwm_leds.c-74-set_pwm
[ 662.898948] **** wyb drivers/misc/leds/pwm_leds.c-300-set_blue_func
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds# cat blue_func
[ 674.138688] **** wyb drivers/misc/leds/pwm_leds.c-245-get_blue_func
2
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
配置为值为2频率10KHZ最高亮度:
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds#
(有兴趣的可以看看:)
root@TinaLinux:/sys/devices/virtual/misc/misc_dev/pwm_leds# cd ..
root@TinaLinux:/sys/devices/virtual/misc/misc_dev#
root@TinaLinux:/sys/devices/virtual/misc/misc_dev#
root@TinaLinux:/sys/devices/virtual/misc/misc_dev# ll
drwxr-xr-x 4 root root 0 Jan 1 08:29 .
drwxr-xr-x 22 root root 0 Jan 1 08:29 ..
-r--r--r-- 1 root root 4096 Jan 1 08:29 dev
drwxr-xr-x 2 root root 0 Jan 1 08:30 power
drwxr-xr-x 2 root root 0 Jan 1 08:30 pwm_leds
lrwxrwxrwx 1 root root 0 Jan 1 08:30 subsystem -> ../../../../class/misc
-rw-r--r-- 1 root root 4096 Jan 1 08:29 uevent
root@TinaLinux:/sys/devices/virtual/misc/misc_dev#
501在全志r16平台tinav3.0系统下调通pwm1的10KHZ波形的更多相关文章
- 461在全志r16平台tinav3.0系统下使用地磁计QMC5883L
461在全志r16平台tinav3.0系统下使用地磁计QMC5883L 2018/9/7 14:08 版本:V1.0 开发板:SC3817R SDK:tina v3.0 (基本确认全志tina v3. ...
- 460在全志r16平台tinav3.0系统下使用i2c-tools
460在全志r16平台tinav3.0系统下使用i2c-tools 2018/9/6 19:05 版本:V1.0 开发板:SC3817R SDK:tina v3.0 1.01原始编译全志r16平台ti ...
- 009全志R16平台tinav3.0下编译不过的问题
009全志R16平台tinav3.0下编译不过的问题 2018/11/13 11:39 版本:V1.0 开发板:SC3817R SDK:tina v3.0 1.01原始编译全志r16平台tinav3. ...
- 001原始编译全志r6平台tinav3.0.2系统
001原始编译全志r6平台tinav3.0.2系统 2018/6/8 11:32 版本:V1.0 开发板:R6 SDK:tina v3.0.2 1.01原始编译全志r16平台tinav3.0系统: r ...
- 全志tina v3.0系统编译时的时间错误的解决(全志SDK的维护BUG)
全志tina v3.0系统编译时的时间错误的解决(全志SDK的维护BUG) 2018/6/13 15:52 版本:V1.0 开发板:SC3817R SDK:tina v3.0 1.01原始编译全志r1 ...
- 深入浅出-Android系统移植与平台开发(一)- Android4.0系统的下载与编译
作者:唐老师,华清远见嵌入式学院讲师. 一.Android4.0系统的下载与编译 Android系统的下载与编译,Google的官方网站上已经给出了详细的说明,请参照Android的官方网址: htt ...
- SNF快速开发平台3.0之--系统里广播的作用--迅速及时、简明扼要的把信息发送给接收者
广播信息,即速度快捷.迅速及时.简明扼要的把信息发送给接收者. 当然在SNF快速开发平台上你也可以作为公告使用.不管当做什么使用要满足以下需求: 简单操作:页面操作简单 只需要输入内容就可以发送. 灵 ...
- 31全志r58平台Android4.4.2下打开USB摄像头
31全志r58平台Android4.4.2下打开USB摄像头 2018/10/26 16:00 版本:V1.0 开发板:SC5806 1.系统编译:(略) 2.需要修改的文件: W:\r58_andr ...
- 02全志r58平台Android4.4.4下关闭内核中的CPU的开启关闭提示
02全志r58平台Android4.4.4下关闭内核中的CPU的开启关闭提示 2017/8/18 13:53 版本:V1.0 开发板:SC5806(全志R58平台) SDK:android4.4.4 ...
随机推荐
- 【iOS系列】- UITableView的使用技巧
[iOS系列]- UITableView的使用 UITableView的常用属性 indexpath.row:行 indexpath.section:组 separatorColor:分割线的颜色 s ...
- Hackrank Candies DP
题目链接:传送门 题意: n个学生站一行,老师给每个学生发至少一个糖 相邻学生,a[i] > a[i-1] 的话,那么右边学生的糖一定要发得比左边学生的糖多 问你满足条件这个老师总共最少的发多少 ...
- Ant 打包 问题
Ant 打包问题及解决归纳总结: 1.build.xml注意设置basedir: <project name="s2si" default="dist" ...
- (5)在tomcat运行自己的javaweb项目
A:在MyEclipse下方的Servers栏中启动服务器,运行项目: 1,选中项目所在的tomcat服务器 2,点击“启动按钮”,见下图 3,启动以后,看控制台输出日志: B:从服务器按钮启动: 1 ...
- HDU4185 Oil Skimming —— 最大匹配
题目链接:https://vjudge.net/problem/HDU-4185 Oil Skimming Time Limit: 2000/1000 MS (Java/Others) Memo ...
- POJ1177 Picture —— 求矩形并的周长 线段树 + 扫描线 + 离散化
题目链接:https://vjudge.net/problem/POJ-1177 A number of rectangular posters, photographs and other pict ...
- YTU 2906: 多重继承 日期与时间
2906: 多重继承 日期与时间 时间限制: 1 Sec 内存限制: 128 MB 提交: 240 解决: 190 题目描述 在空缺的地方补全代码,只需提交补全部分即可 请用C++方式提交 #in ...
- Watir: element_by_xpath 的使用
b =Watir::IE.new b.goto'http://www.google.com/' txt =b.element_by_xpath("//*[@name='q']") ...
- Python 函数定义以及参数传递
Python 函数定义以及参数传递1.函数定义#形如def func(args...): doSomething123以关键字def 开头,后面是函数名和参数下面是函数处理过程. 举例: def ad ...
- bzoj1798 1
1798: [Ahoi2009]Seq 维护序列seq Time Limit: 30 Sec Memory Limit: 64 MBSubmit: 5866 Solved: 2079[Submit ...