/********************************** (C) COPYRIGHT ******************************* * File Name : peripheral.h * Author : WCH * Version : V1.0 * Date : 2018/12/11 * Description : ********************************************************************************* * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd. * Attention: This software (modified or not) and binary are used for * microcontroller manufactured by Nanjing Qinheng Microelectronics. *******************************************************************************/ #ifndef PERIPHERAL_H #define PERIPHERAL_H #ifdef __cplusplus extern "C" { #endif /********************************************************************* * INCLUDES */ /********************************************************************* * CONSTANTS */ // Simple BLE Peripheral Task Events #define SBP_START_DEVICE_EVT 0x0001 #define SBP_PERIODIC_EVT 0x0002 #define OTA_FLASH_ERASE_EVT 0x0004 //OTA Flash²Á³ýÈÎÎñ /********************************************************************* * MACROS */ /********************************************************************* * FUNCTIONS */ /* * Task Initialization for the BLE Application */ extern void Peripheral_Init(void); /* * Task Event Processor for the BLE Application */ extern uint16_t Peripheral_ProcessEvent(uint8_t task_id, uint16_t events); /* * Read flash */ void FLASH_read(uint32_t addr, uint8_t *pData, uint32_t len); void IAP_FLASH_read(uint32_t addr, uint8_t *pData, uint32_t len); void app_start(void); void Upgrade_IAP_Erase(uint16_t addr); void Upgrade_IAP_Program(uint16_t addr, uint8_t *pData, uint32_t len); void Upgrade_IAP_End(void); void SwitchImageFlag(uint8_t new_flag); /********************************************************************* *********************************************************************/ #ifdef __cplusplus } #endif #endif