# pepocp2112ctl ** Welcome to pepocp2112ctl Version-0.5 Copyright Isamu.Yamauchi compiled:Feb 15 2022 ** usage:pepocp2112ctl port:0-8 [0|1] [timer:0-300000ms] usage:pepocp2112ctl port:0-3 output, 4-7 input usage:pepocp2112ctl 5 <--AM2320 measured usage:pepocp2112ctl 10 <--BME680 measured 出力ポート 0-3 入力ポート 4-7 に固定されています ポートNo 0番目の読み取り # pepocp2112ctl 0 0 ポートNo 0番目を 1 へ設定 # pepocp2112ctl 0 1 1 ポートNo 0番目を5秒間 1 へ設定 # pepocp2112ctl 0 1 5000 0 I2C接続のAM2320の温度・湿度表示 # pepocp2112ctl 5 23.0 55.4 入出力力ポート同時読み取り、上位4bit入力、下位4bit出力 # pepocp2112ctl 8 f0 結構早い時間でUSB接続GPIOを動作させることが出来ます # time pepocp2112ctl 0 0 real 0m0.010s user 0m0.005s sys 0m0.000s # time pepocp2112ctl 0 1 1 real 0m0.009s user 0m0.000s sys 0m0.005s # time pepocp2112ctl 5 23.0 54.6 real 0m0.266s user 0m0.000s sys 0m0.004s I2C接続BME680の温度、湿度、気圧、ガス(オーム)連続ファイル出力 # cat /www/remote-hand/tmp/.pepocp2112bme680 2022/02/16/17:17:00,16.1,51.5,1012.8,1309408 pepocp2112ctlはsemaphoreを使い排他制御しています、以下コマンドでapacheと共に使用時間が確認出来ます # ipcs -t ------ Message Queues Send/Recv/Change Times -------- msqid owner send recv change ------ Shared Memory Attach/Detach/Change Times -------- shmid owner attached detached changed 23953408 lightdm Jan 28 18:27:10 Jan 28 18:27:10 Jan 28 18:27:08 23986177 lightdm Jan 28 18:27:11 Not set Jan 28 18:27:11 ------ Semaphore Operation/Change Times -------- semid owner last-op last-changed 19628032 www-data Wed Feb 16 17:51:41 2022 Tue Feb 15 18:38:56 2022 19595265 root Wed Feb 16 17:51:45 2022 Tue Feb 15 17:46:05 2022 # ipcs ------ Message Queues -------- key msqid owner perms used-bytes messages ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x00000000 23953408 lightdm 600 524288 2 dest 0x00000000 23986177 lightdm 600 33554432 2 dest ------ Semaphore Arrays -------- key semid owner perms nsems 0x00000000 19628032 www-data 600 1 0x531600bc 19595265 root 666 1
動作例動画
https://twitter.com/kujiranodanna/status/965173068044828672
download
https://osdn.net/projects/pepolinux/downloads/69544/pepocp2112ctl.tar.gz/
製品情報
詳細情報
https://jp.silabs.com/products/interface/usb-bridges/classic-usb-bridges/device.cp2112
[PageInfo]
LastUpdate: 2022-02-16 18:24:22, ModifiedBy: pepolinux
[License]
GNU Free Documentation License
[Permissions]
view:all, edit:doc editors, delete/config:doc editors