过去的2023
已至岁末,回顾自己过去的这一年,还算平静。没有了野外研发的孤独落寞,也不用为凌晨发版本而焦虑,有了更多的时间做自己的事。
虽说是平静的一年,倒也发生了许多的事情。年初的某件事,改变了自己的生活节奏。“同心一人去,坐觉长安空”这种伤感持续了很久,让自己有种“摆烂”的状态。吃了很多外卖,做饭也变得很少了,没啥意思的生活。音乐节与新裤子,也没让我狂热起来,可能只有电玩城推币机闪光的时候,才能带来那么一丝刺激。期间很开心又认了一大哥,一个特别乐观和友善的人。
这一年,“人工智能”,“大模型”很火。由于经常逛国外网站,我算是接触ChatGPT比较早,平常也使用这类工具提升效率。起初带给我的是惊讶,随着深入了解,更多的是对未来的思考与不安。
平静的现状下,命运齿轮一直在转。由于AI的进步,许多国外顶尖公司都在进行改革,优化不少人,沿海地区也出现同样的情况。这是一个大趋势,也许在未来的几年,生活习惯都有可能被AI改变。
我一直有在想,“未来技术会不会代替人类?”直到前面和人去吃过一次饭,中间我问“服务员”,她穿着正式,谈吐得体。“为什么你们店里不能扫码点单,还用菜单呢?”她回答:“来这一般都是谈商务 ...
Linux驱动--音频耳机
音频驱动本文档以 es8388 驱动为例。
电路原理es8388 电路设计:
es8388 支持多种输入模式,可以直通输入也可以差分输入,这个需要针对实际情况对芯片寄存器进行配置。以上LIN1和RLIN1是直通,连接耳机。LIN2和RLIN2是差分输入,连接板载麦克风。
设备树分析声音卡配置
12345678910111213141516171819202122232425262728293031323334353637es8388_sound: es8388-sound { status = "okay"; compatible = "rockchip,multicodecs-card"; rockchip,card-name = "rockchip-es8388"; hp-det-gpio = <&gpio1 RK_PC4 GPIO_ACTIVE_HIGH>; io-channels = <&saradc 3>; io-channel-names = "adc- ...
Linux系统--增加adbd服务
安装adb工具网上有很多教程,ubuntu下直接执行以下命令即可
1sudo apt-get install adb
但是这只是用来调试设备,ubuntu下默认是没有adbd服务的,如何让它本身被识别成一个adb设备,用来调试,本文是介绍如何在ubuntu下增加adbd服务,已通过平板调试。
adbd 服务adb 是一个基于 Linux 的命令行工具,用于调试 Android 设备。本文主要介绍如何在 Linux 系统中增加 adbd 服务。
下载adbd二进制文件以下为安装所需文件地址链接: https://pan.baidu.com/s/148rt2Ud8EV-XPKh5M2NN6w 提取码: z2u5
解压文件至桌面执行以下命令
123456sudo cp ./adbd.sh /etc/init.d/sudo cp ./.usb_config /etc/init.d/sudo cp adbd /usr/local/bin/sudo cp adbd.service /lib/systemd/system/
创建开机启动服务链接在/etc/systemd/ ...
数据库---mongoDB基本使用
mongoDB使用数据格式示例:
12345{title: 'MongoDB 教程', tags: ['mongodb', 'database', 'NoSQL'], likes: 100}
使用{}包裹,每个键值对用逗号分隔,最后一个键值对后不能有逗号。字符串用’’包裹,数字不用,数组用[]包裹,可以为字符串数组。
数据库管理
显示数据库
1234> show dbsleanote 0.078GBlocal 0.078GB
创建数据库
123# 不存在则创建,否则切换到指定数据库use 数据库名
删除数据库
1db.dropDatabase()
集合管理集合就是 MongoDB 中最小的单位,类似关系型数据库中表的概念。
显示集合
123> show collections或者> show tables
创建集合
1234db.createCollection(name, options) // 集合名字,options可选或者db. ...
Linux命令--时间相关命令
时间相关指令用于终端时间设置
查看当前系统时间状态
12345678910timedatectl status输出示例: Local time: Tue 2023-03-14 15:10:24 CST Universal time: Tue 2023-03-14 07:10:24 UTC RTC time: Tue 2023-03-14 07:10:23 Time zone: Asia/Shanghai (CST, +0800) System clock synchronized: nosystemd-timesyncd.service active: yes RTC in local TZ: no
时区
1234// 列出时区timedatectl list-timezones// 修改时区timedatectl set-timezone "Asia/Shangha ...
Linux驱动--WIFI驱动-RTL8723BU
WIFI 驱动场景需求:适配基于RK3568芯片,适配一款USB 蓝牙模块
型号选用:RTL8723bu最后字母代表工作方式,“S”为SDIO,“P”为pcie,“U”则为usb
代码环境:rk3568 Android SDK
根据实验,蓝牙功能基于wifi驱动正确加载才能正常启动,故不可以仅添加蓝牙代码,还需要增加WiFi驱动代码。
驱动代码拿到 名为“RTL8723BU_xxx.zip”驱动适配文件并解压
kernel 部分USB wifi模块,添加驱动代码后,wifi和蓝牙工作不受内核dts控制。
编译文件修改目录下的device/rockchip/rk356x/wifi_bt.mk
12BOARD_CONNECTIVITY_VENDOR := RealTekBOARD_CONNECTIVITY_MODULE := rtl8723bu
代码添加WiFi 代码:
解压查看“/driver/rtl8723bu”目录,放入或者替换SDK中 “/kernel/driver/net/wireless ...
Linux工具--调试工具
Linux 调试工具工作需要,调试过程中需要很多调试工具检测硬件或者软件功能,这里把常用的调试工具汇总
通讯协议调试工具:
uart 调试minicom
安装
1sudo apt install minicom
使用
123456789# 运行minicom 并配置minicom -s选择进入“Serial port setup” 配置串口,比特率选择“Save setup as dfl” 保存为默认配置,后续直接运行“minicom” 就能直接加载# 退出ctrl +A +Z
i2c调试i2c-tool
安装
12sudo apt-get install i2c-tools
使用root 用户下使用1234567891011# 显示所有可用的I2C总线i2cdetect -l # 查看i2c-1总线下的设备i2cdetect -y 1 # 往i2c-1 0x36(设备地址) 地址写 3byte 数据 后接数据i2ctransfer -f -y 1 w3@0x36 0x00 0x01 0x02# 往i2c-1 0x36(设备地址) 寄存器地址0x0001 读3 b ...
shell--基本语法
shell基本语法常用指令cat打印到标准输出设备上
grep查找文件里符合条件的字符串或正则表达式
awkawk 是一个文本处理工具
curl请求web服务工具
sed文本处理工具wc行统计工具
shell中可以 使用linux下各种工具不一一举例
运算语句赋值赋值和其他语言一样,使用“=”
12345678910# 数字a=1 # 字符串name='aaa'或name=“aaa”#路径PACK_TOOL_DIR=/linux/Linux_Pack_Firmware
运算符号运算符号不能单独使用,需要配合运算命令
1234+ 加 -减 *乘 /除 % → 取余** → 开方
数学计算shell 数学计算的几种命令,搭配上文运算符使用整数运算
123456789# exprexpr 1 + 1# letlet a=100/3;echo $a# $(())echo $(( 100*3 ))
浮点数运算
12345# bc scale 为保留几位小数,可以不设置,默认是0 echo "scale=2;100/3"|bc=> ...