Fixed ISerialBus interface and added device and register address fields so that future i2c and SPI devices can be addressed, to. Added i2c HAL. Tested, working.
The update on the interface required FunctionStatus and the logger to be updated, too
This commit is contained in:
@@ -45,6 +45,8 @@
|
||||
// Constant and macro definitions
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
#define NO_DEVICE_ADDRESS (255)
|
||||
#define NO_REGISTER_ADDRESS (255)
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// Type definitions.
|
||||
@@ -70,9 +72,9 @@ class ISerialBus
|
||||
|
||||
FunctionStatus close() {status = CLOSED; return FUNCTION_STATUS_OK;}
|
||||
|
||||
virtual FunctionStatus read(T* buffer, uint32_t length, uint32_t* actualLength) = 0;
|
||||
virtual FunctionStatus read(T deviceAddress, T registerAddress, T* buffer, uint32_t length, uint32_t* actualLength) = 0;
|
||||
|
||||
virtual FunctionStatus write(T* buffer, uint32_t length) = 0;
|
||||
virtual FunctionStatus write(T deviceAddress, T registerAddress, T* buffer, uint32_t length) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user