Moved out the handling of V2 Protocol parameters to a seperate set of files. Added parameter privellages, so that an error can be returned to the host when trying to perform a get/set value action on a parameter without the correct privellages.

This commit is contained in:
Dean Camera 2009-08-19 08:29:08 +00:00
parent 32cc2b8d4d
commit fa8beef82d
8 changed files with 242 additions and 92 deletions

View file

@ -45,30 +45,22 @@
#include <LUFA/Drivers/Peripheral/SPI.h>
#include "../Descriptors.h"
#include "V2ProtocolConstants.h"
#include "V2ProtocolConstants.h"
#include "V2ProtocolParams.h"
/* Macros: */
#define PROGRAMMER_ID "AVRISP_MK2"
#define PROGRAMMER_ID_LEN (sizeof(PROGRAMMER_ID) - 1)
/* Type Defines: */
typedef struct
{
uint8_t ParameterID;
uint8_t ParameterValue;
} ParameterItem_t;
#define PROGRAMMER_ID_LEN (sizeof(PROGRAMMER_ID) - 1)
#define MAX_SPI_SETTINGS 7
/* Function Prototypes: */
void V2Protocol_Init(void);
void V2Protocol_ProcessCommand(void);
#if defined(INCLUDE_FROM_V2PROTOCOL_C)
static void V2Protocol_ReconfigureSPI(void);
static void V2Protocol_ChangeTargetResetLine(bool ResetTarget);
static uint8_t V2Protocol_GetParameter(uint8_t ParamID);
static void V2Protocol_SetParameter(uint8_t ParamID, uint8_t Value);
static void V2Protocol_Command_Unknown(uint8_t V2Command);
static void V2Protocol_Command_SignOn(void);
static void V2Protocol_Command_GetSetParam(uint8_t V2Command);