| RTOS_MSPM0 1.1 ECE445M starter code

eFile.h
Go to the documentation of this file.
1
20 int eFile_Init(void); // initialize file system
21
28 int eFile_Format(void); // erase disk, add format
29
36 int eFile_Mount(void); // mount disk and file system
37
44 int eFile_Create(const char name[]); // create new file, make it empty
45
52 int eFile_WOpen(const char name[]); // open a file for writing
53
60 int eFile_Write(const char data);
61
68 int eFile_WriteString(const char *pt);
69
70 //-----------------------eFile_WriteUDec-----------------------
71 // Write a 32-bit number in unsigned decimal format
72 // Input: 32-bit number to be transferred
73 // Output: none
74 // Variable format 1-10 digits with no space before or after
75 int eFile_WriteUDec(uint32_t n);
76
77 //-----------------------eFile_WriteSDec-----------------------
78 // Write a 32-bit number in signed decimal format
79 // Input: 32-bit number to be transferred
80 // Output: 0 if successful and 1 on failure (e.g., trouble writing to flash)
81 // Variable format 1-10 digits with space before and no space after
82 int eFile_WriteSDec(int32_t num);
83
84 //-----------------------eFile_WriteSFix2-----------------------
85 // Write a 32-bit number in signed decimal format
86 // format signed 16-bit with resolution 0.01
87 // range -327.67 to +327.67
88 // Input: signed 16-bit integer part of fixed point number
89 // -32768 means invalid fixed-point number
90 // Output: 0 if successful and 1 on failure (e.g., trouble writing to flash)
91 // Examples
92 // 12345 to " 123.45"
93 // -22100 to "-221.00"
94 // -102 to " -1.02"
95 // 31 to " 0.31"
96 // -32768 to " ***.**"
97 int eFile_WriteSFix2(int32_t n);
98
99 //-----------------------eFile_WriteUFix2-----------------------
100 // Write a 32-bit number in signed fixed point format
101 // unsigned 32-bit with resolution 0.01
102 // range 0.00 to 999.99
103 // Input: unsigned 32-bit integer part of fixed point number
104 // Output: 0 if successful and 1 on failure (e.g., trouble writing to flash)
105 // Examples
106 // 72345 to " 723.45"
107 // 22100 to " 221.00"
108 // 102 to " 1.02"
109 // 31 to " 0.31"
110 // 100000 to " ***.**"
111 int eFile_WriteUFix2(uint32_t num);
112
120 int eFile_WClose(void); // close the file for writing
121
128 int eFile_ROpen(const char name[]); // open a file for reading
129
136 int eFile_ReadNext(char *pt); // get next byte
137
144 uint32_t eFileReadNextWord(uint32_t *pt); // get next word
145
152 int eFile_RClose(void); // close the file for writing
153
160 int eFile_Delete(const char name[]); // remove this file
161
168 int eFile_DOpen(const char name[]);
169
175 int eFile_DirNext(char *name[], unsigned long *size);
176
182 int eFile_DClose(void);
183
190 int eFile_Unmount(void);
eFile_RClose
int eFile_RClose(void)
Close the file that was being read.
eFile_Mount
int eFile_Mount(void)
Mount the disk.
eFile_Delete
int eFile_Delete(const char name[])
delete this file
eFile_Write
int eFile_Write(const char data)
Write one byte.
eFile_Create
int eFile_Create(const char name[])
Create a new file.
eFile_WriteString
int eFile_WriteString(const char *pt)
Write string.
eFileReadNextWord
uint32_t eFileReadNextWord(uint32_t *pt)
Retreive data from open file.
eFile_WClose
int eFile_WClose(void)
Close the file that was being written.
eFile_DirNext
int eFile_DirNext(char *name[], unsigned long *size)
eFile_Unmount
int eFile_Unmount(void)
Unmount the disk.
eFile_DClose
int eFile_DClose(void)
eFile_Init
int eFile_Init(void)
Activate the file system, without formating.
eFile_DOpen
int eFile_DOpen(const char name[])
eFile_ReadNext
int eFile_ReadNext(char *pt)
Retreive data from open file.
eFile_Format
int eFile_Format(void)
Format the disk.
eFile_ROpen
int eFile_ROpen(const char name[])
Open an existing file for reading.
eFile_WOpen
int eFile_WOpen(const char name[])
Open an existing file for writing.