Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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
--- 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){
--- 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);
--- 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.
