![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
New Version with OS5
Revision 3:0eb6a9927171, committed 2020-10-25
- Comitter:
- tgrosch
- Date:
- Sun Oct 25 10:45:04 2020 +0000
- Parent:
- 2:f30187bb3fbd
- Commit message:
- New version with OS5
Changed in this revision
diff -r f30187bb3fbd -r 0eb6a9927171 OPT3101device_Functions.cpp --- a/OPT3101device_Functions.cpp Sun Oct 25 10:16:43 2020 +0000 +++ b/OPT3101device_Functions.cpp Sun Oct 25 10:45:04 2020 +0000 @@ -100,7 +100,7 @@ bool OPT3101::device::validateI2C() { /// <b>Algorithm of the method is as follows</b> uint32_t data; - bool status; + bool status=false; //0x8001A0 //data=0xA001802E //data[0]=0x8; @@ -108,7 +108,7 @@ status = 0; host.printf("INFO::Validating I2C Transaction\r\n"); //#ifdef TIMSP430F5529_LAUNCHPAD_CALIBRATION_TOOL - status=host.i2c.read(0x2E,&data); + //status=host.i2c_a.read(0x2E,&data); //TODO Fix this stauts check if(status){ host.printfSetColor(0b010); host.printf("INFO::I2C Transaction Successful\r\n");
diff -r f30187bb3fbd -r 0eb6a9927171 hostController.h --- a/hostController.h Sun Oct 25 10:16:43 2020 +0000 +++ b/hostController.h Sun Oct 25 10:45:04 2020 +0000 @@ -173,7 +173,7 @@ //#ifdef TIMSP430F5529_LAUNCHPAD_CALIBRATION_TOOL - I2C::i2cHandler i2c; + I2C_A::i2cHandler i2c; // STORAGE::flashHandler flash; // LAUNCHPAD::MSPConnections gpio; //#endif
diff -r f30187bb3fbd -r 0eb6a9927171 i2cHandler.cpp --- a/i2cHandler.cpp Sun Oct 25 10:16:43 2020 +0000 +++ b/i2cHandler.cpp Sun Oct 25 10:45:04 2020 +0000 @@ -10,7 +10,7 @@ #include "hostController.h" #define OPT3101_I2C_SLAVEADDRESS 0x50 // TODO fix this slave address -I2C::i2cHandler::i2cHandler(void){ +I2C_A::i2cHandler::i2cHandler(void){ //#ifdef TIMSP430F5529_LAUNCHPAD_CALIBRATION_TOOL this->slaveAddress=OPT3101_I2C_SLAVEADDRESS; //#endif @@ -21,12 +21,12 @@ this->continousReadRegisterAddress=0x08; } -I2C::i2cHandler::~i2cHandler(void){ +I2C_A::i2cHandler::~i2cHandler(void){ delete [] this->dataRx; this->dataRx=NULL; } -void I2C::i2cHandler::init(void){ +void I2C_A::i2cHandler::init(void){ //TODO do platform initialization here // no reason to initalize mbed I2C // this->i2cParam.selectClockSource = USCI_B_I2C_CLOCKSOURCE_SMCLK; // Clecting the SMCLK For the I2C Clocks. @@ -46,14 +46,14 @@ } -void I2C::i2cHandler::updateSlaveAddress(){ +void I2C_A::i2cHandler::updateSlaveAddress(){ if(this->slaveAddress_!=this->slaveAddress){ this->slaveAddress_=this->slaveAddress; // USCI_B_I2C_setSlaveAddress(USCI_B1_BASE,this->slaveAddress); } } -bool I2C::i2cHandler::write(){ +bool I2C_A::i2cHandler::write(){ static uint32_t cnt; static uint8_t c; static bool state; @@ -81,25 +81,25 @@ } -bool I2C::i2cHandler::write(uint8_t address,uint8_t *data){ +bool I2C_A::i2cHandler::write(uint8_t address,uint8_t *data){ this->address=address; this->dataTx=data; return this->write(); } /* This is overloaded function of i2C Write. This makes the register interface simple */ -bool I2C::i2cHandler::write(uint8_t address,uint32_t data){ +bool I2C_A::i2cHandler::write(uint8_t address,uint32_t data){ this->address=address; this->dataTx=(uint8_t*) &data; return this->write(); } /* This is overloaded function of i2C Write. This makes the register interface simple */ -bool I2C::i2cHandler::write(uint8_t *data){ +bool I2C_A::i2cHandler::write(uint8_t *data){ this->address=data[0]; this->dataTx=&data[1]; return this->write(); } -bool I2C::i2cHandler::read(){ +bool I2C_A::i2cHandler::read(){ static bool state; static uint8_t c; static uint32_t cnt; @@ -127,7 +127,7 @@ return state; } -bool I2C::i2cHandler::continuousRead(uint8_t *data){ +bool I2C_A::i2cHandler::continuousRead(uint8_t *data){ static bool state; static uint8_t c; @@ -150,13 +150,13 @@ -uint8_t* I2C::i2cHandler::read(uint8_t address){ +uint8_t* I2C_A::i2cHandler::read(uint8_t address){ this->dataRx[0]=address; this->read(); return &this->dataRx[1]; } -bool I2C::i2cHandler::read(uint8_t address,uint8_t *data){ +bool I2C_A::i2cHandler::read(uint8_t address,uint8_t *data){ static bool state; static uint8_t c; @@ -167,7 +167,7 @@ return state; } -bool I2C::i2cHandler::read(uint8_t *data){ +bool I2C_A::i2cHandler::read(uint8_t *data){ static bool state; static uint8_t c; state=true; @@ -178,7 +178,7 @@ return state; } -bool I2C::i2cHandler::read(uint8_t address,uint32_t *data){ +bool I2C_A::i2cHandler::read(uint8_t address,uint32_t *data){ static bool state; static uint8_t c; static uint32_t addon;
diff -r f30187bb3fbd -r 0eb6a9927171 i2cHandler.h --- a/i2cHandler.h Sun Oct 25 10:16:43 2020 +0000 +++ b/i2cHandler.h Sun Oct 25 10:45:04 2020 +0000 @@ -18,7 +18,7 @@ typedef unsigned int uint32_t; typedef unsigned short uint16_t; -namespace I2C { +namespace I2C_A { class i2cHandler { private: uint8_t *dataTx;
diff -r f30187bb3fbd -r 0eb6a9927171 mbed-os.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Sun Oct 25 10:45:04 2020 +0000 @@ -0,0 +1,1 @@ +https://github.com/armmbed/mbed-os/#c6d65fe5082aeef6bf0d7043b4cbf0a9cc9a9d5e
diff -r f30187bb3fbd -r 0eb6a9927171 mbed.bld --- a/mbed.bld Sun Oct 25 10:16:43 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/abea610beb85 \ No newline at end of file