单片机功能说明:
在此,我将单片机的一些功能放在这里,哪里有不合适的,希望大家指出。
功能说明:
上电启动流程:
在设备第一次上电时,包含插入电池和插入typeC。
因为插入typeC后,5306直接输出5V。所以直接开机操作。
单片机控制一系列进行上电开机操作。
首先将SOC处于复位状态,
将LCD背光处于关闭状态,
将CH_USB转至HUB位置,使typeC只连接到CH340E
操作PWRKEY5306脚,进行单击,开机操作。
然后执行LCD初始化,并将背光打开。
将SOC复位,进行启动。
离线
测试wifi。
由于原来编译的内核丢了,所以。
出现了如下画面:
root@dika-pc:~# insmod esp8089-spi.ko
[ 100.338733] esp8089_spi: loading out-of-tree module taints kernel.
[ 100.354129] esp8089_spi: Unknown symbol ieee80211_stop_tx_ba_session (err -2)
[ 100.362176] esp8089_spi: Unknown symbol ieee80211_start_tx_ba_cb_irqsafe (err -2)
[ 100.370582] esp8089_spi: Unknown symbol ieee80211_free_hw (err -2)
[ 100.377478] esp8089_spi: Unknown symbol ieee80211_start_tx_ba_session (err -2 )
[ 100.385390] esp8089_spi: Unknown symbol ieee80211_register_hw (err -2)
[ 100.392687] esp8089_spi: Unknown symbol ieee80211_get_buffered_bc (err -2)
[ 100.400330] esp8089_spi: Unknown symbol wiphy_rfkill_set_hw_state (err -2)
[ 100.407942] esp8089_spi: Unknown symbol ieee80211_stop_tx_ba_cb_irqsafe (err -2)
[ 100.416192] esp8089_spi: Unknown symbol ieee80211_remain_on_channel_expired ( err -2)
[ 100.424674] esp8089_spi: Unknown symbol ieee80211_wake_queues (err -2)
[ 100.431931] esp8089_spi: Unknown symbol ieee80211_alloc_hw_nm (err -2)
[ 100.439192] esp8089_spi: Unknown symbol ieee80211_tx_status (err -2)
[ 100.446214] esp8089_spi: Unknown symbol ieee80211_ready_on_channel (err -2)
[ 100.453801] esp8089_spi: Unknown symbol ieee80211_stop_queues (err -2)
[ 100.461036] esp8089_spi: Unknown symbol wiphy_rfkill_start_polling (err -2)
[ 100.468717] esp8089_spi: Unknown symbol ieee80211_scan_completed (err -2)
[ 100.476257] esp8089_spi: Unknown symbol ieee80211_unregister_hw (err -2)
[ 100.483570] esp8089_spi: Unknown symbol ieee80211_beacon_get_tim (err -2)
[ 100.491063] esp8089_spi: Unknown symbol ieee80211_hdrlen (err -2)
[ 100.497814] esp8089_spi: Unknown symbol ieee80211_queue_work (err -2)
[ 100.504897] esp8089_spi: Unknown symbol ieee80211_rx_napi (err -2)
insmod: ERROR: could not insert module esp8089-spi.ko: Unknown symbol in module
root@dika-pc:~#
我需要重新确定到底勾选哪个配置
离线
但是我的debian是什么鬼
systemd[1]: Set hostname to <dika-pc>.
[ 6.520524] systemd[1]: File /lib/systemd/system/systemd-journald.service:12 configures an IP firewall (IPAddre ssDeny=any), but the local system does not support BPF/cgroup based firewalling.
[ 6.613146] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loa ded unit using IP firewalling.)
[ 8.007412] systemd[1]: Failed to allocate notification socket: Address family not supported by protocol
[!!!!!!] Failed to start up manager.
[ 8.180889] systemd[1]: Freezing execution.
[ 79.130392] random: crng init done
离线
测试板载WIFI成功
root@dika-pc:/etc# ping www.dika.ren 3
PING www.dika.ren (149.129.80.46) 56(84) bytes of data.
64 bytes from 149.129.80.46 (149.129.80.46): icmp_seq=1 ttl=47 time=67.9 ms
64 bytes from 149.129.80.46 (149.129.80.46): icmp_seq=2 ttl=47 time=98.4 ms
64 bytes from 149.129.80.46 (149.129.80.46): icmp_seq=3 ttl=47 time=76.8 ms
64 bytes from 149.129.80.46 (149.129.80.46): icmp_seq=4 ttl=47 time=80.6 ms
^C
--- www.dika.ren ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 18ms
rtt min/avg/max/mdev = 67.855/80.913/98.383/11.106 ms
root@dika-pc:/etc#
离线
# while [ 1 ]; do
> data;wget ftp://192.168.43.1:3721/Downloads/DKTool_0229.rar -O /dev/null ;data
;
> done;
本想用wget试试速度,
结果没有wget。
好吧,下载一个
apt-get install wget
root@dika-pc:~# free
total used free shared buff/cache available
Mem: 56204 16808 7320 2216 32076 32980
Swap: 524284 0 524284
root@dika-pc:~# apt-get install wget
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libpcre2-8-0
The following NEW packages will be installed:
libpcre2-8-0 wget
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1062 kB of archives.
After this operation, 3821 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.huaweicloud.com/debian buster/main armel libpcre2-8-0 armel 10.32-5 [185 kB]
Get:2 http://mirrors.huaweicloud.com/debian buster/main armel wget armel 1.20.1-1.1 [878 kB]
Fetched 1062 kB in 8s (127 kB/s)
Selecting previously unselected package libpcre2-8-0:armel.
(Reading database ... 21447 files and directories currently installed.)
Preparing to unpack .../libpcre2-8-0_10.32-5_armel.deb ...
Unpacking libpcre2-8-0:armel (10.32-5) ...
Selecting previously unselected package wget.
Preparing to unpack .../wget_1.20.1-1.1_armel.deb ...
Unpacking wget (1.20.1-1.1) ...
Setting up libpcre2-8-0:armel (10.32-5) ...
Setting up wget (1.20.1-1.1) ...
Processing triggers for libc-bin (2.28-10) ...
root@dika-pc:~#
离线
测试了一下客厅路由器到厨房,12米距离,速度依旧
root@dika-pc:~# wget ftp://172.16.1.104:3721/Downloads/ViE.zip -O /dev/null
--2020-06-11 23:56:39-- ftp://172.16.1.104:3721/Downloads/ViE.zip
=> ‘/dev/null’
Connecting to 172.16.1.104:3721... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD (1) /Downloads ... done.
==> SIZE ViE.zip ... 280209081
==> PASV ... done. ==> RETR ViE.zip ... done.
Length: 280209081 (267M) (unauthoritative)
ViE.zip 60%[===========> ] 160.66M 1020KB/s eta 2m 2s
离线
离线
关于电容触摸部分,今天测了一下,
也看了看我自己的电路。
电容触摸屏无需初始化,上电就能用,点屏幕就会触发CTP中断。
我打算把F1C200S唯一一个中断脚PE12留给CTP使用,
N76E003不给中断了,
因为N76E003的功能如下:
1、控制液晶屏的背光,默认的上电就亮,还有可配置成F1C去I2C控制它亮,可设置PWM值。
2、编码器功能,编码器分上转,下转,按下,再细分一些连续转,多次按下,长按等操作。存储在单片机内部。F1C通过I2C去读状态,读后清空,超时覆盖清空。还有强制开机关机等操作。
3、接收上位机控制的CH340的烧写信号交互,将F1C复位到fel模式。
4、初始化LCD屏,I2C可设置LCD屏的180度旋转显示
5、切换USB连接位置,将HUB给F1C还是给PC。可I2C控制
6、复位CTP,LCD,CAMERA的RST脚
有什么建议希望大家提一下
离线
https://blog.csdn.net/xukai871105/article/details/18273653
这是pcf8574操作方法
我再找找,如何使用中断
最近编辑记录 迪卡 (2020-06-23 13:26:39)
离线
http://blog.mangolovecarrot.net/2018/10/24/51/
关于N76E003使用串口烧写程序。
考虑更改电路,将CH340即可以给F1C200S下载程序也可以给单片机下载程序。但好像复位会麻烦一些。
离线
离线
非常感谢,我有个问题,
如下操作中,我能看的明白,gpiochip504就是将pcf8574驱动编进内核后的效果,
我想知道这个504编号是怎么来的呢?
soc自带的gpio是从A B C D这样排下来的,我会计算出PB12就是1*32+12 = 44
不懂504是来自哪里,我看驱动源码中也没有这个数字。
还是要再感谢一下
[armadillo ~]# ls /sys/class/gpio/
export gpiochip128 gpiochip504 gpiochip96
gpiochip0 gpiochip32 gpiochip64 unexport
[armadillo ~]# echo 504 > /sys/class/gpio/export
[armadillo ~]# echo 505 > /sys/class/gpio/export
[armadillo ~]# echo 506 > /sys/class/gpio/export
[armadillo ~]# echo 507 > /sys/class/gpio/export
[armadillo ~]# echo 508 > /sys/class/gpio/export
[armadillo ~]# echo 509 > /sys/class/gpio/export
[armadillo ~]# echo 510 > /sys/class/gpio/export
[armadillo ~]# echo 511 > /sys/class/gpio/export
离线
研究了一下怎么给N76E003分配引脚,因为实在是太紧缺了
考虑将ICP占用1个脚,烧录进BootLoader之后就用串口下载程序了。
3个脚,ICP烧录的DAT CLK RST,占用一个DAT脚用来切换UART
2个脚,I2C接口
1个脚,CH_USB 用来切换USB
1个脚,SOC_RESET 用来复位F1C200S
1个脚,PWR_5306,用来控制供电
3个脚,A B SW 编码器
3个脚,LCD_SDA LCD_SCL LCD_CS 其中 LCD_SDA在初始化屏完毕后做输入脚,接受CH340E的RTS状态
2个脚,UART 用来烧录单片机程序
1个脚,CH340CTS SDnand_OR_TF 监控TF卡插入状态,若未插入TF卡,则可以复位SOC到FEL模式,可以与PC做交互
1个脚,LCD_PWM 屏幕的背光
2个脚,VDD和GND
共20个脚
这样应该就可以了。。。
关于USB接口切换,切换的模式是,SOC的USB作为从接到HUB上,HUB给PC用, 另一个是SOC的USB作为主接到HUB上,HUB给SOC用。
同时USBTTL模块始终都是给PC用的。
关于UART接口切换,切换的模式是,USBTTL接到SOC还是N76E003,是调试SOC用,还是烧写N76E003用。
关于电源控制部分,不知道大家有啥好的建议没有,PWR_5306脚我现在是开漏输出串电阻接到了IP5306的KEY脚,通过输出0来模拟按键按下的操作,可实现单击或双击,进而控制IP5306的输出和关闭。
但是我发现了个问题,IP5306关闭状态并不是绝对关闭,还有很低的电压,当电流大于45mA时,就自动打开输出。
我可以操作关闭屏幕背关等,让电流小于45mA使得IP5306不开启,但是还是有几十毫安的电流输出。
我考虑是不是不控制IP5306了,去控制一个MOS管给EA3036的供电。毕竟5V只是接到了EA3036和USB接口。
离线
按照https://whycan.cn/t_2041.html第13楼的补丁,将对应的文件进行替换和更改,包括设备树,都直接复制的
并在内核配置中,开启了以下部分。
设备树如下
.dtsi文件
dma: dma-controller@1c02000 {
compatible = "allwinner,suniv-dma";
reg = <0x01c02000 0x1000>;
interrupts = <18>;
clocks = <&ccu CLK_BUS_DMA>;
resets = <&ccu RST_BUS_DMA>;
#dma-cells = <2>;
};
codec: codec@1c23c00 {
compatible = "allwinner,suniv-codec";
reg = <0x01c23c00 0x400>;
interrupts = <21>;
clocks = <&ccu CLK_BUS_CODEC>,
<&ccu CLK_CODEC>;
clock-names = "apb", "codec";
resets = <&ccu RST_BUS_CODEC>;
dmas = <&dma 0 12>, <&dma 0 12>;
dma-names = "rx", "tx";
status = "disabled";
};
.dst文件
&codec {
allwinner,audio-routing =
"Headphone", "HP",
"Headphone", "HPCOM",
"MIC", "Mic";
status = "okay";
};
离线
root@dika-pc:~# ./tinymix controls
Number of controls: 97
ctl type num name
0 INT 1 PCM Rate Shift 100000
1 BOOL 1 PCM Notify
2 BOOL 1 PCM Slave Active
3 INT 1 PCM Slave Format
4 INT 1 PCM Slave Rate
5 INT 1 PCM Slave Channels
6 INT 1 PCM Rate Shift 100000
7 BOOL 1 PCM Notify
8 BOOL 1 PCM Slave Active
9 INT 1 PCM Slave Format
10 INT 1 PCM Slave Rate
11 INT 1 PCM Slave Channels
12 INT 1 PCM Rate Shift 100000
13 BOOL 1 PCM Notify
14 BOOL 1 PCM Slave Active
15 INT 1 PCM Slave Format
16 INT 1 PCM Slave Rate
17 INT 1 PCM Slave Channels
18 INT 1 PCM Rate Shift 100000
19 BOOL 1 PCM Notify
20 BOOL 1 PCM Slave Active
21 INT 1 PCM Slave Format
22 INT 1 PCM Slave Rate
23 INT 1 PCM Slave Channels
24 INT 1 PCM Rate Shift 100000
25 BOOL 1 PCM Notify
26 BOOL 1 PCM Slave Active
27 INT 1 PCM Slave Format
28 INT 1 PCM Slave Rate
29 INT 1 PCM Slave Channels
30 INT 1 PCM Rate Shift 100000
31 BOOL 1 PCM Notify
32 BOOL 1 PCM Slave Active
33 INT 1 PCM Slave Format
34 INT 1 PCM Slave Rate
35 INT 1 PCM Slave Channels
36 INT 1 PCM Rate Shift 100000
37 BOOL 1 PCM Notify
38 BOOL 1 PCM Slave Active
39 INT 1 PCM Slave Format
40 INT 1 PCM Slave Rate
41 INT 1 PCM Slave Channels
42 INT 1 PCM Rate Shift 100000
43 BOOL 1 PCM Notify
44 BOOL 1 PCM Slave Active
45 INT 1 PCM Slave Format
46 INT 1 PCM Slave Rate
47 INT 1 PCM Slave Channels
48 INT 1 PCM Rate Shift 100000
49 BOOL 1 PCM Notify
50 BOOL 1 PCM Slave Active
51 INT 1 PCM Slave Format
52 INT 1 PCM Slave Rate
53 INT 1 PCM Slave Channels
54 INT 1 PCM Rate Shift 100000
55 BOOL 1 PCM Notify
56 BOOL 1 PCM Slave Active
57 INT 1 PCM Slave Format
58 INT 1 PCM Slave Rate
59 INT 1 PCM Slave Channels
60 INT 1 PCM Rate Shift 100000
61 BOOL 1 PCM Notify
62 BOOL 1 PCM Slave Active
63 INT 1 PCM Slave Format
64 INT 1 PCM Slave Rate
65 INT 1 PCM Slave Channels
66 INT 1 PCM Rate Shift 100000
67 BOOL 1 PCM Notify
68 BOOL 1 PCM Slave Active
69 INT 1 PCM Slave Format
70 INT 1 PCM Slave Rate
71 INT 1 PCM Slave Channels
72 INT 1 PCM Rate Shift 100000
73 BOOL 1 PCM Notify
74 BOOL 1 PCM Slave Active
75 INT 1 PCM Slave Format
76 INT 1 PCM Slave Rate
77 INT 1 PCM Slave Channels
78 INT 1 PCM Rate Shift 100000
79 BOOL 1 PCM Notify
80 BOOL 1 PCM Slave Active
81 INT 1 PCM Slave Format
82 INT 1 PCM Slave Rate
83 INT 1 PCM Slave Channels
84 INT 1 PCM Rate Shift 100000
85 BOOL 1 PCM Notify
86 BOOL 1 PCM Slave Active
87 INT 1 PCM Slave Format
88 INT 1 PCM Slave Rate
89 INT 1 PCM Slave Channels
90 INT 1 PCM Rate Shift 100000
91 BOOL 1 PCM Notify
92 BOOL 1 PCM Slave Active
93 INT 1 PCM Slave Format
94 INT 1 PCM Slave Rate
95 INT 1 PCM Slave Channels
96 INT 2 PCM Playback Volume
离线
root@dika-pc:~# ./tinymix contents
Number of controls: 97
ctl type num name value
0 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
1 BOOL 1 PCM Notify On
2 BOOL 1 PCM Slave Active Off
3 INT 1 PCM Slave Format 2 (range 0->52)
4 INT 1 PCM Slave Rate 48000 (range 0->192000)
5 INT 1 PCM Slave Channels 2 (range 1->1024)
6 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
7 BOOL 1 PCM Notify On
8 BOOL 1 PCM Slave Active Off
9 INT 1 PCM Slave Format 2 (range 0->52)
10 INT 1 PCM Slave Rate 48000 (range 0->192000)
11 INT 1 PCM Slave Channels 2 (range 1->1024)
12 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
13 BOOL 1 PCM Notify On
14 BOOL 1 PCM Slave Active Off
15 INT 1 PCM Slave Format 2 (range 0->52)
16 INT 1 PCM Slave Rate 48000 (range 0->192000)
17 INT 1 PCM Slave Channels 2 (range 1->1024)
18 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
19 BOOL 1 PCM Notify On
20 BOOL 1 PCM Slave Active Off
21 INT 1 PCM Slave Format 2 (range 0->52)
22 INT 1 PCM Slave Rate 48000 (range 0->192000)
23 INT 1 PCM Slave Channels 2 (range 1->1024)
24 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
25 BOOL 1 PCM Notify On
26 BOOL 1 PCM Slave Active Off
27 INT 1 PCM Slave Format 2 (range 0->52)
28 INT 1 PCM Slave Rate 48000 (range 0->192000)
29 INT 1 PCM Slave Channels 2 (range 1->1024)
30 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
31 BOOL 1 PCM Notify On
32 BOOL 1 PCM Slave Active Off
33 INT 1 PCM Slave Format 2 (range 0->52)
34 INT 1 PCM Slave Rate 48000 (range 0->192000)
35 INT 1 PCM Slave Channels 2 (range 1->1024)
36 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
37 BOOL 1 PCM Notify On
38 BOOL 1 PCM Slave Active Off
39 INT 1 PCM Slave Format 2 (range 0->52)
40 INT 1 PCM Slave Rate 48000 (range 0->192000)
41 INT 1 PCM Slave Channels 2 (range 1->1024)
42 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
43 BOOL 1 PCM Notify On
44 BOOL 1 PCM Slave Active Off
45 INT 1 PCM Slave Format 2 (range 0->52)
46 INT 1 PCM Slave Rate 48000 (range 0->192000)
47 INT 1 PCM Slave Channels 2 (range 1->1024)
48 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
49 BOOL 1 PCM Notify On
50 BOOL 1 PCM Slave Active Off
51 INT 1 PCM Slave Format 2 (range 0->52)
52 INT 1 PCM Slave Rate 48000 (range 0->192000)
53 INT 1 PCM Slave Channels 2 (range 1->1024)
54 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
55 BOOL 1 PCM Notify On
56 BOOL 1 PCM Slave Active Off
57 INT 1 PCM Slave Format 2 (range 0->52)
58 INT 1 PCM Slave Rate 48000 (range 0->192000)
59 INT 1 PCM Slave Channels 2 (range 1->1024)
60 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
61 BOOL 1 PCM Notify On
62 BOOL 1 PCM Slave Active Off
63 INT 1 PCM Slave Format 2 (range 0->52)
64 INT 1 PCM Slave Rate 48000 (range 0->192000)
65 INT 1 PCM Slave Channels 2 (range 1->1024)
66 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
67 BOOL 1 PCM Notify On
68 BOOL 1 PCM Slave Active Off
69 INT 1 PCM Slave Format 2 (range 0->52)
70 INT 1 PCM Slave Rate 48000 (range 0->192000)
71 INT 1 PCM Slave Channels 2 (range 1->1024)
72 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
73 BOOL 1 PCM Notify On
74 BOOL 1 PCM Slave Active Off
75 INT 1 PCM Slave Format 2 (range 0->52)
76 INT 1 PCM Slave Rate 48000 (range 0->192000)
77 INT 1 PCM Slave Channels 2 (range 1->1024)
78 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
79 BOOL 1 PCM Notify On
80 BOOL 1 PCM Slave Active Off
81 INT 1 PCM Slave Format 2 (range 0->52)
82 INT 1 PCM Slave Rate 48000 (range 0->192000)
83 INT 1 PCM Slave Channels 2 (range 1->1024)
84 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
85 BOOL 1 PCM Notify On
86 BOOL 1 PCM Slave Active Off
87 INT 1 PCM Slave Format 2 (range 0->52)
88 INT 1 PCM Slave Rate 48000 (range 0->192000)
89 INT 1 PCM Slave Channels 2 (range 1->1024)
90 INT 1 PCM Rate Shift 100000 100000 (range 80000->120000)
91 BOOL 1 PCM Notify On
92 BOOL 1 PCM Slave Active Off
93 INT 1 PCM Slave Format 2 (range 0->52)
94 INT 1 PCM Slave Rate 48000 (range 0->192000)
95 INT 1 PCM Slave Channels 2 (range 1->1024)
96 INT 2 PCM Playback Volume 255, 255 (range 0->255)
root@dika-pc:~#
离线
离线
全网搜,无资料,arecord录音报错,
https://whycan.cn/t_2041.html
这个帖子里的大佬们,你们是怎么能录音的??
我是5.2内核
离线