I2C hang recover function added
Dependencies: UniGraphic mbed vt100
In this version, check_i2c_pins function was added in edge_mgr.cpp.
プログラムの起動時、I2Cモジュールを初期化する前に、I2Cに使用するピンの電位を確認し
もし一方でも Low に張り付いていた場合、SCL を GPIO 出力に設定して
所定回数 (I2C_UNLOCK_TRIAL_CYCLE) 反転させることにより、疑似リセットクロックを生成します。
その後は、通常の起動手順に復帰し、以降はこれまでと同様の動作をします。
afLib/afSPI.h@2:de22987be9ba, 2018-06-18 (annotated)
- Committer:
- gaku_miyagawa
- Date:
- Mon Jun 18 02:55:38 2018 +0000
- Revision:
- 2:de22987be9ba
- Parent:
- 0:d895cd1cd897
SBU SPECIAL
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Rhyme | 0:d895cd1cd897 | 1 | /** |
Rhyme | 0:d895cd1cd897 | 2 | * Copyright 2015 Afero, Inc. |
Rhyme | 0:d895cd1cd897 | 3 | * |
Rhyme | 0:d895cd1cd897 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Rhyme | 0:d895cd1cd897 | 5 | * you may not use this file except in compliance with the License. |
Rhyme | 0:d895cd1cd897 | 6 | * You may obtain a copy of the License at |
Rhyme | 0:d895cd1cd897 | 7 | * |
Rhyme | 0:d895cd1cd897 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Rhyme | 0:d895cd1cd897 | 9 | * |
Rhyme | 0:d895cd1cd897 | 10 | * Unless required by applicable law or agreed to in writing, software |
Rhyme | 0:d895cd1cd897 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
Rhyme | 0:d895cd1cd897 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Rhyme | 0:d895cd1cd897 | 13 | * See the License for the specific language governing permissions and |
Rhyme | 0:d895cd1cd897 | 14 | * limitations under the License. |
Rhyme | 0:d895cd1cd897 | 15 | */ |
Rhyme | 0:d895cd1cd897 | 16 | #ifndef AFLIB_AFSPI_H |
Rhyme | 0:d895cd1cd897 | 17 | #define AFLIB_AFSPI_H |
Rhyme | 0:d895cd1cd897 | 18 | |
Rhyme | 0:d895cd1cd897 | 19 | class afSPI { |
Rhyme | 0:d895cd1cd897 | 20 | public: |
Rhyme | 0:d895cd1cd897 | 21 | virtual void begin() = 0; |
Rhyme | 0:d895cd1cd897 | 22 | virtual void beginSPI() = 0; |
Rhyme | 0:d895cd1cd897 | 23 | virtual void endSPI() = 0; |
Rhyme | 0:d895cd1cd897 | 24 | virtual void transfer(char *bytes,int len) = 0; |
Rhyme | 0:d895cd1cd897 | 25 | }; |
Rhyme | 0:d895cd1cd897 | 26 | |
Rhyme | 0:d895cd1cd897 | 27 | #endif |
Rhyme | 0:d895cd1cd897 | 28 |