Lines Matching defs:input
14 * The keypad consists in a matrix of push buttons connecting input pins to
71 /* converts an r_str() input to an active high, bits string : 000BAOSE */
74 #define PNL_PBUSY 0x80 /* inverted input, active low */
75 #define PNL_PACK 0x40 /* direct input, active low */
76 #define PNL_POUTPA 0x20 /* direct input, active high */
77 #define PNL_PSELECD 0x10 /* direct input, active high */
78 #define PNL_PERRORP 0x08 /* direct input, active low */
124 /* logical or of the input bits involved in the scan matrix */
1153 * Note: to debounce input signals, we will only consider as switched a signal
1180 /* now that all outputs are cleared, the only active input bits are
1184 /* 1 for each grounded input */
1193 * that some input signals are currently tied to some outputs.
1216 static inline int input_state_high(struct logical_input *input)
1236 if (((phys_prev & input->mask) == input->value) &&
1237 ((phys_curr & input->mask) > input->value)) {
1238 input->state = INPUT_ST_LOW; /* invalidate */
1243 if ((phys_curr & input->mask) == input->value) {
1244 if ((input->type == INPUT_TYPE_STD) &&
1245 (input->high_timer == 0)) {
1246 input->high_timer++;
1247 if (input->u.std.press_fct)
1248 input->u.std.press_fct(input->u.std.press_data);
1249 } else if (input->type == INPUT_TYPE_KBD) {
1253 if (input->high_timer == 0) {
1254 char *press_str = input->u.kbd.press_str;
1257 int s = sizeof(input->u.kbd.press_str);
1263 if (input->u.kbd.repeat_str[0]) {
1264 char *repeat_str = input->u.kbd.repeat_str;
1266 if (input->high_timer >= KEYPAD_REP_START) {
1267 int s = sizeof(input->u.kbd.repeat_str);
1269 input->high_timer -= KEYPAD_REP_DELAY;
1276 if (input->high_timer < 255)
1277 input->high_timer++;
1283 input->state = INPUT_ST_FALLING;
1284 input->fall_timer = 0;
1289 static inline void input_state_falling(struct logical_input *input)
1293 if (((phys_prev & input->mask) == input->value) &&
1294 ((phys_curr & input->mask) > input->value)) {
1295 input->state = INPUT_ST_LOW; /* invalidate */
1300 if ((phys_curr & input->mask) == input->value) {
1301 if (input->type == INPUT_TYPE_KBD) {
1305 if (input->u.kbd.repeat_str[0]) {
1306 char *repeat_str = input->u.kbd.repeat_str;
1308 if (input->high_timer >= KEYPAD_REP_START) {
1309 int s = sizeof(input->u.kbd.repeat_str);
1311 input->high_timer -= KEYPAD_REP_DELAY;
1318 if (input->high_timer < 255)
1319 input->high_timer++;
1321 input->state = INPUT_ST_HIGH;
1322 } else if (input->fall_timer >= input->fall_time) {
1324 if (input->type == INPUT_TYPE_STD) {
1325 void (*release_fct)(int) = input->u.std.release_fct;
1328 release_fct(input->u.std.release_data);
1329 } else if (input->type == INPUT_TYPE_KBD) {
1330 char *release_str = input->u.kbd.release_str;
1333 int s = sizeof(input->u.kbd.release_str);
1339 input->state = INPUT_ST_LOW;
1341 input->fall_timer++;
1348 struct logical_input *input;
1352 list_for_each_entry(input, &logical_inputs, list) {
1353 switch (input->state) {
1355 if ((phys_curr & input->mask) != input->value)
1364 if ((phys_prev & input->mask) == input->value)
1366 input->rise_timer = 0;
1367 input->state = INPUT_ST_RISING;
1370 if ((phys_curr & input->mask) != input->value) {
1371 input->state = INPUT_ST_LOW;
1374 if (input->rise_timer < input->rise_time) {
1376 input->rise_timer++;
1379 input->high_timer = 0;
1380 input->state = INPUT_ST_HIGH;
1383 if (input_state_high(input))
1387 input_state_falling(input);
1444 return 0; /* input name not found */
1654 /* TODO: free all input signals */