]> begriffs open source - freertos/blob - FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/api/api_mdriver.h
Update FreeRTOS+FAT SL to version 1.0.1.
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-FAT-SL / api / api_mdriver.h
1 /*\r
2  * FreeRTOS+FAT SL V1.0.1 (C) 2014 HCC Embedded\r
3  *\r
4  * The FreeRTOS+FAT SL license terms are different to the FreeRTOS license \r
5  * terms.\r
6  * \r
7  * FreeRTOS+FAT SL uses a dual license model that allows the software to be used \r
8  * under a standard GPL open source license, or a commercial license.  The \r
9  * standard GPL license (unlike the modified GPL license under which FreeRTOS \r
10  * itself is distributed) requires that all software statically linked with \r
11  * FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.  \r
12  * Details of both license options follow:\r
13  * \r
14  * - Open source licensing -\r
15  * FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and\r
16  * distributed without charge provided the user adheres to version two of the \r
17  * GNU General Public License (GPL) and does not remove the copyright notice or \r
18  * this text.  The GPL V2 text is available on the gnu.org web site, and on the\r
19  * following URL: http://www.FreeRTOS.org/gpl-2.0.txt.\r
20  * \r
21  * - Commercial licensing -\r
22  * Businesses and individuals who for commercial or other reasons cannot comply\r
23  * with the terms of the GPL V2 license must obtain a commercial license before \r
24  * incorporating FreeRTOS+FAT SL into proprietary software for distribution in \r
25  * any form.  Commercial licenses can be purchased from \r
26  * http://shop.freertos.org/fat_sl and do not require any source files to be \r
27  * changed.\r
28  *\r
29  * FreeRTOS+FAT SL is distributed in the hope that it will be useful.  You\r
30  * cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as\r
31  * is'.  FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the\r
32  * implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A\r
33  * PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all\r
34  * conditions and terms, be they implied, expressed, or statutory.\r
35  *\r
36  * http://www.FreeRTOS.org\r
37  * http://www.FreeRTOS.org/FreeRTOS-Plus\r
38  *\r
39  */\r
40 \r
41 #ifndef _API_MDRIVER_H_\r
42 #define _API_MDRIVER_H_\r
43 \r
44 #include "../version/ver_mdriver.h"\r
45 #if VER_MDRIVER_MAJOR != 1 || VER_MDRIVER_MINOR != 0\r
46  #error Incompatible MDRIVER version number!\r
47 #endif\r
48 \r
49 #ifdef __cplusplus\r
50 extern "C" {\r
51 #endif\r
52 \r
53 \r
54 typedef struct\r
55 {\r
56   unsigned short  number_of_cylinders;\r
57   unsigned short  sector_per_track;\r
58   unsigned short  number_of_heads;\r
59   unsigned long   number_of_sectors;\r
60   unsigned char   media_descriptor;\r
61 \r
62   unsigned short  bytes_per_sector;\r
63 } F_PHY;\r
64 \r
65 /* media descriptor to be set in getphy function */\r
66 #define F_MEDIADESC_REMOVABLE 0xf0\r
67 #define F_MEDIADESC_FIX       0xf8\r
68 \r
69 /* return bitpattern for driver getphy function */\r
70 #define F_ST_MISSING          0x00000001\r
71 #define F_ST_CHANGED          0x00000002\r
72 #define F_ST_WRPROTECT        0x00000004\r
73 \r
74 /* Driver definitions */\r
75 typedef struct F_DRIVER  F_DRIVER;\r
76 \r
77 typedef int           ( *F_WRITESECTOR )( F_DRIVER * driver, void * data, unsigned long sector );\r
78 typedef int           ( *F_READSECTOR )( F_DRIVER * driver, void * data, unsigned long sector );\r
79 typedef int           ( *F_GETPHY )( F_DRIVER * driver, F_PHY * phy );\r
80 typedef long          ( *F_GETSTATUS )( F_DRIVER * driver );\r
81 typedef void          ( *F_RELEASE )( F_DRIVER * driver );\r
82 \r
83 typedef struct F_DRIVER\r
84 {\r
85   unsigned long  user_data;     /* user defined data */\r
86   void         * user_ptr;      /* user define pointer */\r
87 \r
88   /* driver functions */\r
89   F_WRITESECTOR          writesector;\r
90   F_READSECTOR           readsector;\r
91   F_GETPHY               getphy;\r
92   F_GETSTATUS            getstatus;\r
93   F_RELEASE              release;\r
94 } _F_DRIVER;\r
95 \r
96 typedef F_DRIVER *( *F_DRIVERINIT )( unsigned long driver_param );\r
97 \r
98 #ifdef __cplusplus\r
99 }\r
100 #endif\r
101 \r
102 #endif /* _API_MDRIVER_H_ */\r
103 \r
104 \r