diff --git a/src/machine/i2c.go b/src/machine/i2c.go index 384d3deed0..434b91ee35 100644 --- a/src/machine/i2c.go +++ b/src/machine/i2c.go @@ -36,6 +36,7 @@ var ( errI2CBusError = errors.New("I2C bus error") errI2COverflow = errors.New("I2C receive buffer overflow") errI2COverread = errors.New("I2C transmit buffer overflow") + errI2CNotImplemented = errors.New("I2C operation not yet implemented") ) // I2CTargetEvent reflects events on the I2C bus diff --git a/src/machine/machine_mimxrt1062_i2c.go b/src/machine/machine_mimxrt1062_i2c.go index 8531eba1db..ee46ff9569 100644 --- a/src/machine/machine_mimxrt1062_i2c.go +++ b/src/machine/machine_mimxrt1062_i2c.go @@ -174,7 +174,7 @@ func (i2c *I2C) Configure(config I2CConfig) { // SetBaudRate sets the communication speed for I2C. func (i2c I2C) SetBaudRate(br uint32) error { // TODO: implement - return nil + return errI2CNotImplemented } func (i2c I2C) Tx(addr uint16, w, r []byte) error { diff --git a/src/machine/machine_stm32_i2c_reva.go b/src/machine/machine_stm32_i2c_reva.go index 0dea71639b..1e4fd282e9 100644 --- a/src/machine/machine_stm32_i2c_reva.go +++ b/src/machine/machine_stm32_i2c_reva.go @@ -160,7 +160,7 @@ func (i2c *I2C) Configure(config I2CConfig) error { // SetBaudRate sets the communication speed for I2C. func (i2c *I2C) SetBaudRate(br uint32) error { // TODO: implement - return nil + return errI2CNotImplemented } func (i2c *I2C) Tx(addr uint16, w, r []byte) error { diff --git a/src/machine/machine_stm32_i2c_revb.go b/src/machine/machine_stm32_i2c_revb.go index 24ba8aec9d..9253902940 100644 --- a/src/machine/machine_stm32_i2c_revb.go +++ b/src/machine/machine_stm32_i2c_revb.go @@ -87,7 +87,7 @@ func (i2c *I2C) Configure(config I2CConfig) error { // SetBaudRate sets the communication speed for I2C. func (i2c *I2C) SetBaudRate(br uint32) error { // TODO: implement - return nil + return errI2CNotImplemented } func (i2c *I2C) Tx(addr uint16, w, r []byte) error {