1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #ifndef __BOARD_H
- #define __BOARD_H
- /* Public macros ------------------------------------------------------------*/
- /* MACROs for SET, RESET or TOGGLE Output port */
- #define GPIO_HIGH(a,b) a->ODR |= b
- #define GPIO_LOW(a,b) a->ODR &= ~b
- #define GPIO_TOGGLE(a,b) a->ODR ^= b
- /* Public define ------------------------------------------------------------*/
- #define TDA7448_I2C_WRADDR 0x88
- #define TDA7448_SUB_ADDR 0x10
- #define TDA7448_MIN_VOL 79
- #define TDA7448_MUTE 0xC0
- #define I2C_PORT GPIOB
- #define I2C_SCL GPIO_PIN_4
- #define I2C_SDA GPIO_PIN_5
- #define ENC_PORT GPIOC
- #define ENC_PIN_BTN GPIO_PIN_4
- #define ENC_PINA GPIO_PIN_6
- #define ENC_PINB GPIO_PIN_7
- #define ENC_PIN_ALL (GPIO_PIN_4 | GPIO_PIN_6 | GPIO_PIN_7)
- #define TIM1_PERIOD 0xFFFF
- // 320
- #define TIM1_ENC_FILTR 0x30
- // ^^^ RM0016 p.201
- #define TIM1_ENC_MODE 0x03
- // ^^^ TIM1_ENCODERMODE_TI12
- #define BTN_SCAN_PERIOD 50
- #define BTN_NOSCAN_MS 200
- #define IR_BTN_POWER 7
- #define IR_BTN_MUTE 8
- #define IR_BTN_VOLP 1
- #define IR_BTN_VOLM 2
- #define IR_THRESHOLD 4
- #endif /* __BOARD_H */
- /* Public typedef ------------------------------------------------------------*/
- typedef struct {
- uint8_t code; // pult code
- uint8_t key; // key number
- uint8_t seq; // sequence
- } ir_btn_t;
|