Lines Matching defs:input
14 * The keypad consists in a matrix of push buttons connecting input pins to
72 /* converts an r_str() input to an active high, bits string : 000BAOSE */
75 #define PNL_PBUSY 0x80 /* inverted input, active low */
76 #define PNL_PACK 0x40 /* direct input, active low */
77 #define PNL_POUTPA 0x20 /* direct input, active high */
78 #define PNL_PSELECD 0x10 /* direct input, active high */
79 #define PNL_PERRORP 0x08 /* direct input, active low */
125 /* logical or of the input bits involved in the scan matrix */
1103 * Note: to debounce input signals, we will only consider as switched a signal
1130 /* now that all outputs are cleared, the only active input bits are
1134 /* 1 for each grounded input */
1143 * that some input signals are currently tied to some outputs.
1166 static inline int input_state_high(struct logical_input *input)
1186 if (((phys_prev & input->mask) == input->value) &&
1187 ((phys_curr & input->mask) > input->value)) {
1188 input->state = INPUT_ST_LOW; /* invalidate */
1193 if ((phys_curr & input->mask) == input->value) {
1194 if ((input->type == INPUT_TYPE_STD) &&
1195 (input->high_timer == 0)) {
1196 input->high_timer++;
1197 if (input->u.std.press_fct)
1198 input->u.std.press_fct(input->u.std.press_data);
1199 } else if (input->type == INPUT_TYPE_KBD) {
1203 if (input->high_timer == 0) {
1204 char *press_str = input->u.kbd.press_str;
1207 int s = sizeof(input->u.kbd.press_str);
1213 if (input->u.kbd.repeat_str[0]) {
1214 char *repeat_str = input->u.kbd.repeat_str;
1216 if (input->high_timer >= KEYPAD_REP_START) {
1217 int s = sizeof(input->u.kbd.repeat_str);
1219 input->high_timer -= KEYPAD_REP_DELAY;
1226 if (input->high_timer < 255)
1227 input->high_timer++;
1233 input->state = INPUT_ST_FALLING;
1234 input->fall_timer = 0;
1239 static inline void input_state_falling(struct logical_input *input)
1243 if (((phys_prev & input->mask) == input->value) &&
1244 ((phys_curr & input->mask) > input->value)) {
1245 input->state = INPUT_ST_LOW; /* invalidate */
1250 if ((phys_curr & input->mask) == input->value) {
1251 if (input->type == INPUT_TYPE_KBD) {
1255 if (input->u.kbd.repeat_str[0]) {
1256 char *repeat_str = input->u.kbd.repeat_str;
1258 if (input->high_timer >= KEYPAD_REP_START) {
1259 int s = sizeof(input->u.kbd.repeat_str);
1261 input->high_timer -= KEYPAD_REP_DELAY;
1268 if (input->high_timer < 255)
1269 input->high_timer++;
1271 input->state = INPUT_ST_HIGH;
1272 } else if (input->fall_timer >= input->fall_time) {
1274 if (input->type == INPUT_TYPE_STD) {
1275 void (*release_fct)(int) = input->u.std.release_fct;
1278 release_fct(input->u.std.release_data);
1279 } else if (input->type == INPUT_TYPE_KBD) {
1280 char *release_str = input->u.kbd.release_str;
1283 int s = sizeof(input->u.kbd.release_str);
1289 input->state = INPUT_ST_LOW;
1291 input->fall_timer++;
1298 struct logical_input *input;
1302 list_for_each_entry(input, &logical_inputs, list) {
1303 switch (input->state) {
1305 if ((phys_curr & input->mask) != input->value)
1314 if ((phys_prev & input->mask) == input->value)
1316 input->rise_timer = 0;
1317 input->state = INPUT_ST_RISING;
1320 if ((phys_curr & input->mask) != input->value) {
1321 input->state = INPUT_ST_LOW;
1324 if (input->rise_timer < input->rise_time) {
1326 input->rise_timer++;
1329 input->high_timer = 0;
1330 input->state = INPUT_ST_HIGH;
1333 if (input_state_high(input))
1337 input_state_falling(input);
1394 return 0; /* input name not found */
1605 /* TODO: free all input signals */