X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fplatforms%2Fmulle%2Fchips%2Frv8564%2FRV8564.nc;h=3004be353e3e136a86bfcd5e75ac0c624d16b06b;hb=500ad4cbd47a5e6471b4855cf9360e5cf5d978ca;hp=16b492cd58dd9f275b17ccb50a78f188b53c0d76;hpb=58682d81735201c7a22f7768619d3b6f7469d2f0;p=tinyos-2.x.git diff --git a/tos/platforms/mulle/chips/rv8564/RV8564.nc b/tos/platforms/mulle/chips/rv8564/RV8564.nc index 16b492cd..3004be35 100755 --- a/tos/platforms/mulle/chips/rv8564/RV8564.nc +++ b/tos/platforms/mulle/chips/rv8564/RV8564.nc @@ -44,27 +44,27 @@ interface RV8564 /** * 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. @@ -72,7 +72,7 @@ interface RV8564 * @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. @@ -80,10 +80,30 @@ interface RV8564 * @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(); }