Soldered SD Card Arduino Library 1.0.0
Easily read and write files to and form the SD card breakout! A fork of the original SDFat library by Bill Greiman.
Loading...
Searching...
No Matches
FsApiConstants.h
Go to the documentation of this file.
1
25#ifndef FsApiConstants_h
26#define FsApiConstants_h
27#include "../SdFatConfig.h"
28
29#if USE_FCNTL_H
30#include <fcntl.h>
31/* values for GNU Arm Embedded Toolchain.
32 * O_RDONLY: 0x0
33 * O_WRONLY: 0x1
34 * O_RDWR: 0x2
35 * O_ACCMODE: 0x3
36 * O_APPEND: 0x8
37 * O_CREAT: 0x200
38 * O_TRUNC: 0x400
39 * O_EXCL: 0x800
40 * O_SYNC: 0x2000
41 * O_NONBLOCK: 0x4000
42 */
44#define O_AT_END O_NONBLOCK
45typedef int oflag_t;
46#else // USE_FCNTL_H
47#define O_RDONLY 0X00
48#define O_WRONLY 0X01
49#define O_RDWR 0X02
50#define O_AT_END 0X04
51#define O_APPEND 0X08
52#define O_CREAT 0x10
53#define O_TRUNC 0x20
54#define O_EXCL 0x40
55#define O_SYNC 0x80
56
57#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
58typedef uint8_t oflag_t;
59#endif // USE_FCNTL_H
60
61#define O_READ O_RDONLY
62#define O_WRITE O_WRONLY
63
64inline bool isWriteMode(oflag_t oflag)
65{
66 oflag &= O_ACCMODE;
67 return oflag == O_WRONLY || oflag == O_RDWR;
68}
69
70// flags for ls()
72const uint8_t LS_A = 1;
74const uint8_t LS_DATE = 2;
76const uint8_t LS_SIZE = 4;
78const uint8_t LS_R = 8;
79
80// flags for time-stamp
82const uint8_t T_ACCESS = 1;
84const uint8_t T_CREATE = 2;
86const uint8_t T_WRITE = 4;
87#endif // FsApiConstants_h
const uint8_t T_CREATE
Definition FsApiConstants.h:84
int oflag_t
Definition FsApiConstants.h:45
const uint8_t T_WRITE
Definition FsApiConstants.h:86
const uint8_t T_ACCESS
Definition FsApiConstants.h:82
const uint8_t LS_R
Definition FsApiConstants.h:78
const uint8_t LS_SIZE
Definition FsApiConstants.h:76
bool isWriteMode(oflag_t oflag)
Definition FsApiConstants.h:64
const uint8_t LS_A
Definition FsApiConstants.h:72
const uint8_t LS_DATE
Definition FsApiConstants.h:74