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 ...
随机推荐
- xgboost python windows编译问题
1.作为kaggle上非常火的机器学习包xgboost,windows python包安装起来真的非常麻烦,安装了一整天才成功. 2.请先下载xgboost-master,csdn上有资源的,能够在这 ...
- Chapter1-data access reloaded:Entity Framework(下)
1.4 Delving deep into object/relational differences 深入挖掘对象关系的不同 理解面向对象和关系世界的不同是重要的,因为他会影响你设计一个对象模型或者 ...
- MySql安装与使用图文教程
2.下载完成后将其解压到你想要安装的路径下,例如我的解压到D:\MySql\mysql-5.7.12-winx64\路径下,刚解压完应该是下图这些文件夹:最好解压到根目录. 5.新建一个my.in ...
- 文件上传Apache
Map<String, Object> rtnMap = new HashMap<String, Object>(); // 获取文件 String tempPath = re ...
- O(n²)、O(n)、O(1)、O(nlogn)
大体上和 @丁戍 说的差不多. 简单说O(n²)表示当n很大的时候,复杂度约等于Cn²,C是某个常数,简单说就是当n足够大的时候,n的线性增长,复杂度将沿平方增长. O(n)也是差不多的意思,也就是说 ...
- POJ3692 Kindergarten —— 二分图最大团
题目链接:http://poj.org/problem?id=3692 Kindergarten Time Limit: 2000MS Memory Limit: 65536K Total Sub ...
- JSP 与 ACTION 之间的跳转
<script language="javascript">function delconfirm(url){ if(confirm("你确定要删除本条数据吗 ...
- 【monkey】
在Android文件系统中的存放路径是:/system/framework/monkey.jarMonkey.jar 程序是由一个名为“monkey”的Shell脚本来启动执行,shell脚本在And ...
- js bind es5函数柯里化
绑定函数 bind()最简单的用法是创建一个函数,使这个函数不论怎么调用都有同样的this值.常见的错误就像上面的例子一样,将方法从对象中拿出来,然后调用,并且希望this指向原来的对象. 如果不做特 ...
- Gym 100531D Digits (暴力)
题意:给定一个数字,问你找 n 个数,使得这 n 个数各位数字之和都相等,并且和最小. 析:暴力,去枚举和是 1 2 3...,然后去选择最小的. 代码如下: #pragma comment(link ...