飛行派工作日誌《十二》

據知樹莓派的設計理念盡可能保持軟硬體之『相容性』︰

向下相容

向下相容(downward compatibility),又稱回溯相容(backward compatibility)、回溯相容,在電腦中指在一個程式硬體更新到較新版本後,用舊版本程式建立的文件或系統仍能被正常操作或使用(包括輸入資料)、在舊版本庫的基礎上開發的程式仍能正常編譯執行,或較舊版的硬體仍可在新版使用的情況。

Backward compatibility

Backward compatibility is a property of a system, product, or technology that allows for interoperability with an older legacy system, or with input designed for such a system, especially in telecommunications and computing. Backward compatibility is sometimes abbreviated to BC, or called downward compatibility.[1] Modifying a system in a way that does not allow backward compatibility is sometimes called “breaking” backward compatibility.[2] A complementary concept is forward compatibility, which is a design philosophy, usually based on open standards, that strives for methods that will continue to work with newer and future products. Design that is forward-compatible usually has a roadmap for compatibility with future standards and products.[3]

 

然則實務上,即使

Multi Camera Adapter Module for Raspberry Pi

 

就像個簡單 CSI 匯流排選擇器︰

Pin Configuration

DIP switches are used here for easy stack up configuration. When only one multi camera adapter board is used, the switches 1and 5 should be switched to ON position. If two multi camera adapter boards are used, the downside board should be switched 1 and 5 to ON and upside board should be switched 2 and 6 to ON position, and if 3 or 4 multi camera adapter boards are used together each board layer should be configured as the Table 1 shown.

Table 1 Pin Configuration

Operation

For proper operation, only one camera should be enabled at a time. In case of only one multi camera adapter board is used, driving Pin12 HIGH and driving Pin11 , Pin7 to LOW to enable camera A on the adapter board. Enable camera B, C and D, please refer the Table 2 for camera selection configuration. To disable all cameras on one adapter board, Enable 1 and Enable 2 signals should be toggled HIGH. Care should be taken that it is not allowed to drive the Enable 1 and Enable 2 LOW at the same time. When connecting more than two multi camera adapter boards, only one of the cameras can be enabled by enabling the desired camera on one adapter board, and disable all the cameras on the rest of adapter boards.

Table 2 Camera Selection Configuration

Camera Selection Configuration Selection Enable 1 Enable 2
A 0 0 1
B 1 0 1
C 0 1 0
D 1 1 0
No Camera X 1 1
Error X 0 0

(X: don’t care)

 

未實測難以決斷哩。

茲將兩個鏡頭接於 A 與 C 埠,一個終端機執行︰

pi@raspberrypi:~ $ python3
Python 3.4.2 (default, Oct 19 2014, 13:31:11) 
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as 出入
>>> 出入.setwarnings(False)
>>> 出入.setmode(出入.BOARD)

# stacking 1 Pin Configuration
>>> 出入.setup(7, 出入.OUT)
>>> 出入.setup(11, 出入.OUT)
>>> 出入.setup(12, 出入.OUT)

# [7,11,12]=[X,1,1] No Camera
>>> 出入.output(11, True)
>>> 出入.output(12, True)
>>> 
# Select Camera A, 執行 raspivid -d
>>> 出入.output(7, False)
>>> 出入.output(11, False)
>>> 出入.output(12, True)
>>> 
# Select Camera C, 執行 raspivid -d
>>> 出入.output(7, False)
>>> 出入.output(11, True)
>>> 出入.output(12, False)
>>>

 

另一終端機執行 raspivid -d ,樹莓派 3B 上 OK 也。