mass.h 1.5 KB
Newer Older
还_没_想_好's avatar
还_没_想_好 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
/*
 * File      : mass.h
 * This file is part of RT-Thread RTOS
 * COPYRIGHT (C) 2011, RT-Thread Development Team
 *
 * The license and distribution terms for this file may be
 * found in the file LICENSE in this distribution or at
 * http://www.rt-thread.org/license/LICENSE
 *
 * Change Logs:
 * Date           Author       Notes
 * 2011-12-12     Yi Qiu      first version
 */

#ifndef __MASS_H__
#define __MASS_H__

#include <rtthread.h>
#include "dfs_fs.h"

#define MAX_PARTITION_COUNT        4
#define SECTOR_SIZE                512

struct ustor_data
{
    struct dfs_partition part;
lymzzyh's avatar
lymzzyh 已提交
27
    struct uhintf* intf;
还_没_想_好's avatar
还_没_想_好 已提交
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
    int udisk_id;
    const char path;
};

struct ustor
{
    upipe_t pipe_in;
    upipe_t pipe_out;
    rt_uint32_t capicity[2];
    
    struct rt_device dev[MAX_PARTITION_COUNT];
    rt_uint8_t dev_cnt;
};    
typedef struct ustor* ustor_t;

lymzzyh's avatar
lymzzyh 已提交
43 44 45
rt_err_t rt_usbh_storage_get_max_lun(struct uhintf* intf, rt_uint8_t* max_lun);
rt_err_t rt_usbh_storage_reset(struct uhintf* intf);
rt_err_t rt_usbh_storage_read10(struct uhintf* intf, rt_uint8_t *buffer, 
还_没_想_好's avatar
还_没_想_好 已提交
46
    rt_uint32_t sector, rt_size_t count, int timeout);
lymzzyh's avatar
lymzzyh 已提交
47
rt_err_t rt_usbh_storage_write10(struct uhintf* intf, rt_uint8_t *buffer, 
还_没_想_好's avatar
还_没_想_好 已提交
48
    rt_uint32_t sector, rt_size_t count, int timeout);
lymzzyh's avatar
lymzzyh 已提交
49 50 51 52
rt_err_t rt_usbh_storage_request_sense(struct uhintf* intf, rt_uint8_t* buffer);
rt_err_t rt_usbh_storage_test_unit_ready(struct uhintf* intf);
rt_err_t rt_usbh_storage_inquiry(struct uhintf* intf, rt_uint8_t* buffer);
rt_err_t rt_usbh_storage_get_capacity(struct uhintf* intf, rt_uint8_t* buffer);
还_没_想_好's avatar
还_没_想_好 已提交
53 54

#endif