123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- /**
- ******************************************************************************
- * @file main.h
- * @author MCU Application Team
- * @brief Header for main.c file.
- * This file contains the common defines of the application.
- ******************************************************************************
- * @attention
- *
- * <h2><center>© Copyright (c) 2023 Puya Semiconductor Co.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by Puya under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- * @attention
- *
- * <h2><center>© Copyright (c) 2016 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
- /* Define to prevent recursive inclusion -------------------------------------*/
- #ifndef __MAIN_H
- #define __MAIN_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- /* Includes ------------------------------------------------------------------*/
- #include "py32f002b_ll_rcc.h"
- #include "py32f002b_ll_bus.h"
- #include "py32f002b_ll_system.h"
- #include "py32f002b_ll_cortex.h"
- #include "py32f002b_ll_utils.h"
- #include "py32f002b_ll_pwr.h"
- #include "py32f002b_ll_gpio.h"
- #include "py32f002b_ll_adc.h"
- #include "py32f002b_ll_tim.h"
- #include "py32f002b_ll_i2c.h"
- #include "py32f002b_ll_spi.h"
- #include "py32f002b_ll_exti.h"
- #include "py32f0xx_hal.h"
- #if defined(USE_FULL_ASSERT)
- #include "py32_assert.h"
- #endif /* USE_FULL_ASSERT */
- /* Private includes ----------------------------------------------------------*/
- /* Private defines -----------------------------------------------------------*/
- // #define I2C_ADDRESS 0xA0 /* Master\Slave Address */
- // #define I2C_SPEEDCLOCK 400000 /* Communication frequency:400K */
- // #define I2C_STATE_READY 0 /* Ready state */
- // #define I2C_STATE_BUSY_TX 1 /* Send state */
- // #define I2C_STATE_BUSY_RX 2 /* Receive state */
- #define HW_KEY_NULL ( 0)
- #define HW_KEY_A ( 1UL<<0)
- #define HW_KEY_B ( 1UL<<1)
- #define HW_KEY_C ( 1UL<<2)
- #define HW_KEY_X ( 1UL<<3)
- #define HW_KEY_Y ( 1UL<<4)
- #define HW_KEY_Z ( 1UL<<5)
- #define HW_KEY_L1 ( 1UL<<6)
- #define HW_KEY_R1 ( 1UL<<7)
- #define HW_KEY_L2 ( 1UL<<8)
- #define HW_KEY_R2 ( 1UL<<9)
- #define HW_KEY_SELECT ( 1UL<<10)
- #define HW_KEY_START ( 1UL<<11)
- #define HW_KEY_HOME ( 1UL<<12)
- #define HW_KEY_L3 ( 1UL<<13)
- #define HW_KEY_R3 ( 1UL<<14)
- #define HW_KEY_CAPTURE ( 1UL<<15) //截图/返回/touchkey
- #define HW_KEY_UP ( 1UL<<16)
- #define HW_KEY_DOWN ( 1UL<<17)
- #define HW_KEY_LEFT ( 1UL<<18)
- #define HW_KEY_RIGHT ( 1UL<<19)
- #define HW_KEY_BACK ( 1UL<<20) //功能按键
- #define HW_KEY_MODE ( 1UL<<21) //功能按键
- #define HW_KEY_MENU ( 1UL<<22) //功能按键
- #define HW_KEY_M1 ( 1UL<<23)
- #define HW_KEY_M2 ( 1UL<<24)
- #define HW_KEY_M3 ( 1UL<<25)
- #define HW_KEY_M4 ( 1UL<<26)
- #define HW_KEY_M5 ( 1UL<<27)
- #define HW_KEY_M6 ( 1UL<<28)
- #define HW_KEY_M7 ( 1UL<<29)
- #define HW_KEY_M8 ( 1UL<<30)
- #define HW_KEY_POWER ( 1UL<<31) //POWER
- /* Exported variables prototypes ---------------------------------------------*/
- /* Exported functions prototypes ---------------------------------------------*/
- void APP_ErrorHandler(void);
- void APP_SpiRxCallback(void);
- void APP_SpiTxCallback(void);
- void APP_SpiTransferErrorCallback(void);
- void APP_Spi_CS_EN(uint8_t en);
- #ifdef __cplusplus
- }
- #endif
- #endif /* __MAIN_H */
- /************************ (C) COPYRIGHT Puya *****END OF FILE******************/
|