Online Store

将树莓派 3 的 Raspbian 配置为将数字逻辑扩展板与 μFR 读取器 RS232 一起使用

将树莓派 3 的 Raspbian 配置为将数字逻辑扩展板与 μFR 读取器 RS232 一起使用 #

前言带 μFR 读卡器 RS232 的数字逻辑扩展板 扩展板是硬件的安宁,用于简化 μFR 读卡器 RS232 设备(如 μFR Nano RS232 和 μFR Classic CS RS232 读卡器型号)与任何树莓派版本之间的互连

 

DLshield 使用 GPIO 接头的引脚 8 (GPIO14) 和 10 (GPIO15) 进行 UART 通信,并使用引脚 16 (GPIO23) 重置 μFR 读取器。 GPIO 串行端口(迷你 UART)默认处于禁用状态。 必须启用才能使设备的全部功能。 uFCoder 库版本 4.2.7 及更高版本支持 Raspbian 上的 DL Shields。

谨慎

RPi 的串行端口(以及所有其他 GPIO)仅以 3.3V 电源运行。 将它们连接到 5V 电源会损坏您的 RPi。

启用 GPIO 串行端口

$sudo rspi-config
  • 更改密码
  • 启用 SSH(SSH >接口选项)
  • 启用串行端口(串行>接口选项)
  • 禁用串行控制台(接口选项>串行)
  • 重新启动

测试

测试 Linux 配置

$ ls -l /dev/serial*lrwxrwxrwx 1 根根 5 十一月 21 07:54 /dev/serial0 -> ttyS0  lrwxrwxrwx 1 根根 7 十一月 21 07:54 /dev/serial1 -> ttyAMA0 $ ls - l /dev/ttyS0 crw-rw----1rootdialout4,64Nov2107:54/dev/ttyS0$groupspiadmDialoutcdromsudoaudiovideoplugdevgamesusersinputnetdevgpioi2cspi$sudo grep uart /boot/cmdline.txt enable_uart=1$ sudo cat /boot/cmdline.txtdwc_otg.lpm_enable=0 console=tty1 root=PARTUUID (nomoreexistsconsole=ttyS0,115200)















测试μFR读取器打开功能GIT 的 DL-GIT 克隆上打开读取器有一个简单的示例代码

$ git clone --recursive
https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-examples-reader_open-c

使可执行文件

$make 阿姆夫

运行

$ ./ufr-reader-open

参考资料:

https://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/

https://www.raspberrypi.org/forums/viewtopic.php?t=151454 https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=144858&p=955297#p955236

https://raspberrypi.stackexchange.com/a/54766

Raspbian OS – 下载

https://www.raspberrypi.org/downloads/raspbian/

测试源代码:

https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-examples-reader_open-c