HapticLib  0.7
Haptic Feedback Library for embedded systems
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
generic.h File Reference

Generic Pattern generator function header [TEMPLATE] More...

Go to the source code of this file.

Data Structures

struct  genericUserParameters
 Pattern specific user parameters type definition. More...
struct  genericStatusParameters
 Pattern specific status parameters type definition. More...

Typedefs

typedef enum genericIncrement genericIncrement
 User Parameter Values for increment user parameter.
typedef enum genericCheckParam genericCheckParam
 User Parameter Values for checkParam user parameter.
typedef struct
genericUserParameters 
genericUserParameters
 Pattern specific user parameters type definition.
typedef struct
genericStatusParameters 
genericStatusParameters
 Pattern specific status parameters type definition.

Enumerations

enum  genericIncrement { smallIncrement = 0, bigIncrement = 1 }
 User Parameter Values for increment user parameter. More...
enum  genericCheckParam { rightValue = 300000 }
 User Parameter Values for checkParam user parameter. More...

Detailed Description

Generic Pattern generator function header [TEMPLATE]

[TEMPLATE]

This is a template file; copy and rename it as starting point for the implementation of a new Pattern Generator.

Follow the structure of this example pattern (code and documentation formats) while implementing a new pattern generator.

Pattern specific constant definitions can be inserted here.

The pattern specific status parameters typedef is defined here.

The pattern specific user parameters typedef is defined here.

Note:
Neither of the two (status or user) typedef are formally necessary, a super simple pattern generator could even be implemented without the status parameters (but then it could be only externally stopped calling hl_stopPattern()).

Please use at least a status Parameter where the pattern progress is stored, to let the continuator keep track of itself and decide when to end the pattern and free the haptor(s).

Note:
Remember to use the associated module file too. For the template is:
  • generic.c: Documentation, initiator and continuator.
  • generic.h: Pattern specific definitions, user and status parameters definitions.
For your pattern they become:
  • mypattern.c: Documentation, initiator and continuator.
  • mypattern.h: Pattern specific definitions, user and status parameters definitions

[TEMPLATE]

Pattern specific constant definitions can be inserted here.

The pattern specific status parameters typedef is defined here.

The pattern specific user parameters typedef is defined here.

Authors:
Leonardo Guardati
Silvio Vallorani
Version:
v0.7
Date:
2012

Definition in file generic.h.


Typedef Documentation

User Parameter Values for checkParam user parameter.

This example show how to define the valid values for a user parameter. The name convention is as follow:

<pattern_name><parameter_name>

For example, the checkParam parameter for the Generic pattern accepts only one value:

  • rightValue: needed to start the pattern.

This is the enumeration used to hold this value.

User Parameter Values for increment user parameter.

This example show how to define the valid values for a user parameter. The name convention is as follow:

<pattern_name><parameter_name>

For example, the increment parameter for the Generic pattern accepts only two values:

  • smallIncrement: for slow ramps.
  • bigIncrements: for fast ramps.

This is the enumeration used to hold these two values.

Pattern specific status parameters type definition.

At least one parameter should be defined to help the continuator keep track of the pattern generation progress.

See also:
Refer to generic.c for a simple working example.

Pattern specific user parameters type definition.

This structure MUST be clearly documented to avoid pitfalls on the generator's use by the application code.

The user provided values, must be validated by the (preferably) pattern initiator before using them in the pattern logic.


Enumeration Type Documentation

User Parameter Values for checkParam user parameter.

This example show how to define the valid values for a user parameter. The name convention is as follow:

<pattern_name><parameter_name>

For example, the checkParam parameter for the Generic pattern accepts only one value:

  • rightValue: needed to start the pattern.

This is the enumeration used to hold this value.

Enumerator:
rightValue 

Definition at line 113 of file generic.h.

User Parameter Values for increment user parameter.

This example show how to define the valid values for a user parameter. The name convention is as follow:

<pattern_name><parameter_name>

For example, the increment parameter for the Generic pattern accepts only two values:

  • smallIncrement: for slow ramps.
  • bigIncrements: for fast ramps.

This is the enumeration used to hold these two values.

Enumerator:
smallIncrement 
bigIncrement 

Definition at line 93 of file generic.h.