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) 反転させることにより、疑似リセットクロックを生成します。

その後は、通常の起動手順に復帰し、以降はこれまでと同様の動作をします。

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?

UserRevisionLine numberNew contents of line
Rhyme 0:d895cd1cd897 1 #ifndef _EDGE_TIME_H_
Rhyme 0:d895cd1cd897 2 #define _EDGE_TIME_H_
Rhyme 0:d895cd1cd897 3 #include "mbed.h"
Rhyme 0:d895cd1cd897 4
Rhyme 0:d895cd1cd897 5 void init_timer(void) ;
Rhyme 0:d895cd1cd897 6 void set_time(const uint16_t valueLen, const uint8_t *value) ;
Rhyme 0:d895cd1cd897 7 void ts2time(uint32_t timestamp, struct tm *tm) ; /* light version */
Rhyme 0:d895cd1cd897 8 void ts2tm(uint32_t timestamp, struct tm *date) ; /* full version */
Rhyme 0:d895cd1cd897 9 void print_time(void) ; /* light version */
Rhyme 0:d895cd1cd897 10 void print_time(uint32_t thetime) ;
Rhyme 0:d895cd1cd897 11 void print_time(struct tm *tm) ; /* light version */
Rhyme 0:d895cd1cd897 12 void print_date(struct tm *date) ; /* full version */
Rhyme 0:d895cd1cd897 13 void print_date_wd(struct tm *date) ; /* vull version with day of week */
Rhyme 0:d895cd1cd897 14 void time2str(char *timestr) ; /* light version */
Rhyme 0:d895cd1cd897 15 int32_t time2seq(uint32_t timestamp) ; /* hhmmss */
Rhyme 0:d895cd1cd897 16 void time2seq(uint32_t timestamp, char *timestr) ;
Rhyme 0:d895cd1cd897 17 void time2str(struct tm *tm, char *timestr) ; /* hh:mm:ss */
Rhyme 0:d895cd1cd897 18 void time2date(struct tm *tm, char *datestr) ; /* YYYY/MM/DD hh:mm:ss */
Rhyme 0:d895cd1cd897 19 void time2date(struct tm *tm, char *datestr) ; /* full version with day of week */
Rhyme 0:d895cd1cd897 20
Rhyme 0:d895cd1cd897 21 extern const char *nameOfDay[] ;
Rhyme 0:d895cd1cd897 22 extern tm current_time ;
Rhyme 0:d895cd1cd897 23 extern uint32_t edge_time ;
Rhyme 0:d895cd1cd897 24 extern uint32_t utc_offset ;
Rhyme 0:d895cd1cd897 25 #endif /* _EDGE_TIME_H_ */