Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Homepage
Code URL¶
https://os.mbed.com/users/mbed_crane_elec/code/Airio-Base_SD_power_test/
Airio-Baseで SDカード電源のON/OFF制御をするサンプルコードです。
準備¶
- FlashAirをSDカードソケットへ接続
SWスイッチ動作¶
LED2が点灯し、カードへの電源供給を開始(ON)します。
ISPスイッチ動作¶
LED2が消灯し、カードへの電源供給を停止(OFF)します。
コードについて¶
Airio-Baseのポート番号P1_16は、SDカードソケットの電源制御用のIC(AP2281)に接続されています。 これは、サンプルコード
DigitalOut sd_en(P1_16, 0);//SD card power on/off control port. and OFF default.
で定義されており、出力デジタルポートでHigh/LowがON/OFFに相当しSDカードへの電源供給を制御します。
FlashAirの電源確認¶
LED2点灯時に、スマートフォンなどからFlashAirにアクセスできることを確認して下さい。 また、LED2消灯時は、FlashAirにアクセスできないことを確認して下さい。
このカード電源の制御機能は、バッテリー駆動用途などの消費電力を抑える必要がある場合に有効です。