Page 170 - MDP2022-2
P. 170
#define USE_BRIGHTNESS 1
#define QWIIC_KEYPAD_ADDR (0x4B << 1)//7-bit unshifted default I2C Address
enum keypadRegisters {
KEYPAD_ID = 0x00, KEYPAD_VERSION1, // 0x01
KEYPAD_VERSION2, // 0x02
KEYPAD_BUTTON, // 0x03
KEYPAD_TIME_MSB, // 0x04
KEYPAD_TIME_LSB, // 0x05
KEYPAD_UPDATE_FIFO, // 0x06
KEYPAD_CHANGE_ADDRESS, // 0x07
};
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM */
/* USER CODE END PM */
/* Private variables ---------------------------------------------------------*/
I2C_HandleTypeDef hi2c2;
TIM_HandleTypeDef htim1;
TIM_HandleTypeDef htim3;
DMA_HandleTypeDef hdma_tim1_ch1;
DMA_HandleTypeDef hdma_tim1_ch2;
UART_HandleTypeDef huart1;
/* USER CODE BEGIN PV */
const char lock_num[5] = { "4585" };
char insert_num[5];
char buff;
char msg[50];
int tone_flag = 0;
uint16_t tone_tick = 0;
uint32_t led_buff[85];
uint8_t now_motor_flag = 0;
uint8_t befo_motor_flag = 0;
uint8_t motor_state = 0;