From b24866225a6301d3a663f874725e83c012dc25d3 Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Wed, 26 Dec 2012 17:36:00 +0100 Subject: digital/beacon: add bitcloud stack into common directory digital/zigbit --- .../drivers/USBClasses/MSD/include/mscProtocol.h | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 digital/zigbit/bitcloud/stack/Components/HAL/drivers/USBClasses/MSD/include/mscProtocol.h (limited to 'digital/zigbit/bitcloud/stack/Components/HAL/drivers/USBClasses/MSD/include/mscProtocol.h') diff --git a/digital/zigbit/bitcloud/stack/Components/HAL/drivers/USBClasses/MSD/include/mscProtocol.h b/digital/zigbit/bitcloud/stack/Components/HAL/drivers/USBClasses/MSD/include/mscProtocol.h new file mode 100644 index 00000000..aa5964ad --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/HAL/drivers/USBClasses/MSD/include/mscProtocol.h @@ -0,0 +1,79 @@ +/****************************************************************************//** + \file mscProtocol.h + + \brief Declaration of mass storage device protocol command. + + \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 _MSCPROTOCOL_H +#define _MSCPROTOCOL_H + +/****************************************************************************** + Includes section +******************************************************************************/ +#include +#include + +/****************************************************************************** + Define(s) section +******************************************************************************/ +// data size in request structure +#define MSC_REQUEST_DATA_SIZE 1 + +// request codes for mass storage class +#define BULK_ONLY_MASS_STORAGE_RESET 0xFF +#define GET_MAX_LUN 0xFE +// maximum size of CBW data +#define CBW_DATA_SIZE 16 + +/****************************************************************************** + Types section +******************************************************************************/ +BEGIN_PACK +typedef struct PACK +{ + UsbRequest_t request; + uint8_t bData[MSC_REQUEST_DATA_SIZE]; +} UsbMscRequest_t; +// MSC command block wrapper (CBW) +typedef struct PACK +{ + uint32_t dCBWSignature; + uint32_t cDBWTag; + uint32_t dCBWDataTransferLength; + uint8_t bmCBWFlags; + uint8_t bCBWLUN; + uint8_t bCBWCBLength; + uint8_t CBWCB[CBW_DATA_SIZE]; +} MscCBW_t; +// MSC command status wrapper (CSW) +typedef struct PACK +{ + uint32_t dCSWSignature; + uint32_t cDSWTag; + uint32_t dCSWDataResidue; + uint8_t bCSWStatus; +} MscCSW_t; +END_PACK + +/****************************************************************************** + Prototypes section +******************************************************************************/ +/**************************************************************************//** +\brief Mass storage device request handler. +\param[in] + data - pointer to host's request. +******************************************************************************/ +void msdRequestHandler(uint8_t *data); + +#endif /* _MSCPROTOCOL_H */ +// eof msdProtocol.h \ No newline at end of file -- cgit v1.2.3