Skip to content

Commit 5a5a45e

Browse files
committed
Add missing header for SPI FS and update documentation
Change-Id: I970ebac8288210e57662f2c80e9d04410d16a4e2 Signed-off-by: Ajay Bhargav <[email protected]>
1 parent b0433ae commit 5a5a45e

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

docs/book/api/storage/filesystem.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ Application can read write files using standard system calls.
1515

1616
See application example for more information.
1717

18+
SPI Flash
19+
=========
20+
21+
.. include:: /inc/spifs.inc

include/spifs.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* spifs.h
3+
*
4+
*/
5+
6+
#ifndef INC_SPIFS_H_
7+
#define INC_SPIFS_H_
8+
9+
/**
10+
* SPI Flash status
11+
*/
12+
enum sfstat_e {
13+
SF_STAT_NOTENABLED,/**< SPI Flash not enabled (Either not found or Initialization error) */
14+
SF_STAT_ENABLED, /**< SPI Flash enabled but not mounted (Filesystem mount issue, Try spifs_enable() again */
15+
SF_STAT_MOUNTED, /**< SPI Flash enabled and filesystem is mounted successfully */
16+
};
17+
18+
/**
19+
* Enable SPI Flash and mount LFS filesystem
20+
* @param gpio_cs [in] GPIO number connected to SPI chip select
21+
* @param speed [in] SPI Speed in KHz (max 10000 KHz)
22+
* @param mode [in] SPI mode
23+
* @return 0 on success, negative value on failure
24+
*/
25+
int spifs_enable(int gpio_cs, unsigned int speed, int mode);
26+
27+
/**
28+
* Disable SPI Flash and unmount LFS filesystem
29+
* @return 0 on success, negative value on failure
30+
*/
31+
int spifs_disable(void);
32+
33+
/**
34+
* Get status of SPI Flash
35+
* @return SPI Flash status see @ref sfstat_e
36+
*/
37+
int spifs_getstatus(void);
38+
39+
#endif /* INC_SPIFS_H_ */

0 commit comments

Comments
 (0)