UART to I2C master(s) converter, targetting to emulate SC18IM700(NXP) chip
UART to I2C master(s) converter, targetting to emulate SC18IM700(NXP) chip
Features
up to 4x I2C master
- for LPC824 implement, we can use up to 4 channels of I2C masters
- 1x Fm+ and 3x Fm I2C channels
- for LPC1768 implement, we can use up to 2 channels of I2C masters
- 2x Fm I2C channels
- for LPC11U35 implement, only one channel for I2C master,
but program uses USB CDC class for UART communication (means no external USB-Serial converter chip)
- 1x Fm+ I2C channels
1x SPI master
up to 2x 8bit GPIO
Tested Platforms
LPC824
- https://developer.mbed.org/platforms/Switch-Science-mbed-LPC824/
- https://developer.mbed.org/platforms/LPCXpresso824-MAX/
LPC1768
LPC11U35
Quote:
LPC11U35 implement requires importing USBDevice library to use USBSerial class
visit https://github.com/K4zuki/tinyI2C for more information
settings.h@0:b597ed665b76, 2016-08-30 (annotated)
- Committer:
- k4zuki
- Date:
- Tue Aug 30 18:31:12 2016 +0000
- Revision:
- 0:b597ed665b76
- Child:
- 36:ffbd9829c8d1
restart from empty
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
k4zuki | 0:b597ed665b76 | 1 | /* |
k4zuki | 0:b597ed665b76 | 2 | settings.h |
k4zuki | 0:b597ed665b76 | 3 | */ |
k4zuki | 0:b597ed665b76 | 4 | |
k4zuki | 0:b597ed665b76 | 5 | // #define isI2C1 // unused(always enabled) |
k4zuki | 0:b597ed665b76 | 6 | // #define isGPIO0 // unused(always enabled) |
k4zuki | 0:b597ed665b76 | 7 | |
k4zuki | 0:b597ed665b76 | 8 | enum chipID_e { |
k4zuki | 0:b597ed665b76 | 9 | ID_LPC824 = '0', |
k4zuki | 0:b597ed665b76 | 10 | ID_LPC1768 = '1', |
k4zuki | 0:b597ed665b76 | 11 | ID_LPC11UXX = '2', |
k4zuki | 0:b597ed665b76 | 12 | }; |
k4zuki | 0:b597ed665b76 | 13 | |
k4zuki | 0:b597ed665b76 | 14 | #if defined(TARGET_SSCI824) || defined(TARGET_LPC824) |
k4zuki | 0:b597ed665b76 | 15 | #warning "tinyI2C_824.h" |
k4zuki | 0:b597ed665b76 | 16 | #include "tinyI2C_824.h" |
k4zuki | 0:b597ed665b76 | 17 | |
k4zuki | 0:b597ed665b76 | 18 | #elif defined(TARGET_LPC11U35_501) || defined(TARGET_LPC11U35_401) |
k4zuki | 0:b597ed665b76 | 19 | |
k4zuki | 0:b597ed665b76 | 20 | #warning "import USBDevice library" |
k4zuki | 0:b597ed665b76 | 21 | #include "tinyI2C_11U3x.h" |
k4zuki | 0:b597ed665b76 | 22 | |
k4zuki | 0:b597ed665b76 | 23 | #elif defined(TARGET_LPC1768) |
k4zuki | 0:b597ed665b76 | 24 | |
k4zuki | 0:b597ed665b76 | 25 | #warning "tinyI2C_1768.h" |
k4zuki | 0:b597ed665b76 | 26 | #include "tinyI2C_1768.h" |
k4zuki | 0:b597ed665b76 | 27 | |
k4zuki | 0:b597ed665b76 | 28 | #endif |
k4zuki | 0:b597ed665b76 | 29 | |
k4zuki | 0:b597ed665b76 | 30 |