This Automatic mode is the most simple lib for MCU Gear with LPC1114FN28. You don't need to think about Bank.
Dependents: MCUGearALPC1114FN28
Fork of MCUGearA by
Revision 3:69b10f9cdd14, committed 2014-05-06
- Comitter:
- Info
- Date:
- Tue May 06 15:53:05 2014 +0000
- Parent:
- 2:aa2e471e8317
- Commit message:
- Added command; void clear(void); It can clear saved IO setting.
Changed in this revision
diff -r aa2e471e8317 -r 69b10f9cdd14 MCUGearALPC1114.cpp --- a/MCUGearALPC1114.cpp Sat May 03 17:09:14 2014 +0000 +++ b/MCUGearALPC1114.cpp Tue May 06 15:53:05 2014 +0000 @@ -27,7 +27,7 @@ MCUGear::MCUGear(PinName scl, PinName sda, char addr) : _i2c(scl, sda) { - //_i2c.frequency(FPGA_I2C_CLOCK); + _i2c.frequency(FPGA_I2C_CLOCK); _addr = addr; //save address write(0xff); //close Module gate _counter = 0; @@ -98,6 +98,9 @@ fpga_write(0x10,_bank);//init regist/////// } +void MCUGear::clear(void){ + _counter = 0; +} //send I2C signal function void MCUGear::write(uint8_t c){
diff -r aa2e471e8317 -r 69b10f9cdd14 MCUGearALPC1114.h --- a/MCUGearALPC1114.h Sat May 03 17:09:14 2014 +0000 +++ b/MCUGearALPC1114.h Tue May 06 15:53:05 2014 +0000 @@ -33,6 +33,7 @@ //void startReg(char bank); uint8_t setWireA(uint8_t mcuIO, uint8_t direction, uint8_t moduleIO); //void endReg(char bank); + void clear(void); protected: void fpga_write(unsigned char adr, unsigned char data);
diff -r aa2e471e8317 -r 69b10f9cdd14 commonALPC1114.h --- a/commonALPC1114.h Sat May 03 17:09:14 2014 +0000 +++ b/commonALPC1114.h Tue May 06 15:53:05 2014 +0000 @@ -25,7 +25,7 @@ #define BaudRate 9600 -#define FPGA_I2C_CLOCK 2000000 +#define FPGA_I2C_CLOCK 1000000 #define MODULE_I2C_CLOCK 2000000 //#define DEBUG //If you need to debug, define this.