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 ...
随机推荐
- Hadoop DistributedCache使用案例
背景 公司数据处理具有两个计算框架,单机框架和MR框架.眼下我已经抽象出一套API interface, 供业务计算开发者使用. 并分别在两个计算框架下实现了API的运行调度.应用开发者有时间须要通过 ...
- linux中用anaconda使用不同版本python
1.使用命令conda create --name python36 python=3.6 #你想使用哪个版本就下载哪个版本,--name后面跟的是该虚拟环境的名称 2.需要使用python3.6时 ...
- 嵌入式驱动开发之---dm8127 中sensor 驱动的改变
#IPNC_DEVICE := DM385IPNC_DEVICE := DM812x # Values are "LOW_POWER" and "FULL_FEATURE ...
- Spring3+ibatis (SQL Server)+pager-taglib.tld查询分页的实现
pager-taglib分页開始~ 查了好多关于分页的技术,终于选定下面方法实现~ 1.首先下载jar包:pager-taglib.jar,pager-taglib.jar放在WEB-INF/lib文 ...
- 百度AI的语音合成,语音识别
1,语音的合成,识别 后端代码: from aip import AipSpeech, AipNlp import os # 语音合成 """ 你的 APPID AK S ...
- C项目实践--图书管理系统(3)
接下来将要实现用户管理模块的相关功能,用户管理模块的主要功能包括增加用户,查找用户以及保存用户等功能,查找用户时,如果查找成功,充许对查找到用户进行更新或删除操作.如果查找不成功,则给出相应的提示信息 ...
- Delphi的函数指针
不求全面,先留个爪: TNotifyEvent = procedure(Sender: TObject) of object; TMethod = record Code, Data: Pointer ...
- 【剑指offer】面试题42:单词翻转顺序&左右旋转字符串
这里尽可能的不去用语言本身提供的函数. 将string逆置 def reverse(string): #return string[::-1] reversedStr = '' for i in xr ...
- 设计模式-(8)外观(swift版)
一,概念 为子系统中的一组接口提供一个统一的接口.外观模式定义了一个更高层次的接口,这个接口使得这一子系统更加容易使用. 二,结构图 (1)SubSystem子系统类:每个子系统定义了相关功能和模块的 ...
- mysql 系统函数
SELECT VERSION() -- 获取 mysql版本号 SELECT CONNECTION_ID() -- 查看服务启动后 用户的连接次数 SELECT DATABASE(),SCHEMA() ...