Go to the documentation of this file.
40 #ifndef CFS_COFFEE_ARCH_H
41 #define CFS_COFFEE_ARCH_H
43 #include "contiki-conf.h"
46 #define COFFEE_SECTOR_SIZE 65536UL
47 #define COFFEE_PAGE_SIZE 256UL
48 #define COFFEE_START 0
49 #define COFFEE_SIZE ((1024UL * 1024UL) - COFFEE_START)
50 #define COFFEE_NAME_LENGTH 16
51 #define COFFEE_DYN_SIZE 16384
52 #define COFFEE_MAX_OPEN_FILES 6
53 #define COFFEE_FD_SET_SIZE 8
54 #define COFFEE_LOG_DIVISOR 4
55 #define COFFEE_LOG_SIZE 8192
56 #define COFFEE_LOG_TABLE_LIMIT 256
57 #define COFFEE_MICRO_LOGS 0
58 #define COFFEE_IO_SEMANTICS 1
60 #define COFFEE_WRITE(buf, size, offset) \
61 xmem_pwrite((char *)(buf), (size), COFFEE_START + (offset))
63 #define COFFEE_READ(buf, size, offset) \
64 xmem_pread((char *)(buf), (size), COFFEE_START + (offset))
66 #define COFFEE_ERASE(sector) \
67 xmem_erase(COFFEE_SECTOR_SIZE, COFFEE_START + (sector) * COFFEE_SECTOR_SIZE)
69 #define READ_HEADER(hdr, page) \
70 COFFEE_READ((hdr), sizeof (*hdr), (page) * COFFEE_PAGE_SIZE)
72 #define WRITE_HEADER(hdr, page) \
73 COFFEE_WRITE((hdr), sizeof (*hdr), (page) * COFFEE_PAGE_SIZE)
76 typedef int16_t coffee_page_t;