]> git.sur5r.net Git - freertos/blob - FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/portable/Zynq/xsdps_info.h
Add the Labs projects provided in the V10.2.1_191129 zip file.
[freertos] / FreeRTOS-Labs / Source / FreeRTOS-Plus-FAT / portable / Zynq / xsdps_info.h
1 /******************************************************************************\r
2  *\r
3  * mmc_decode_cid() and sd_decode_csd()\r
4  *\r
5  * analyse the meta data of an SD-card to read its capacity and some other properties.\r
6  *\r
7  * CID and CSD Analysis borrowed from the Linux kernel.\r
8  *\r
9  ******************************************************************************/\r
10 \r
11 #ifndef SDPS_INFO_H_\r
12 \r
13 #define SDPS_INFO_H_  1\r
14 \r
15 #include <stdint.h>\r
16 \r
17 struct mmc_cid {\r
18         uint32_t        manfid;\r
19         char            prod_name[8];\r
20         uint32_t        serial;\r
21         uint16_t        oemid;\r
22         uint16_t        year;\r
23         uint8_t         hwrev;\r
24         uint8_t         fwrev;\r
25         uint8_t         month;\r
26 };\r
27 \r
28 struct mmc_csd {\r
29         volatile uint64_t       capacity_bytes;\r
30         uint32_t        sd_last_block_address;\r
31         uint8_t         mmca_vsn;\r
32         uint16_t        erase_size;\r
33         uint8_t         spare;\r
34         uint16_t        cmdclass;\r
35         uint16_t        tacc_clks;\r
36         int32_t         erase_shift;\r
37         uint32_t        tacc_ns;\r
38         uint32_t        r2w_factor;\r
39         uint32_t        max_dtr;\r
40         uint32_t        read_blkbits;\r
41         uint32_t        write_blkbits;\r
42         uint32_t        capacity;\r
43         uint32_t        pref_erase;\r
44         uint32_t        read_partial : 1,\r
45                                 read_misalign : 1,\r
46                                 write_partial : 1,\r
47                                 write_misalign : 1;\r
48 };\r
49 \r
50 extern struct mmc_cid myCID;\r
51 extern struct mmc_csd myCSD;\r
52 \r
53 int mmc_decode_cid( const struct mmc_csd *pxCSD, struct mmc_cid *pxCID, uint32_t *raw_data );\r
54 int sd_decode_csd( struct mmc_csd *pxCSD, uint32_t *ulResponse );\r
55 \r
56 #endif /* SDPS_INFO_H_ */\r