Skip to content

Commit

Permalink
docs: doxygen docs for enums in Bean.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Stack committed Dec 2, 2016
1 parent 5e5e071 commit 4946166
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 63 deletions.
105 changes: 52 additions & 53 deletions hardware/bean/avr/cores/bean/Bean.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,67 +6,66 @@
#include "BeanAncs.h"
#include "bma250.h"

/*
* An accelerometer interrupt type, they are as follows:
* FLAT_EVENT - triggers when the accelerometer is lying flat on a surface
* ORIENT_EVENT - triggers when the accelerometer is NOT lying flat on a surface, but is tilted * in any direction
* SINGLE_TAP_EVENT - triggers when the accelerometer is tapped once
* DOUBLE_TAP_EVENT - triggers when the accelerometer is tapped twice
* ANY_MOTION_EVENT - triggers when the accelerometer experiences any change in motion
* HIGH_G_EVENT - triggers when the accelerometer experiences a velocity event higher than it's * sensitivity
* LOW_G_EVENT - triggers when the accelerometer is in free fall or experiences no gravitational * pull
/**
* Accelerometer interrupt types
*/
typedef enum AccelEventTypes {
FLAT_EVENT = 0x80,
ORIENT_EVENT = 0x40,
SINGLE_TAP_EVENT = 0x20,
DOUBLE_TAP_EVENT = 0x10,
ANY_MOTION_EVENT = 0x04,
HIGH_G_EVENT = 0x02,
LOW_G_EVENT = 0x01
FLAT_EVENT = 0x80, /**< triggers when the accelerometer is lying flat on a surface */
ORIENT_EVENT = 0x40, /**< triggers when the accelerometer is NOT lying flat on a surface, but is tilted * in any direction */
SINGLE_TAP_EVENT = 0x20, /**< triggers when the accelerometer is tapped once */
DOUBLE_TAP_EVENT = 0x10, /**< triggers when the accelerometer is tapped twice */
ANY_MOTION_EVENT = 0x04, /**< triggers when the accelerometer experiences any change in motion */
HIGH_G_EVENT = 0x02, /**< triggers when the accelerometer experiences a velocity event higher than it's * sensitivity */
LOW_G_EVENT = 0x01 /**< triggers when the accelerometer is in free fall or experiences no gravitational * pull */
};

/**
* Advertisement data types
*/
typedef enum AdvertisementDataTypes {
GAP_ADTYPE_FLAGS = 0x01, // Discovery Mode: @ref GAP_ADTYPE_FLAGS_MODES
GAP_ADTYPE_16BIT_MORE = 0x02, // Service: More 16-bit UUIDs available
GAP_ADTYPE_16BIT_COMPLETE = 0x03, // Service: Complete list of 16-bit UUIDs
GAP_ADTYPE_32BIT_MORE = 0x04, // Service: More 32-bit UUIDs available
GAP_ADTYPE_32BIT_COMPLETE = 0x05, // Service: Complete list of 32-bit UUIDs
GAP_ADTYPE_128BIT_MORE = 0x06, // Service: More 128-bit UUIDs available
GAP_ADTYPE_128BIT_COMPLETE = 0x07, // Service: Complete list of 128-bit UUIDs
GAP_ADTYPE_LOCAL_NAME_SHORT = 0x08, // Shortened local name
GAP_ADTYPE_LOCAL_NAME_COMPLETE = 0x09, // Complete local name
GAP_ADTYPE_POWER_LEVEL = 0x0A, // TX Power Level: 0xXX: -127 to +127 dBm
GAP_ADTYPE_OOB_CLASS_OF_DEVICE = 0x0D, // Simple Pairing OOB Tag: Class
// of device (3 octets)
GAP_ADTYPE_OOB_SIMPLE_PAIRING_HASHC = 0x0E, // Simple Pairing OOB Tag: Simple Pairing
// Hash C (16 octets)
GAP_ADTYPE_OOB_SIMPLE_PAIRING_RANDR = 0x0F, // Simple Pairing OOB Tag: Simple Pairing
// Randomizer R (16 octets)
GAP_ADTYPE_SM_TK = 0x10, // Security Manager TK Value
GAP_ADTYPE_SM_OOB_FLAG = 0x11, // Secutiry Manager OOB Flags
GAP_ADTYPE_SLAVE_CONN_INTERVAL_RANGE = 0x12, // Min and Max values of the connection
// interval
// (2 octets Min, 2 octets Max) (0xFFFF
// indicates no conn interval min or max)
GAP_ADTYPE_SIGNED_DATA = 0x13, // Signed Data field
GAP_ADTYPE_SERVICES_LIST_16BIT = 0x14, // Service Solicitation:
// list of 16-bit Service UUIDs
GAP_ADTYPE_SERVICES_LIST_128BIT = 0x15, // Service Solicitation:
// list of 128-bit Service UUIDs
GAP_ADTYPE_SERVICE_DATA = 0x16, // Service Data
GAP_ADTYPE_APPEARANCE = 0x19, // Appearance
GAP_ADTYPE_MANUFACTURER_SPECIFIC = 0xFF, // Manufacturer Specific Data:
// first 2 octets contain
// the Company Identifier Code
// followed by the additional
// manufacturer specific data
GAP_ADTYPE_FLAGS = 0x01, /**< Discovery Mode: @ref GAP_ADTYPE_FLAGS_MODES */
GAP_ADTYPE_16BIT_MORE = 0x02, /**< Service: More 16-bit UUIDs available */
GAP_ADTYPE_16BIT_COMPLETE = 0x03, /**< Service: Complete list of 16-bit UUIDs */
GAP_ADTYPE_32BIT_MORE = 0x04, /**< Service: More 32-bit UUIDs available */
GAP_ADTYPE_32BIT_COMPLETE = 0x05, /**< Service: Complete list of 32-bit UUIDs */
GAP_ADTYPE_128BIT_MORE = 0x06, /**< Service: More 128-bit UUIDs available */
GAP_ADTYPE_128BIT_COMPLETE = 0x07, /**< Service: Complete list of 128-bit UUIDs */
GAP_ADTYPE_LOCAL_NAME_SHORT = 0x08, /**< Shortened local name */
GAP_ADTYPE_LOCAL_NAME_COMPLETE = 0x09, /**< Complete local name */
GAP_ADTYPE_POWER_LEVEL = 0x0A, /**< TX Power Level: 0xXX: -127 to +127 dBm */
GAP_ADTYPE_OOB_CLASS_OF_DEVICE = 0x0D, /**< Simple Pairing OOB Tag: Class */
/**< of device (3 octets) */
GAP_ADTYPE_OOB_SIMPLE_PAIRING_HASHC = 0x0E, /**< Simple Pairing OOB Tag: Simple Pairing */
/**< Hash C (16 octets) */
GAP_ADTYPE_OOB_SIMPLE_PAIRING_RANDR = 0x0F, /**< Simple Pairing OOB Tag: Simple Pairing */
/**< Randomizer R (16 octets) */
GAP_ADTYPE_SM_TK = 0x10, /**< Security Manager TK Value */
GAP_ADTYPE_SM_OOB_FLAG = 0x11, /**< Secutiry Manager OOB Flags */
GAP_ADTYPE_SLAVE_CONN_INTERVAL_RANGE = 0x12, /**< Min and Max values of the connection */
/**< interval */
/**< (2 octets Min, 2 octets Max) (0xFFFF */
/**< indicates no conn interval min or max) */
GAP_ADTYPE_SIGNED_DATA = 0x13, /**< Signed Data field */
GAP_ADTYPE_SERVICES_LIST_16BIT = 0x14, /**< Service Solicitation: */
/**< list of 16-bit Service UUIDs */
GAP_ADTYPE_SERVICES_LIST_128BIT = 0x15, /**< Service Solicitation: */
/**< list of 128-bit Service UUIDs */
GAP_ADTYPE_SERVICE_DATA = 0x16, /**< Service Data */
GAP_ADTYPE_APPEARANCE = 0x19, /**< Appearance */
GAP_ADTYPE_MANUFACTURER_SPECIFIC = 0xFF, /**< Manufacturer Specific Data: */
/**< first 2 octets contain */
/**< the Company Identifier Code */
/**< followed by the additional */
/**< manufacturer specific data */
};

/**
* Advertisement Type
*/
typedef enum AdvertisementType {
GAP_ADTYPE_FLAGS_LIMITED = 0x01, // Discovery Mode: LE Limited Discoverable Mode
GAP_ADTYPE_FLAGS_GENERAL = 0x02, // Discovery Mode: LE General Discoverable Mode
GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED = 0x04, // Discovery Mode: BR/EDR Not Supported
GAP_ADTYPE_FLAGS_LIMITED = 0x01, /**< Discovery Mode: LE Limited Discoverable Mode */
GAP_ADTYPE_FLAGS_GENERAL = 0x02, /**< Discovery Mode: LE General Discoverable Mode */
GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED = 0x04, /**< Discovery Mode: BR/EDR Not Supported */
};


Expand Down
26 changes: 16 additions & 10 deletions hardware/bean/avr/cores/bean/BeanHID.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@


#ifndef __BEANHID__
#define __BEANHID__

#include "BeanSerialTransport.h"

typedef enum {
/** Enumeration of mouse buttons
*/
typedef enum mouseButtons{
MOUSE_LEFT = 1,
MOUSE_RIGHT = 2,
MOUSE_MIDDLE = 4,
MOUSE_ALL = (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE)
} mouseButtons;
};

/** Enumeration of modifier keys
*/
typedef enum {
KEY_LEFT_CTRL = 0x80,
KEY_LEFT_SHIFT = 0x81,
Expand All @@ -21,7 +23,6 @@ typedef enum {
KEY_RIGHT_SHIFT = 0x85,
KEY_RIGHT_ALT = 0x86,
KEY_RIGHT_GUI = 0x87,

KEY_UP_ARROW = 0xDA,
KEY_DOWN_ARROW = 0xD9,
KEY_LEFT_ARROW = 0xD8,
Expand Down Expand Up @@ -51,8 +52,8 @@ typedef enum {
KEY_F12 = 0xCD
} modifierKey;

// HID Consumer Usage IDs (subset of the codes available in the USB HID Usage
// Tables spec)
/** HID Consumer Usage IDs (subset of the codes available in the USB HID Usage Tables spec)
*/
typedef enum {
POWER = 0x30,
ASSIGN_SEL = 0x81,
Expand All @@ -72,16 +73,21 @@ typedef enum {
MUTE = 0xE2
} mediaControl;

// Low level key report: up to 6 keys and shift, ctrl etc at once
/** Low level key report: up to 6 keys and shift, ctrl etc at once
*/
typedef struct {
uint8_t modifiers;
uint8_t reserved;
uint8_t keys[6];
} KeyReport;

typedef struct { uint8_t mouse[4]; } MouseReport;
typedef struct {
uint8_t mouse[4];
} MouseReport;

typedef struct { uint8_t bytes[2]; } CcReport;
typedef struct {
uint8_t bytes[2];
} CcReport;

class BeanHidClass {
private:
Expand Down

0 comments on commit 4946166

Please sign in to comment.