some cleaning
[protos/imu.git] / sd_log.h
index d2333e2..d386126 100644 (file)
--- a/sd_log.h
+++ b/sd_log.h
@@ -1,7 +1,30 @@
 #ifndef SD_LOG_H_
 #define SD_LOG_H_
 
-struct fat_file_struct *open_log_file(void);
-struct fat_file_struct *get_log_file(void);
+/**
+ * open a log file on sd card.
+ *
+ * The format of the filename is "log%.4d". The choosen integer is the
+ * first file that doesn't exist on the sd card, starting from 0.
+ *
+ * @return
+ *   0 on success, negative value on error
+ */
+int8_t sd_log_open(void);
+
+/**
+ * Write a buffer in the log file
+ *
+ * This function fails (return -1)if the log file was not opened.
+ *
+ * @return
+ *   number of written bytes on success, negative value en error
+ */
+intptr_t sd_log_write(const void *buffer, uintptr_t buffer_len);
+
+/**
+ * return true if log file was properly opened
+ */
+uint8_t sd_log_enabled(void);
 
 #endif