Doxygen fixes to \param directives to give data direction in all projects. Make HID item filtering routines clearer in the HID WithParser demos.

pull/1469/head
Dean Camera 15 years ago
parent 573a27d90a
commit 409c49f057

@ -251,20 +251,15 @@ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8
* we aren't interested in (preventing us from being able to extract them later on, but saving on the RAM they would
* have occupied).
*
* \param CurrentItemAttributes Pointer to the attrbutes of the item the HID report parser is currently working with
* \param[in] CurrentItemAttributes Pointer to the attrbutes of the item the HID report parser is currently working with
*
* \return Boolean true if the item should be stored into the HID report structure, false if it should be discarded
*/
bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_Attributes_t* CurrentItemAttributes)
{
/* Check the attributes of the current item - see if we are interested in it or not */
if (CurrentItemAttributes->Usage.Page == USAGE_PAGE_KEYBOARD)
{
/* Only store KEYBOARD usage page items into the Processed HID Report structure to save RAM */
return true;
}
else
{
return false;
}
/* Check the attributes of the current item - see if we are interested in it or not;
* only store KEYBOARD usage page items into the Processed HID Report structure to
* save RAM and ignore the rest
*/
return (CurrentItemAttributes->Usage.Page == USAGE_PAGE_KEYBOARD)
}

@ -250,21 +250,16 @@ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8
* we aren't interested in (preventing us from being able to extract them later on, but saving on the RAM they would
* have occupied).
*
* \param CurrentItemAttributes Pointer to the attrbutes of the item the HID report parser is currently working with
* \param[in] CurrentItemAttributes Pointer to the attrbutes of the item the HID report parser is currently working with
*
* \return Boolean true if the item should be stored into the HID report structure, false if it should be discarded
*/
bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_Attributes_t* CurrentItemAttributes)
{
/* Check the attributes of the current item - see if we are interested in it or not */
if ((CurrentItemAttributes->Usage.Page == USAGE_PAGE_BUTTON) ||
/* Check the attributes of the current item - see if we are interested in it or not;
* only store BUTTON and GENERIC_DESKTOP_CONTROL items into the Processed HID Report
* structure to save RAM and ignore the rest
*/
return ((CurrentItemAttributes->Usage.Page == USAGE_PAGE_BUTTON) ||
(CurrentItemAttributes->Usage.Page == USAGE_PAGE_GENERIC_DCTRL))
{
/* Only store BUTTON and GENERIC_DESKTOP_CONTROL items into the Processed HID Report structure to save RAM */
return true;
}
else
{
return false;
}
}

@ -75,20 +75,15 @@ uint8_t GetHIDReportData(void)
* we aren't interested in (preventing us from being able to extract them later on, but saving on the RAM they would
* have occupied).
*
* \param CurrentItemAttributes Pointer to the attrbutes of the item the HID report parser is currently working with
* \param[in] CurrentItemAttributes Pointer to the attrbutes of the item the HID report parser is currently working with
*
* \return Boolean true if the item should be stored into the HID report structure, false if it should be discarded
*/
bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_Attributes_t* CurrentItemAttributes)
{
/* Check the attributes of the current item - see if we are interested in it or not */
if (CurrentItemAttributes->Usage.Page == USAGE_PAGE_KEYBOARD)
{
/* Only store KEYBOARD usage page items into the Processed HID Report structure to save RAM */
return true;
}
else
{
return false;
}
/* Check the attributes of the current item - see if we are interested in it or not;
* only store KEYBOARD usage page items into the Processed HID Report structure to
* save RAM and ignore the rest
*/
return (CurrentItemAttributes->Usage.Page == USAGE_PAGE_KEYBOARD)
}

@ -75,21 +75,16 @@ uint8_t GetHIDReportData(void)
* we aren't interested in (preventing us from being able to extract them later on, but saving on the RAM they would
* have occupied).
*
* \param CurrentItemAttributes Pointer to the attrbutes of the item the HID report parser is currently working with
* \param[in] CurrentItemAttributes Pointer to the attrbutes of the item the HID report parser is currently working with
*
* \return Boolean true if the item should be stored into the HID report structure, false if it should be discarded
*/
bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_Attributes_t* CurrentItemAttributes)
{
/* Check the attributes of the current item - see if we are interested in it or not */
if ((CurrentItemAttributes->Usage.Page == USAGE_PAGE_BUTTON) ||
/* Check the attributes of the current item - see if we are interested in it or not;
* only store BUTTON and GENERIC_DESKTOP_CONTROL items into the Processed HID Report
* structure to save RAM and ignore the rest
*/
return ((CurrentItemAttributes->Usage.Page == USAGE_PAGE_BUTTON) ||
(CurrentItemAttributes->Usage.Page == USAGE_PAGE_GENERIC_DCTRL))
{
/* Only store BUTTON and GENERIC_DESKTOP_CONTROL items into the Processed HID Report structure to save RAM */
return true;
}
else
{
return false;
}
}

@ -81,9 +81,11 @@
#define __GET_DATAFLASH_MASK(x) __GET_DATAFLASH_MASK2(DATAFLASH_CHIP,x)
#endif
/* Retrieves the Dataflash chip select mask for the given Dataflash chip index.
/** Retrieves the Dataflash chip select mask for the given Dataflash chip index.
*
* \param index Index of the dataflash chip mask to retrieve
* \param[in] index Index of the dataflash chip mask to retrieve
*
* \return Mask for the given Dataflash chip's /CS pin
*/
#define DATAFLASH_CHIP_MASK(index) __GET_DATAFLASH_MASK(index)

@ -288,7 +288,7 @@
* HID_ReportInfo_t structure. This can be used to filter only those items the application will be using, so that
* no RAM is wasted storing the attributes for report items which will never be referenced by the application.
*
* \param CurrentItemAttributes Pointer to the current report item attributes for user checking
* \param[in] CurrentItemAttributes Pointer to the current report item attributes for user checking
*
* \return Boolean true if the item should be stored into the HID_ReportInfo_t structure, false if it should be ignored
*/

@ -334,7 +334,7 @@
/** Sets the direction of the currently selected endpoint.
*
* \param DirectionMask New endpoint direction, as a ENDPOINT_DIR_* mask.
* \param[in] DirectionMask New endpoint direction, as a ENDPOINT_DIR_* mask.
*/
static inline void Endpoint_SetEndpointDirection(uint8_t DirectionMask);
#else

@ -805,7 +805,7 @@
/** Determines if a pipe has been bound to the given device endpoint address. If a pipe which is bound to the given
* endpoint is found, it is automatically selected.
*
* \param EndpointAddress Address of the endpoint within the attached device to check
* \param[in] EndpointAddress Address of the endpoint within the attached device to check
*
* \return Boolean true if a pipe bound to the given endpoint address is found, false otherwise
*/

@ -101,7 +101,7 @@ void V2Protocol_ProcessCommand(void)
/** Handler for unknown V2 protocol commands. This discards all sent data and returns a
* STATUS_CMD_UNKNOWN status back to the host.
*
* \param V2Command Issued V2 Protocol command byte from the host
* \param[in] V2Command Issued V2 Protocol command byte from the host
*/
static void V2Protocol_Command_Unknown(uint8_t V2Command)
{
@ -136,7 +136,7 @@ static void V2Protocol_Command_SignOn(void)
/** Handler for the CMD_SET_PARAMETER and CMD_GET_PARAMETER commands from the host, setting or
* getting a device parameter's value from the parameter table.
*
* \param V2Command Issued V2 Protocol command byte from the host
* \param[in] V2Command Issued V2 Protocol command byte from the host
*/
static void V2Protocol_Command_GetSetParam(uint8_t V2Command)
{
@ -289,7 +289,7 @@ static void V2Protocol_Command_LeaveISPMode(void)
/** Handler for the CMD_PROGRAM_FLASH_ISP and CMD_PROGRAM_EEPROM_ISP commands, writing out bytes,
* words or pages of data to the attached device.
*
* \param V2Command Issued V2 Protocol command byte from the host
* \param[in] V2Command Issued V2 Protocol command byte from the host
*/
static void V2Protocol_Command_ProgramMemory(uint8_t V2Command)
{
@ -425,7 +425,7 @@ static void V2Protocol_Command_ProgramMemory(uint8_t V2Command)
/** Handler for the CMD_READ_FLASH_ISP and CMD_READ_EEPROM_ISP commands, reading in bytes,
* words or pages of data from the attached device.
*
* \param V2Command Issued V2 Protocol command byte from the host
* \param[in] V2Command Issued V2 Protocol command byte from the host
*/
static void V2Protocol_Command_ReadMemory(uint8_t V2Command)
{
@ -516,7 +516,7 @@ static void V2Protocol_Command_ChipErase(void)
/** Handler for the CMD_READ_FUSE_ISP, CMD_READ_LOCK_ISP, CMD_READ_SIGNATURE_ISP and CMD_READ_OSCCAL commands,
* reading the requested configuration byte from the device.
*
* \param V2Command Issued V2 Protocol command byte from the host
* \param[in] V2Command Issued V2 Protocol command byte from the host
*/
static void V2Protocol_Command_ReadFuseLockSigOSCCAL(uint8_t V2Command)
{
@ -546,7 +546,7 @@ static void V2Protocol_Command_ReadFuseLockSigOSCCAL(uint8_t V2Command)
/** Handler for the CMD_WRITE_FUSE_ISP and CMD_WRITE_LOCK_ISP commands, writing the requested configuration
* byte to the device.
*
* \param V2Command Issued V2 Protocol command byte from the host
* \param[in] V2Command Issued V2 Protocol command byte from the host
*/
static void V2Protocol_Command_WriteFuseLock(uint8_t V2Command)
{

@ -108,7 +108,7 @@ void V2Params_UpdateParamValues(void)
* be called before calls to \ref V2Params_GetParameterValue() or \ref V2Params_SetParameterValue() when
* getting or setting parameter values in response to requests from the host.
*
* \param ParamID Parameter ID whose privellages are to be retrieved from the table
* \param[in] ParamID Parameter ID whose privellages are to be retrieved from the table
*
* \return Privellages for the requested parameter, as a mask of PARAM_PRIV_* masks
*/
@ -124,7 +124,7 @@ uint8_t V2Params_GetParameterPrivellages(uint8_t ParamID)
/** Retrieves the current value for a given parameter in the parameter table.
*
* \param ParamID Parameter ID whose value is to be retrieved from the table
* \param[in] ParamID Parameter ID whose value is to be retrieved from the table
*
* \return Current value of the parameter in the table, or 0 if not found
*/
@ -140,8 +140,8 @@ uint8_t V2Params_GetParameterValue(uint8_t ParamID)
/** Sets the value for a given parameter in the parameter table.
*
* \param ParamID Parameter ID whose value is to be set in the table
* \param Value New value to set the parameter to
* \param[in] ParamID Parameter ID whose value is to be set in the table
* \param[in] Value New value to set the parameter to
*
* \return Pointer to the associated parameter information from the parameter table if found, NULL otherwise
*/
@ -162,7 +162,7 @@ void V2Params_SetParameterValue(uint8_t ParamID, uint8_t Value)
/** Retrieves a parameter entry (including ID, value and privellages) from the parameter table that matches the given
* parameter ID.
*
* \param ParamID Parameter ID to find in the table
* \param[in] ParamID Parameter ID to find in the table
*
* \return Pointer to the associated parameter information from the parameter table if found, NULL otherwise
*/

@ -79,7 +79,7 @@ uint8_t V2Protocol_GetSPIPrescalerMask(void)
/** Asserts or deasserts the target's reset line, using the correct polarity as set by the host using a SET PARAM command.
* When not asserted, the line is tristated so as not to intefere with normal device operation.
*
* \param ResetTarget Boolean true when the target should be held in reset, false otherwise
* \param[in] ResetTarget Boolean true when the target should be held in reset, false otherwise
*/
void V2Protocol_ChangeTargetResetLine(bool ResetTarget)
{
@ -100,11 +100,11 @@ void V2Protocol_ChangeTargetResetLine(bool ResetTarget)
/** Waits until the last issued target memory programming command has completed, via the check mode given and using
* the given parameters.
*
* \param ProgrammingMode Programming mode used and completion check to use, a mask of PROG_MODE_* constants
* \param PollAddress Memory address to poll for completion if polling check mode used
* \param PollValue Poll value to check against if polling check mode used
* \param DelayMS Milliseconds to delay before returning if delay check mode used
* \param ReadMemCommand Device low-level READ MEMORY command to send if value check mode used
* \param[in] ProgrammingMode Programming mode used and completion check to use, a mask of PROG_MODE_* constants
* \param[in] PollAddress Memory address to poll for completion if polling check mode used
* \param[in] PollValue Poll value to check against if polling check mode used
* \param[in] DelayMS Milliseconds to delay before returning if delay check mode used
* \param[in] ReadMemCommand Device low-level READ MEMORY command to send if value check mode used
*
* \return V2 Protocol status \ref STATUS_CMD_OK if the no timeout occurred, \ref STATUS_RDY_BSY_TOUT or
* \ref STATUS_CMD_TOUT otherwise

@ -60,7 +60,7 @@
/* Inline Functions: */
/** Blocking delay for a given number of milliseconds, via a hardware timer.
*
* \param DelayMS Number of milliseconds to delay for
* \param[in] DelayMS Number of milliseconds to delay for
*/
static inline void V2Protocol_DelayMS(uint8_t DelayMS)
{

Loading…
Cancel
Save