]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/mulle/chips/rv8564/RV8564.nc
pretty code, minor improvements
[tinyos-2.x.git] / tos / platforms / mulle / chips / rv8564 / RV8564.nc
index 16b492cd58dd9f275b17ccb50a78f188b53c0d76..3004be353e3e136a86bfcd5e75ac0c624d16b06b 100755 (executable)
@@ -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();
 }