diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-12-02 07:34:51 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-12-03 16:48:07 -0600 |
commit | 1b3065da9c164337131c10bcad8770925df45602 (patch) | |
tree | 69576591df1df9a78966d59cd7678ba957e3b032 /apps/graphics/traveler/include/trv_input.h | |
parent | 543073e801200b129b6ee011cfb677f10cb3f843 (diff) | |
download | nuttx-1b3065da9c164337131c10bcad8770925df45602.tar.gz nuttx-1b3065da9c164337131c10bcad8770925df45602.tar.bz2 nuttx-1b3065da9c164337131c10bcad8770925df45602.zip |
Rethink positional input; Add input configuration logic
Diffstat (limited to 'apps/graphics/traveler/include/trv_input.h')
-rw-r--r-- | apps/graphics/traveler/include/trv_input.h | 45 |
1 files changed, 15 insertions, 30 deletions
diff --git a/apps/graphics/traveler/include/trv_input.h b/apps/graphics/traveler/include/trv_input.h index beb3b20a4..1c2e7e724 100644 --- a/apps/graphics/traveler/include/trv_input.h +++ b/apps/graphics/traveler/include/trv_input.h @@ -46,44 +46,26 @@ * Pre-processor Definitions ****************************************************************************/ -/**************************************************************************** - * Public Types - ****************************************************************************/ -/* INPUT */ - -enum trv_move_event_e -{ - INPUT_MOVE_NONE = 0, - INPUT_MOVE_FORWARD, - INPUT_MOVE_BACKWARD, - INPUT_MOVE_LEFT, - INPUT_MOVE_RIGHT -}; - -enum trv_turn_event_e +struct trv_input_s { - INPUT_TURN_NONE = 0, - INPUT_TURN_UP, - INPUT_TURN_DOWN, - INPUT_TURN_LEFT, - INPUT_TURN_RIGHT, + int16_t fwdrate; /* Forward motion rate. Negative is backward */ + int16_t leftrate; /* Left motion rate. Negative is right */ + int16_t yawrate; /* Yaw turn rate. Positive is to the left */ + int16_t pitchrate; /* Pitch turn rate. Positive is upward */ + bool dooropen; /* True: Open a door */ }; -enum trv_door_event_e -{ - INPUT_DOOR_NONE = 0, - INPUT_DOOR_OPEN, -}; +/**************************************************************************** + * Public Types + ****************************************************************************/ /**************************************************************************** * Public Data ****************************************************************************/ -extern enum trv_move_event_e g_move_event; -extern enum trv_turn_event_e g_turn_event; -extern enum trv_door_event_e g_door_event; -extern trv_coord_t g_trv_move_rate; -extern trv_coord_t g_trv_turn_rate; +/* Report positional inputs */ + +extern struct trv_input_s g_trv_input; /**************************************************************************** * Public Function Prototypes @@ -92,5 +74,8 @@ extern trv_coord_t g_trv_turn_rate; void trv_input_initialize(void); void trv_input_read(void); void trv_input_terminate(void); +#ifdef CONFIG_GRAPHICS_TRAVELER_NX_XYINPUT +void trv_input_xyinput(trv_coord_t xpos, trv_coord_t xpos, uint8_t buttons); +#endif #endif /* __APPS_GRAPHICS_TRAVELER_INCLUDE_TRV_INPUT_H */ |