aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/machine/machine_nrf5x.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/machine/machine_nrf5x.go')
-rw-r--r--src/machine/machine_nrf5x.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/machine/machine_nrf5x.go b/src/machine/machine_nrf5x.go
index dbf2e1ccf..f36c7c93c 100644
--- a/src/machine/machine_nrf5x.go
+++ b/src/machine/machine_nrf5x.go
@@ -6,7 +6,8 @@ import "device/nrf"
// I2C on the NRF51 and NRF52.
type I2C struct {
- Bus *nrf.TWI_Type
+ Bus *nrf.TWI_Type
+ mode I2CMode
}
// There are 2 I2C interfaces on the NRF.
@@ -19,6 +20,10 @@ func (i2c *I2C) enableAsController() {
i2c.Bus.ENABLE.Set(nrf.TWI_ENABLE_ENABLE_Enabled)
}
+func (i2c *I2C) enableAsTarget() {
+ // Not supported on this hardware
+}
+
func (i2c *I2C) disable() {
i2c.Bus.ENABLE.Set(0)
}