Hanna
Sourcecode Batteriemanagementsystem
partition.h
gehe zur Dokumentation dieser Datei
1 
14 /*
15  * Copyright (c) 2006-2011 by Roland Riegel <feedback@roland-riegel.de>
16  *
17  * This file is free software; you can redistribute it and/or modify
18  * it under the terms of either the GNU General Public License version 2
19  * or the GNU Lesser General Public License version 2.1, both as
20  * published by the Free Software Foundation.
21  */
22 
23 #ifndef PARTITION_H
24 #define PARTITION_H
25 
26 #include <stdint.h>
27 #include "sd_raw_config.h"
28 #include "partition_config.h"
29 
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif
34 
50 #define PARTITION_TYPE_FREE 0x00
51 
54 #define PARTITION_TYPE_FAT12 0x01
55 
58 #define PARTITION_TYPE_FAT16_32MB 0x04
59 
62 #define PARTITION_TYPE_EXTENDED 0x05
63 
66 #define PARTITION_TYPE_FAT16 0x06
67 
70 #define PARTITION_TYPE_FAT32 0x0b
71 
74 #define PARTITION_TYPE_FAT32_LBA 0x0c
75 
78 #define PARTITION_TYPE_FAT16_LBA 0x0e
79 
82 #define PARTITION_TYPE_EXTENDED_LBA 0x0f
83 
86 #define PARTITION_TYPE_UNKNOWN 0xff
87 
95 typedef uint8_t (*device_read_t)(offset_t offset, uint8_t* buffer, uintptr_t length);
104 typedef uint8_t (*device_read_callback_t)(uint8_t* buffer, offset_t offset, void* p);
123 typedef uint8_t (*device_read_interval_t)(offset_t offset, uint8_t* buffer, uintptr_t interval, uintptr_t length, device_read_callback_t callback, void* p);
131 typedef uint8_t (*device_write_t)(offset_t offset, const uint8_t* buffer, uintptr_t length);
141 typedef uintptr_t (*device_write_callback_t)(uint8_t* buffer, offset_t offset, void* p);
160 typedef uint8_t (*device_write_interval_t)(offset_t offset, uint8_t* buffer, uintptr_t length, device_write_callback_t callback, void* p);
161 
166 {
195 
201  uint8_t type;
205  uint32_t offset;
209  uint32_t length;
210 };
211 
213 uint8_t partition_close(struct partition_struct* partition);
214 
219 #ifdef __cplusplus
220 }
221 #endif
222 
223 #endif
224 
uint8_t(* device_write_t)(offset_t offset, const uint8_t *buffer, uintptr_t length)
Definition: partition.h:131
device_read_t device_read
Definition: partition.h:173
uint8_t(* device_read_t)(offset_t offset, uint8_t *buffer, uintptr_t length)
Definition: partition.h:95
device_read_interval_t device_read_interval
Definition: partition.h:180
uint8_t(* device_read_interval_t)(offset_t offset, uint8_t *buffer, uintptr_t interval, uintptr_t length, device_read_callback_t callback, void *p)
Definition: partition.h:123
SD-Card Reader Bibliothek von Roland Riegel.
uint32_t length
Definition: partition.h:209
uint32_t offset
Definition: partition.h:205
uint8_t partition_close(struct partition_struct *partition)
Definition: partition.c:149
uintptr_t(* device_write_callback_t)(uint8_t *buffer, offset_t offset, void *p)
Definition: partition.h:141
uint8_t(* device_read_callback_t)(uint8_t *buffer, offset_t offset, void *p)
Definition: partition.h:104
struct partition_struct * partition_open(device_read_t device_read, device_read_interval_t device_read_interval, device_write_t device_write, device_write_interval_t device_write_interval, int8_t index)
Definition: partition.c:77
SD-Card Reader Bibliothek von Roland Riegel.
device_write_interval_t device_write_interval
Definition: partition.h:194
device_write_t device_write
Definition: partition.h:187
uint8_t(* device_write_interval_t)(offset_t offset, uint8_t *buffer, uintptr_t length, device_write_callback_t callback, void *p)
Definition: partition.h:160