/**
* Turns the chip on.
*/
- async command void on();
+ command error_t on();
/**
* Turns the chip off.
*/
- async command void off();
+ command error_t off();
/**
* Checks if the chip is on.
*
* @return true if on.
*/
- async command bool isOn();
+ command bool isOn();
/**
* Enables/disables the interrupts generated by the CLKOUT.
*/
// TODO(henrik) This needs to be changed because there are different type of
// interrupts generated by the chip.
- async command void enableInterrupt();
- async command void disableInterrupt();
+ command void enableInterrupt();
+ command void disableInterrupt();
/**
* Reads from a register.
* @param reg The register to be read.
* @return The value of the register.
*/
- async command uint8_t readRegister(uint16_t reg);
+ command error_t readRegister(uint8_t reg);
/**
* Writes to a register.
* @param reg The register that is written to.
* @param value The value that is written to the register.
*/
- async command void writeRegister(uint16_t reg, uint8_t value);
-
+ command error_t writeRegister(uint8_t reg, uint8_t value);
+
+ /**
+ * Signals when a register read finished.
+ *
+ * @param val The value read from the register.
+ * @param reg The register the value was read from.
+ */
+ async event void readRegisterDone(uint8_t val, uint8_t reg);
+
+ /**
+ * Signals when a register write finished.
+ *
+ * @param reg The register the value was written to.
+ */
+ async event void writeRegisterDone(uint8_t reg);
+
/**
* Signal when an interrupt occurs.
*/
async event void fired();
+
+ /**
+ * Enables CLKOUT from the RTC.
+ */
+ command void enableCLKOUT();
}