summaryrefslogtreecommitdiffhomepage
path: root/digital/ucoolib/ucoolib/hal/i2c/i2c_hard.stm32.hh
diff options
context:
space:
mode:
authorNicolas Schodet2013-02-24 23:43:23 +0100
committerNicolas Schodet2013-03-01 22:58:04 +0100
commit3a4bd5948939030b960c3363c04a33032d517fc7 (patch)
tree00fed9e08ae4640f0738f690e6ba735c62891802 /digital/ucoolib/ucoolib/hal/i2c/i2c_hard.stm32.hh
parent54848f43e39e38ca31cfa4e95b93baa60e1cb20b (diff)
digital/ucoolib/ucoolib: change setup to enable/disable
Diffstat (limited to 'digital/ucoolib/ucoolib/hal/i2c/i2c_hard.stm32.hh')
-rw-r--r--digital/ucoolib/ucoolib/hal/i2c/i2c_hard.stm32.hh12
1 files changed, 7 insertions, 5 deletions
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.