]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
events available and unavailable added, reflecting updates from sdp.nc.
authorayer1 <ayer1>
Fri, 4 Sep 2009 18:08:56 +0000 (18:08 +0000)
committerayer1 <ayer1>
Fri, 4 Sep 2009 18:08:56 +0000 (18:08 +0000)
tos/platforms/shimmer/chips/sd/SD.nc

index 3d911e98317da9e30f022504110634e8b62dd454..243d53e9dba42c728aab8a06f589b361a469f6ab 100644 (file)
  */                      
 #include "SD.h"
 
-interface SD 
-{
-    /**
-     * Returns the card size in bytes.
-     *
-     * @return the card size in bytes.
-     */
-    command uint32_t readCardSize();
+interface SD {
+  /**
+   * Returns the card size in bytes.
+   *
+   * @return the card size in bytes.
+   */
+  command uint32_t readCardSize();
 
-    /**
-     * Reads 512 bytes from the SD at sector and copies it to bufferPtr
-     *
-     * @param sector the sector on the SD card (in multiples of 512 bytes).
-     * @param bufferPtr pointer to where the SD will copy the data to.  Must be 512 bytes.
-     * @return <code>SUCCESS<code> if it was read successfully; <code>FAIL<code> otherwise
-    */
-    command error_t readBlock(const uint32_t sector, void *bufferPtr);
+  /**
+   * Reads 512 bytes from the SD at sector and copies it to bufferPtr
+   *
+   * @param sector the sector on the SD card (in multiples of 512 bytes).
+   * @param bufferPtr pointer to where the SD will copy the data to.  Must be 512 bytes.
+   * @return <code>SUCCESS<code> if it was read successfully; <code>FAIL<code> otherwise
+   */
+  command error_t readBlock(const uint32_t sector, uint8_t * buffer);
 
-    /**
-     * Writes 512 bytes from the bufferPtr to the SD card
-     *
-     * @param sector the sector on the SD card (in multiples of 512 bytes
-     *                       where to write the data to).
-     * @param bufferPtr pointer to data to be added.  Must be 512 bytes.
-     * @return <code>SUCCESS<code> if it was written successfully; <code>FAIL<code> otherwise
-     */
-    command error_t writeBlock(const uint32_t sector, void *bufferPtr);
+  /**
+   * Writes 512 bytes from the bufferPtr to the SD card
+   *
+   * @param sector the sector on the SD card (in multiples of 512 bytes
+   *                       where to write the data to).
+   * @param bufferPtr pointer to data to be added.  Must be 512 bytes.
+   * @return <code>SUCCESS<code> if it was written successfully; <code>FAIL<code> otherwise
+   */
+  command error_t writeBlock(const uint32_t sector, uint8_t * buffer);
+
+  /**
+   * the device has control over the sd card
+   */
+  async event void available();     
+
+  /**
+   * the device has lost control of the sd and should cease 
+   * attempts to talk to the card
+   */
+  async event void unavailable();
 }