Tool to recover from an I2C bus lockup on the KL25Z
This tool allows you to recover from an I2C bus lockup on I2C0 (PTE24, PTE25) and I2C1 (PTE0, PTE1).
The reset is only carried out when the corresponding I2C bus is enabled.
Add following code to your program :
#include "I2C_busreset.h" ... ... int main (void) { I2C_busreset(); ....
I2C_busreset.h@0:e9beb537cf77, 2014-02-19 (annotated)
- Committer:
- frankvnk
- Date:
- Wed Feb 19 19:18:49 2014 +0000
- Revision:
- 0:e9beb537cf77
Initial release
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
frankvnk | 0:e9beb537cf77 | 1 | /************************************************************************************************** |
frankvnk | 0:e9beb537cf77 | 2 | ***** ***** |
frankvnk | 0:e9beb537cf77 | 3 | ***** Name: KL25Z I2C_busreset.h ***** |
frankvnk | 0:e9beb537cf77 | 4 | ***** Date: 24/11/2013 ***** |
frankvnk | 0:e9beb537cf77 | 5 | ***** Auth: Frank Vannieuwkerke ***** |
frankvnk | 0:e9beb537cf77 | 6 | ***** Func: library for unblocking I2C bus on KL25Z board ***** |
frankvnk | 0:e9beb537cf77 | 7 | ***** Info: MPL3115A2-AN4481 ***** |
frankvnk | 0:e9beb537cf77 | 8 | **************************************************************************************************/ |
frankvnk | 0:e9beb537cf77 | 9 | |
frankvnk | 0:e9beb537cf77 | 10 | #include "mbed.h" |
frankvnk | 0:e9beb537cf77 | 11 | |
frankvnk | 0:e9beb537cf77 | 12 | #ifndef KL25Z_I2C_RES_H |
frankvnk | 0:e9beb537cf77 | 13 | #define KL25Z_I2C_RES_H |
frankvnk | 0:e9beb537cf77 | 14 | |
frankvnk | 0:e9beb537cf77 | 15 | void I2C_busreset(void); |
frankvnk | 0:e9beb537cf77 | 16 | |
frankvnk | 0:e9beb537cf77 | 17 | #endif |