summaryrefslogtreecommitdiffhomepage
path: root/digital/ucoolib/ucoolib/hal/i2c/i2c_hard.stm32.hh
diff options
context:
space:
mode:
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.