| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2006, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: $ |
|---|
| 11 | * $brcm_Revision: $ |
|---|
| 12 | * $brcm_Date: $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: $ |
|---|
| 19 | * |
|---|
| 20 | ***************************************************************************/ |
|---|
| 21 | |
|---|
| 22 | #ifndef BSETTOP_USER_IO_H__ |
|---|
| 23 | #define BSETTOP_USER_IO_H__ |
|---|
| 24 | |
|---|
| 25 | #include "bsettop_types.h" |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | #ifdef __cplusplus |
|---|
| 29 | extern "C" |
|---|
| 30 | { |
|---|
| 31 | #endif |
|---|
| 32 | |
|---|
| 33 | /*=********************* |
|---|
| 34 | Control user input and output, including: |
|---|
| 35 | |
|---|
| 36 | o LED's, including 7-segment LED's |
|---|
| 37 | o Remote controls |
|---|
| 38 | o Front panel |
|---|
| 39 | o IR keyboards |
|---|
| 40 | |
|---|
| 41 | The key codes are passed through unmodified in a 32-bit structure. |
|---|
| 42 | ***********************/ |
|---|
| 43 | |
|---|
| 44 | /* User Input API */ |
|---|
| 45 | |
|---|
| 46 | /* |
|---|
| 47 | Summary: |
|---|
| 48 | Open a user input object for receiving IR remote and keypad input. |
|---|
| 49 | Description: |
|---|
| 50 | For now, the following id's are used: |
|---|
| 51 | 0 - remote a |
|---|
| 52 | 1 - remote b |
|---|
| 53 | 2 - 56 MHz Sejin IR Keyboard |
|---|
| 54 | 3 - keypad |
|---|
| 55 | */ |
|---|
| 56 | buser_input_t buser_input_open( |
|---|
| 57 | bobject_t user_input_id /* user input object id */ |
|---|
| 58 | ); |
|---|
| 59 | |
|---|
| 60 | /* |
|---|
| 61 | Summary: |
|---|
| 62 | Close a user input handle. |
|---|
| 63 | Description: |
|---|
| 64 | Releases all resources associated with the user input object |
|---|
| 65 | */ |
|---|
| 66 | void buser_input_close( |
|---|
| 67 | buser_input_t ui /* user input object */ |
|---|
| 68 | ); |
|---|
| 69 | |
|---|
| 70 | /* |
|---|
| 71 | Summary: |
|---|
| 72 | Representation of a user event. |
|---|
| 73 | Description: |
|---|
| 74 | The actual protocol for each input device is different. But they all |
|---|
| 75 | fit into the same storage space. |
|---|
| 76 | */ |
|---|
| 77 | typedef struct buser_input_event { |
|---|
| 78 | uint32_t code; /* One event is always contained in 32 bits of information */ |
|---|
| 79 | } buser_input_event; |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | /* |
|---|
| 83 | Summary: |
|---|
| 84 | Read events from a user input device. |
|---|
| 85 | |
|---|
| 86 | Description: |
|---|
| 87 | Because this function does not return a void* to raw data, but an array of structures, |
|---|
| 88 | it is not called buser_input_read. |
|---|
| 89 | */ |
|---|
| 90 | bresult buser_input_get_event( |
|---|
| 91 | buser_input_t ui, /* user input object */ |
|---|
| 92 | buser_input_event *event, /* [out,size_is(nevents)] event from the user */ |
|---|
| 93 | unsigned nevents, /* number of entries in the event array */ |
|---|
| 94 | unsigned *result_nevents /* [out] number of entries read */ |
|---|
| 95 | ); |
|---|
| 96 | /* |
|---|
| 97 | Summary: |
|---|
| 98 | Maps physical input code to the internal code used in the higher level software. |
|---|
| 99 | Returns 0xFF for invalid code or the internal system key codes. See bapp.h |
|---|
| 100 | */ |
|---|
| 101 | unsigned int buser_input_map_code( |
|---|
| 102 | unsigned int code /* input code */ |
|---|
| 103 | ); |
|---|
| 104 | |
|---|
| 105 | void buser_input_sim_key(uint32_t code); |
|---|
| 106 | |
|---|
| 107 | |
|---|
| 108 | typedef enum button_t |
|---|
| 109 | { |
|---|
| 110 | eButton_000 = 0x000, |
|---|
| 111 | eButton_00P= 0x001, |
|---|
| 112 | eButton_0U0= 0x010, |
|---|
| 113 | eButton_0UP= 0x011, |
|---|
| 114 | eButton_D00= 0x100, |
|---|
| 115 | eButton_D0P= 0x101, |
|---|
| 116 | eButton_DU0= 0x110, |
|---|
| 117 | eButton_DUP= 0x111, |
|---|
| 118 | }button_t; |
|---|
| 119 | |
|---|
| 120 | int AOV_buser_input_GetButtonfactory(void); |
|---|
| 121 | void aov_Set_Button_CHUpDown(unsigned int keyIn); |
|---|
| 122 | |
|---|
| 123 | #ifdef __cplusplus |
|---|
| 124 | } |
|---|
| 125 | #endif |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | #endif /* BSETTOP_USER_IO_H__ */ |
|---|
| 129 | |
|---|