mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 16:14:16 +01:00 
			
		
		
		
	Initial commit of progress, minimal formatting niave free list
This commit is contained in:
		
							
								
								
									
										13
									
								
								lfs_bd.h
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								lfs_bd.h
									
									
									
									
									
								
							| @@ -10,6 +10,9 @@ | ||||
| #include "lfs_config.h" | ||||
|  | ||||
|  | ||||
| // Opaque type for block devices | ||||
| typedef void lfs_bd_t; | ||||
|  | ||||
| // Description of block devices | ||||
| struct lfs_bd_info { | ||||
|     lfs_size_t read_size;   // Size of readable block | ||||
| @@ -27,29 +30,29 @@ struct lfs_bd_info { | ||||
| // block device | ||||
| struct lfs_bd_ops { | ||||
|     // Read a block | ||||
|     lfs_error_t (*read)(void *bd, uint8_t *buffer, | ||||
|     lfs_error_t (*read)(lfs_bd_t *bd, uint8_t *buffer, | ||||
|             lfs_ino_t ino, lfs_off_t off, lfs_size_t size); | ||||
|  | ||||
|     // Program a block | ||||
|     // | ||||
|     // The block must have previously been erased. | ||||
|     lfs_error_t (*write)(void *bd, const uint8_t *buffer, | ||||
|     lfs_error_t (*write)(lfs_bd_t *bd, const uint8_t *buffer, | ||||
|             lfs_ino_t ino, lfs_off_t off, lfs_size_t size); | ||||
|  | ||||
|     // Erase a block | ||||
|     // | ||||
|     // A block must be erased before being programmed. The | ||||
|     // state of an erased block is undefined. | ||||
|     lfs_error_t (*erase)(void *bd, | ||||
|     lfs_error_t (*erase)(lfs_bd_t *bd, | ||||
|             lfs_ino_t ino, lfs_off_t off, lfs_size_t size); | ||||
|  | ||||
|     // Sync the block device | ||||
|     lfs_error_t (*sync)(void *bd); | ||||
|     lfs_error_t (*sync)(lfs_bd_t *bd); | ||||
|  | ||||
|     // Get a description of the block device | ||||
|     // | ||||
|     // Any unknown information may be left as zero | ||||
|     lfs_error_t (*info)(void *bd, struct lfs_bd_info *info); | ||||
|     lfs_error_t (*info)(lfs_bd_t *bd, struct lfs_bd_info *info); | ||||
| }; | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user