UART to I2C master(s) converter, targetting to emulate SC18IM700(NXP) chip

Dependencies:   mbed

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

LPC1768

LPC11U35

Quote:

LPC11U35 implement requires importing USBDevice library to use USBSerial class

visit https://github.com/K4zuki/tinyI2C for more information

Committer:
k4zuki
Date:
Tue Aug 30 16:30:55 2016 +0000
Revision:
42:da85c17ea495
Child:
76:fcbc456010e0
add headers and settings.h to switch 11U3x/824/1768; 11U3x requires to add USBSerial library in project

Who changed what in which revision?

UserRevisionLine numberNew contents of line
k4zuki 42:da85c17ea495 1 /*
k4zuki 42:da85c17ea495 2 tinyI2C_1768.h
k4zuki 42:da85c17ea495 3 */
k4zuki 42:da85c17ea495 4
k4zuki 42:da85c17ea495 5 static const uint8_t chip_id = ID_LPC1768;
k4zuki 42:da85c17ea495 6
k4zuki 42:da85c17ea495 7 #define isI2C1 // unused(always enabled)
k4zuki 42:da85c17ea495 8 I2C dev1( p9, p10 );
k4zuki 42:da85c17ea495 9
k4zuki 42:da85c17ea495 10 #define isI2C2
k4zuki 42:da85c17ea495 11 I2C dev2(p28, p27);
k4zuki 42:da85c17ea495 12 #undef isI2C3
k4zuki 42:da85c17ea495 13 #undef isI2C4
k4zuki 42:da85c17ea495 14
k4zuki 42:da85c17ea495 15 #define isUART
k4zuki 42:da85c17ea495 16 #undef isUSBUART
k4zuki 42:da85c17ea495 17 Serial pc(USBTX,USBRX);
k4zuki 42:da85c17ea495 18
k4zuki 42:da85c17ea495 19 #define isHWSPI
k4zuki 42:da85c17ea495 20 #undef isSWSPI
k4zuki 42:da85c17ea495 21 SPI _spi(p5, p6, p7); // mosi, miso, sclk
k4zuki 42:da85c17ea495 22 DigitalOut _cs(p8); // CS
k4zuki 42:da85c17ea495 23
k4zuki 42:da85c17ea495 24 #define isGPIO0 // unused(always enabled)
k4zuki 42:da85c17ea495 25 DigitalInOut _GPIO00(p11);
k4zuki 42:da85c17ea495 26 DigitalInOut _GPIO01(p12);
k4zuki 42:da85c17ea495 27 DigitalInOut _GPIO02(p13);
k4zuki 42:da85c17ea495 28 DigitalInOut _GPIO03(p14);
k4zuki 42:da85c17ea495 29 DigitalInOut _GPIO04(p15);
k4zuki 42:da85c17ea495 30 DigitalInOut _GPIO05(p16);
k4zuki 42:da85c17ea495 31 DigitalInOut _GPIO06(p17);
k4zuki 42:da85c17ea495 32 DigitalInOut _GPIO07(p18);
k4zuki 42:da85c17ea495 33
k4zuki 42:da85c17ea495 34 #define isGPIO1
k4zuki 42:da85c17ea495 35 DigitalInOut _GPIO10(p19);
k4zuki 42:da85c17ea495 36 DigitalInOut _GPIO11(p20);
k4zuki 42:da85c17ea495 37 DigitalInOut _GPIO12(p21);
k4zuki 42:da85c17ea495 38 DigitalInOut _GPIO13(p22);
k4zuki 42:da85c17ea495 39 DigitalInOut _GPIO14(p23);
k4zuki 42:da85c17ea495 40 DigitalInOut _GPIO15(p24);
k4zuki 42:da85c17ea495 41 DigitalInOut _GPIO16(p25);
k4zuki 42:da85c17ea495 42 DigitalInOut _GPIO17(p26);
k4zuki 42:da85c17ea495 43