From 3a4bd5948939030b960c3363c04a33032d517fc7 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 24 Feb 2013 23:43:23 +0100 Subject: digital/ucoolib/ucoolib: change setup to enable/disable --- digital/ucoolib/ucoolib/hal/i2c/i2c_hard.stm32.hh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'digital/ucoolib/ucoolib/hal/i2c/i2c_hard.stm32.hh') diff --git a/digital/ucoolib/ucoolib/hal/i2c/i2c_hard.stm32.hh b/digital/ucoolib/ucoolib/hal/i2c/i2c_hard.stm32.hh index 866fc57e..a54f0ee5 100644 --- a/digital/ucoolib/ucoolib/hal/i2c/i2c_hard.stm32.hh +++ b/digital/ucoolib/ucoolib/hal/i2c/i2c_hard.stm32.hh @@ -33,12 +33,14 @@ namespace ucoo { class I2cHard : public I2c { public: - /// Initialise the Nth I2C. - I2cHard (int n, bool enable, int speed = 100000); + /// Constructor for the Nth I2C. + I2cHard (int n); /// Shutdown. ~I2cHard (); - /// Enable or disable. - void setup (bool enable, int speed = 100000); + /// Enable and setup + void enable (int speed = 100000); + /// Disable. + void disable (); /// See I2cMaster::send. void send (uint8_t addr, const char *buf, int count); /// See I2cMaster::recv. @@ -60,7 +62,7 @@ class I2cHard : public I2c /// I2C number. int n_; /// Is it enabled? - bool enable_; + bool enabled_; /// Slave address. uint8_t slave_addr_; /// Handler called to source or sink data for slave exchanges. -- cgit v1.2.3