some cleaning of imu
[protos/imu.git] / sd_log.h
1 #ifndef SD_LOG_H_
2 #define SD_LOG_H_
3
4 /**
5  * open a log file on sd card.
6  *
7  * The format of the filename is "log%.4d". The choosen integer is the
8  * first file that doesn't exist on the sd card, starting from 0.
9  *
10  * @return
11  *   0 on success, negative value on error
12  */
13 int8_t sd_log_open(void);
14
15 /**
16  * Write a buffer in the log file
17  *
18  * This function fails (return -1)if the log file was not opened.
19  *
20  * @return
21  *   number of written bytes on success, negative value en error
22  */
23 intptr_t sd_log_write(const void *buffer, uintptr_t buffer_len);
24
25 /**
26  * return true if log file was properly opened
27  */
28 uint8_t sd_log_enabled(void);
29
30 #endif