summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/HAL/drivers/include/massStorageDevice.h
blob: f8957a90501c133c7a3ca85c13faedcd325d66c2 (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/****************************************************************************//**
  \file massStorageDevice.h

  \brief The header file describes the interface of the mass storage device

  \author
    Atmel Corporation: http://www.atmel.com \n
    Support email: avr@atmel.com

  Copyright (c) 2008-2011, Atmel Corporation. All rights reserved.
  Licensed under Atmel's Limited License Agreement (BitCloudTM).

  \internal
  History:
    29/08/11 N. Fomin - Created
*******************************************************************************/
#ifndef _MASSSTORAGEDEVICE_H
#define _MASSSTORAGEDEVICE_H

/******************************************************************************
                   Includes section
******************************************************************************/
#include <types.h>

/******************************************************************************
                   Define(s) section
******************************************************************************/
#define MSD_TRANSMIT_PIPE      5
#define MSD_RECEIVE_PIPE       6

/******************************************************************************
                   Types section
******************************************************************************/
/** \brief Status messages for upper layer about msd status */
typedef enum
{
  MSD_STATUS_SUCCESS = 0,
  MSD_INTERFACE_BUSY,
  MSD_MEMORY_INIT_ERROR,
  MSD_READ_CAPACITY_ERROR,
  MSD_READ_ERROR,
  MSD_WRITE_ERROR
} MSD_Status_t;

typedef void (* MSD_Callback_t)(MSD_Status_t);

/******************************************************************************
                   Prototypes section
******************************************************************************/
/**************************************************************************//**
\brief Opens mass storage device.
\param[in]
  callback - pointer to function to notify about MSD errors and transactions;
  responseBuffer - pointer to hsmci command response buffer; it should have
                   a size of four;
  buffer - pointer to buffer for hsmci data transfer; it should be
           a multiplier of 512;
  length - length of buffer for data transfer.
\return
  nothing
******************************************************************************/
void MSD_Open(MSD_Callback_t callback, uint32_t *responseBuffer, uint8_t *buffer, uint32_t length);

/**************************************************************************//**
\brief Closes mass storage device.
\return
  nothing
******************************************************************************/
void MSD_Close(void);

#endif /* _MASSSTORAGEDEVICE_H */