@@ -66,7 +66,7 @@ uint8_t TwoWire::twi_readFrom(unsigned char address, unsigned char * buf, unsign
66
66
flag |= RT_I2C_NO_STOP;
67
67
}
68
68
69
- return rt_i2c_master_recv (_i2c_bus_dev , address, flag, buf, len);
69
+ return rt_i2c_master_recv (_bus_dev , address, flag, buf, len);
70
70
}
71
71
72
72
/*
@@ -92,7 +92,7 @@ uint8_t TwoWire::twi_writeTo(unsigned char address, unsigned char * buf, unsigne
92
92
flag |= RT_I2C_NO_STOP;
93
93
}
94
94
95
- if (rt_i2c_master_send (_i2c_bus_dev , address, flag, buf, len) != 0 )
95
+ if (rt_i2c_master_send (_bus_dev , address, flag, buf, len) != 0 )
96
96
{
97
97
return 0 ; // success
98
98
}
@@ -114,7 +114,7 @@ uint8_t TwoWire::twi_writeTo(unsigned char address, unsigned char * buf, unsigne
114
114
*/
115
115
uint8_t TwoWire::twi_transmit (const uint8_t * buf, uint8_t len)
116
116
{
117
- int8_t ret = rt_i2c_master_send (_i2c_bus_dev , txAddress, RT_NULL, buf, len);
117
+ int8_t ret = rt_i2c_master_send (_bus_dev , txAddress, RT_NULL, buf, len);
118
118
119
119
if (ret > 0 )
120
120
{
@@ -140,8 +140,8 @@ void twi_disable(void)
140
140
141
141
TwoWire::TwoWire ()
142
142
{
143
- _i2c_bus_dev = RT_NULL;
144
- _i2c_bus_dev_initialized = false ;
143
+ _bus_dev = RT_NULL;
144
+ _bus_dev_initialized = false ;
145
145
rt_memset (rxBuffer, 0 , RTDUINO_WIRE_BUFFER_LENGTH);
146
146
rt_memset (txBuffer, 0 , RTDUINO_WIRE_BUFFER_LENGTH);
147
147
rxBufferIndex = 0 ;
@@ -158,7 +158,7 @@ TwoWire::TwoWire()
158
158
159
159
void TwoWire::begin (const char *i2c_dev_name)
160
160
{
161
- if (_i2c_bus_dev_initialized )
161
+ if (_bus_dev_initialized )
162
162
{
163
163
return ;
164
164
}
@@ -178,8 +178,8 @@ void TwoWire::begin(const char *i2c_dev_name)
178
178
txBufferIndex = 0 ;
179
179
txBufferLength = 0 ;
180
180
181
- _i2c_bus_dev = dev;
182
- _i2c_bus_dev_initialized = true ;
181
+ _bus_dev = dev;
182
+ _bus_dev_initialized = true ;
183
183
}
184
184
185
185
// void TwoWire::begin(uint8_t address)
@@ -495,12 +495,12 @@ void TwoWire::flush(void)
495
495
496
496
bool TwoWire::isBusDeviceInited (void )
497
497
{
498
- return _i2c_bus_dev_initialized ;
498
+ return _bus_dev_initialized ;
499
499
}
500
500
501
501
struct rt_i2c_bus_device * TwoWire::getBusDevice (void )
502
502
{
503
- return _i2c_bus_dev ;
503
+ return _bus_dev ;
504
504
}
505
505
506
506
// Preinstantiate Objects //////////////////////////////////////////////////////
0 commit comments