uiconfig sets about keys March 16, 2013 11:18AM |
Registered: 12 years ago Posts: 33 |
Re: uiconfig sets about keys March 17, 2013 06:53PM |
Registered: 13 years ago Posts: 2,705 |
#define UI_HAS_KEYS 1 #define UI_HAS_BACK_KEY 1 #define UI_DISPLAY_TYPE 3 #define UI_DISPLAY_CHARSET 1 #define UI_COLS 16 #define UI_ROWS 2 #define UI_DISPLAY_I2C_CHIPTYPE 1 #define UI_DISPLAY_I2C_ADDRESS 0x40 #define UI_DISPLAY_I2C_OUTPUT_PINS 65504 #define UI_DISPLAY_I2C_OUTPUT_START_MASK 0 #define UI_DISPLAY_I2C_PULLUP 31 #define UI_I2C_CLOCKSPEED 400000L #define UI_DISPLAY_RS_PIN _BV(15) #define UI_DISPLAY_RW_PIN _BV(14) #define UI_DISPLAY_ENABLE_PIN _BV(13) #define UI_DISPLAY_D0_PIN _BV(12) #define UI_DISPLAY_D1_PIN _BV(11) #define UI_DISPLAY_D2_PIN _BV(10) #define UI_DISPLAY_D3_PIN _BV(9) #define UI_DISPLAY_D4_PIN _BV(12) #define UI_DISPLAY_D5_PIN _BV(11) #define UI_DISPLAY_D6_PIN _BV(10) #define UI_DISPLAY_D7_PIN _BV(9) #define UI_INVERT_MENU_DIRECTION true #define UI_HAS_I2C_KEYS #define UI_HAS_I2C_ENCODER 0 #define UI_I2C_KEY_ADDRESS 0x40 void ui_init_keys() {} void ui_check_keys(int &action) {} inline void ui_check_slow_encoder() { i2c_start_wait(UI_DISPLAY_I2C_ADDRESS+I2C_WRITE); i2c_write(0x12); // GIOA i2c_stop(); i2c_start_wait(UI_DISPLAY_I2C_ADDRESS+I2C_READ); unsigned int keymask = i2c_readAck(); keymask = keymask + (i2c_readNak()<<8); i2c_stop(); } void ui_check_slow_keys(int &action) { i2c_start_wait(UI_DISPLAY_I2C_ADDRESS+I2C_WRITE); i2c_write(0x12); // GPIOA i2c_stop(); i2c_start_wait(UI_DISPLAY_I2C_ADDRESS+I2C_READ); unsigned int keymask = i2c_readAck(); keymask = keymask + (i2c_readNak()<<8); i2c_stop(); UI_KEYS_I2C_BUTTON_LOW(4,UI_ACTION_PREVIOUS); // Up button UI_KEYS_I2C_BUTTON_LOW(8,UI_ACTION_NEXT); // down button UI_KEYS_I2C_BUTTON_LOW(16,UI_ACTION_BACK); // left button UI_KEYS_I2C_BUTTON_LOW(2,UI_ACTION_OK); // right button UI_KEYS_I2C_BUTTON_LOW(1,UI_ACTION_MENU_QUICKSETTINGS); //Select button }
Re: uiconfig sets about keys March 23, 2013 01:56AM |
Registered: 12 years ago Posts: 33 |
Re: uiconfig sets about keys March 23, 2013 03:45AM |
Registered: 13 years ago Posts: 2,705 |
Re: uiconfig sets about keys March 23, 2013 05:36AM |
Registered: 12 years ago Posts: 33 |