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: 2016_mother_3 WRS2019_master WRS2020_mecanum_node WRS2021_mecanum_driver
Revision 7:446cf4690750, committed 2021-08-23
- Comitter:
- sgrsn
- Date:
- Mon Aug 23 17:00:24 2021 +0000
- Parent:
- 6:bc6d5a6e9fe1
- Commit message:
- Update
Changed in this revision
| i2cmaster.cpp | Show annotated file Show diff for this revision Revisions of this file |
| i2cmaster.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/i2cmaster.cpp Thu Jul 12 10:16:10 2018 +0000
+++ b/i2cmaster.cpp Mon Aug 23 17:00:24 2021 +0000
@@ -29,19 +29,19 @@
{
frequency(400000);
}
-bool i2c::writeSomeData(char addr, char reg, int32_t data ,int size)
+bool i2c::writeSomeData(char addr, char reg, int32_t data ,uint8_t size)
{
char tmp[size];
for(int i = 0; i < size; i++)
{
tmp[i] = (data >> (i*8)) & 0xFF;
}
- char DATA[2] = {reg,size};
+ char DATA[2] = {reg, size};
bool N = I2C::write(addr, DATA, 2);
N|= I2C::write(addr, tmp, size);
return N;
}
-bool i2c::getSlaveRegistarData(char addr, char reg, int32_t *data ,int size)
+bool i2c::getSlaveRegistarData(char addr, char reg, int32_t *data ,uint8_t size)
{
char DATA[2] = {reg,size};
bool N = I2C::write(addr,DATA,2);
--- a/i2cmaster.h Thu Jul 12 10:16:10 2018 +0000
+++ b/i2cmaster.h Mon Aug 23 17:00:24 2021 +0000
@@ -7,8 +7,8 @@
{
public:
i2c(PinName p1,PinName p2);
- bool writeSomeData(char addr,char reg, int32_t data ,int size);
- bool getSlaveRegistarData(char addr, char reg, int32_t *data ,int size);
+ bool writeSomeData(char addr,char reg, int32_t data ,uint8_t size);
+ bool getSlaveRegistarData(char addr, char reg, int32_t *data ,uint8_t size);
};
#endif
\ No newline at end of file