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 ...
随机推荐
- 原生js 平滑滚动到页面的某个位置
window.scrollTo() 语法1: window.scrollTo(x-coord,y-coord) x-coord 是文档中的横轴坐标. y-coord 是文档中的纵轴坐标. 例子: w ...
- 如何使用jQuery向asp.net Mvc传递复杂json数据
jQuery提供的ajax方法能很方便的实现客户端与服务器的异步交互,在asp.net mvc 框架使用jQuery能很方便地异步获取提交数据,给用户提供更好的体验! 调用jQuery的ajax方法时 ...
- ExtJs 中获取 radiobutton 的值
ExtJs中使用radiobutton,想在ExtJs本身代码中(注意,不是在后台喔)获取 radioButton 的值,居然发现很难,无从下手的感觉.后来在网上寻寻觅觅,痛苦摸索之后,真是大跌眼镜. ...
- lineage 世系 血缘 容错机制 DAG
当某个RDD的部分数据丢失时候,Saprk会根据记录的世系关系找到该RDD的父RDD以及更上级的RDD.只需要将该RDD依赖的上级RDD重新计算就可以将该RDD进行恢复. Directed Acycl ...
- 设备没有可用空间 /var/spool/clientmqueue sendmail
[root@hadoop3 /]# crontab -e/tmp/crontab.TB7A7w: 设备上没有空间[root@hadoop3 /]# df -Bg文件系统 1G-块 已用 可用 已用% ...
- YTU 1010: 目标柏林
1010: 目标柏林 时间限制: 1000 Sec 内存限制: 64 MB 提交: 32 解决: 15 题目描述 1945年初,苏军和英美联军已从东西两面攻入德国国境. 4月初,在苏军和英美联军的 ...
- BZOJ_3105_[cqoi2013]新Nim游戏_线性基+博弈论
BZOJ_3105_[cqoi2013]新Nim游戏_线性基+博弈论 Description 传统的Nim游戏是这样的:有一些火柴堆,每堆都有若干根火柴(不同堆的火柴数量可以不同).两个游戏者轮流操作 ...
- HDU4642博弈好题
链接:http://acm.hdu.edu.cn/ 两个人进行翻棋游戏,若a[n][m]为1,则不管先手就可以翻a[n][m]使其为0,这样不管后手翻什么都会使得a[n][m]为1,先手总是有棋可翻: ...
- appium学习【三】:截图时,图片命令中包含当前的函数名,以区分错误是在哪个函数报的
import sys funcName = sys._getframe().f_back.f_code.co_name #获取调用函数名 print sys._getframe().f_code.co ...
- FZU 2020 组合 (Lucas定理)
题意:中文题. 析:直接运用Lucas定理即可.但是FZU好奇怪啊,我开个常数都CE,弄的工CE了十几次,在vj上还不显示. 代码如下: #pragma comment(linker, "/ ...