/******************************************************************************
*
*  System Name : ARM USB Mass Storage Library
*  File Name   : usb_hmscd_rza1.h
*  Contents    : Definitions for USB Mass Storage Class Driver
*  Version     : 0.00.01
*  Device      : ARM
*  Tool-Chain  : 
*  OS          : 
*
*  Note        : 
*                     
*  Copyright (C) 2014 Renesas Electronics Corporation and 
*  Renesas Solutions Corp. All rights reserved.
*
*  History     : Feb.12,2014 Ver.0.00.01
******************************************************************************/
#ifndef __USB_HMSCD_RZA1_H__
#define __USB_HMSCD_RZA1_H__


/*******************************************************************************
Includes   <System Includes> , "Project Includes"
*******************************************************************************/
#include "usb_hdrv_rza1.h"


/*******************************************************************************
Macro definitions
*******************************************************************************/
#define        USB_HMSCD_MAX_ADDRESS                 5

#define        USB_HMSCD_SUCCESS_CSW_PHASE_ERROR     11
#define        USB_HMSCD_NO_MEDIA                    10
#define        USB_HMSCD_SUCCESS                     USB_SUCCESS
#define        USB_HMSCD_ERROR                       USB_ERROR
#define        USB_HMSCD_STALL                       USB_STALL
#define        USB_HMSCD_TIMEOUT                     USB_TIMEOUT
#define        USB_HMSCD_NAK_TIMEOUT                 USB_NAK_TIMEOUT
#define        USB_HMSCD_TAGERR                      -10
#define        USB_HMSCD_DETACH                      USB_DETACH_ERR
#define        USB_HMSCD_SETUP_ERR                   USB_SETUP_ERR
#define        USB_HMSCD_CTRL_COM_ERR                USB_CTRL_COM_ERR
#define        USB_HMSCD_COM_ERR                     USB_COM_ERR
#define        USB_HMSCD_DEV_ADDR_ERR                USB_DEV_ADDR_ERR
#define        USB_HMSCD_TYPE_ERROR                  -11
#define        USB_HMSCD_BUSY                        -12

#define        USB_HMSCD_YES                         1
#define        USB_HMSCD_NO                          0

#define        USB_HMSCD_CSW_PASS                    0
#define        USB_HMSCD_CSW_FAIL                    1
#define        USB_HMSCD_CSW_PHASE_ERROR             2

#define        USB_HMSCD_CMD_TEST_UNIT_READY         0x00u
#define        USB_HMSCD_CMD_REQUEST_SENSE           0x03u
#define        USB_HMSCD_CMD_INQUIRY                 0x12u
#define        USB_HMSCD_CMD_READ_CAPACITY           0x25u
#define        USB_HMSCD_CMD_READ10                  0x28u
#define        USB_HMSCD_CMD_WRITE10                 0x2au

#define        USB_HMSCD_PDT_DIRECT                  0x00
#define        USB_HMSCD_PDT_SEQUENTIAL              0x01
#define        USB_HMSCD_PDT_WRITEONCE               0x04
#define        USB_HMSCD_PDT_CDROM                   0x05
#define        USB_HMSCD_PDT_OPTICAL                 0x07
#define        USB_HMSCD_PDT_UNKNOWN                 0x1F


/*******************************************************************************
Typedef definitions
*******************************************************************************/
typedef struct
{
    USB_HOST_CFG_PIPETBL_t    *pipe_table;
    uint32_t                  time_out;
} USB_HMSCD_REGIST_t;

typedef struct
{
    uint16_t    device_address;
    uint16_t    unit_number;
    uint8_t     *buffer;
    uint32_t    sector_number;
    uint32_t    sector_count;
    uint32_t    transfer_bytes;
} USB_HMSCD_RW_t;

typedef struct
{
    uint16_t    device_address;
    uint16_t    unit_number;
    uint8_t     *command;
    uint32_t    cmd_bytes;
    uint16_t    dir;
    uint8_t     *buffer;
    uint32_t    transfer_bytes;
} USB_HMSCD_USER_CTRL_t;


/*******************************************************************************
Variable Externs
*******************************************************************************/


/*******************************************************************************
Functions Prototypes
*******************************************************************************/


#include "usb0_hmscd_rza1.h"


#endif /* __USB_HMSCD_RZA1_H__ */

/* End of file */
