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/DFU/include/dfuProtocol.h | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 digital/zigbit/bitcloud/stack/Components/HAL/drivers/USBClasses/DFU/include/dfuProtocol.h (limited to 'digital/zigbit/bitcloud/stack/Components/HAL/drivers/USBClasses/DFU/include/dfuProtocol.h') diff --git a/digital/zigbit/bitcloud/stack/Components/HAL/drivers/USBClasses/DFU/include/dfuProtocol.h b/digital/zigbit/bitcloud/stack/Components/HAL/drivers/USBClasses/DFU/include/dfuProtocol.h new file mode 100644 index 00000000..c525cfd1 --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/HAL/drivers/USBClasses/DFU/include/dfuProtocol.h @@ -0,0 +1,81 @@ +/****************************************************************************//** + \file dfuProtocol.h + + \brief Declaration of Device firmware upgrade commands. + + \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: + 08/09/11 N. Fomin - Created +*******************************************************************************/ +#ifndef _DFUPROTOCOL_H +#define _DFUPROTOCOL_H + +/****************************************************************************** + Includes section +******************************************************************************/ +#include +#include + +/****************************************************************************** + Define(s) section +******************************************************************************/ +// data size in request structure +#define DFU_REQUEST_DATA_SIZE 6 +// request codes for mass storage class +#define DFU_DETACH 0x00 +#define DFU_GETSTATUS 0x03 +#define DFU_GETSTATE 0x05 + +/****************************************************************************** + Types section +******************************************************************************/ +BEGIN_PACK +// Usb host request +typedef struct PACK +{ + UsbRequest_t request; + uint8_t bData[DFU_REQUEST_DATA_SIZE]; +} UsbDfuRequest_t; + +// Usb dfu get status response +typedef struct PACK +{ + uint8_t bStatus; + uint8_t bPollTimeout[3]; + uint8_t bState; + uint8_t iString; +} DfuGetStatusResponse_t; + +// Usb dfu get state response +typedef struct PACK +{ + uint8_t bState; +} DfuGetStateResponse_t; + +typedef union PACK +{ + DfuGetStatusResponse_t getStatusResponse; + DfuGetStateResponse_t getStateResponse; +} UsbDfuResponse_t; + +END_PACK + +/****************************************************************************** + Prototypes section +******************************************************************************/ +/**************************************************************************//** +\brief Device firmware upgrade request handler. +\param[in] + data - pointer to host's request. +******************************************************************************/ +void dfuRequestHandler(uint8_t *data); + +#endif /* _DFUPROTOCOL_H */ +// eof dfuProtocol.h \ No newline at end of file -- cgit v1.2.3