X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=blobdiff_plain;f=tos%2Fplatforms%2Fshimmer%2Fchips%2Fsd%2FSD.nc;h=243d53e9dba42c728aab8a06f589b361a469f6ab;hp=3d911e98317da9e30f022504110634e8b62dd454;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hpb=adf1de6c009d13b7b52e68535c63b28f59c97400 diff --git a/tos/platforms/shimmer/chips/sd/SD.nc b/tos/platforms/shimmer/chips/sd/SD.nc index 3d911e98..243d53e9 100644 --- a/tos/platforms/shimmer/chips/sd/SD.nc +++ b/tos/platforms/shimmer/chips/sd/SD.nc @@ -36,31 +36,41 @@ */ #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 SUCCESS if it was read successfully; FAIL 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 SUCCESS if it was read successfully; FAIL 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 SUCCESS if it was written successfully; FAIL 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 SUCCESS if it was written successfully; FAIL 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(); }