-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsd.h
More file actions
40 lines (27 loc) · 857 Bytes
/
sd.h
File metadata and controls
40 lines (27 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef __SD_H_
#define __SD_H_
#include <sys/types.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#define SD_QUEUE_SIZE 2500
typedef struct
{
uint8_t queuefull; /*queue full,if queue 0 full,bit0=1;if queue 1 full,bit1=1;*/
uint16_t max; /* max data in queue */
uint16_t cnt; /*cnt[0] for queue0 data cnt; cnt[1] for queue1 data cnt */
uint8_t blocknum;
uint32_t chksum;
uint8_t *data;//uint8_t data[SD_QUEUE_SIZE]; /* frame data */
}tSD_buffer;
struct _sd_info{
unsigned int sd_total;
unsigned int sd_used;
unsigned int sd_free;
unsigned int db_sd_free;
};
extern struct _sd_info sd_info;
extern void SDBufferInit(void);
extern void Write2SDBuffer(FILE *fp,uint8_t* buffer, uint16_t len);
extern void Write2SDBufferDone(FILE *fp);
#endif/*__SD_H_*/