BLE_TYQ_CH584M/APP/include/peripheral.h

78 lines
2.0 KiB
C
Raw Normal View History

2024-12-02 16:26:55 +08:00
/********************************** (C) COPYRIGHT *******************************
* File Name : peripheral.h
* Author : WCH
* Version : V1.0
* Date : 2018/12/11
* Description :
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
2024-12-16 21:26:43 +08:00
* Attention: This software (modified or not) and binary are used for
2024-12-02 16:26:55 +08:00
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#ifndef PERIPHERAL_H
#define PERIPHERAL_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************************
* INCLUDES
*/
/*********************************************************************
* CONSTANTS
*/
// Peripheral Task Events
#define SBP_START_DEVICE_EVT 0x0001
#define SBP_PERIODIC_EVT 0x0002
#define SBP_READ_RSSI_EVT 0x0004
#define SBP_PARAM_UPDATE_EVT 0x0008
#define SBP_PHY_UPDATE_EVT 0x0010
2024-12-16 21:26:43 +08:00
#define SBP_REPLY_CMD_EVT 0x0020
extern uint8_t Peripheral_TaskID;
// #define VAVLE_CLOSE_
2024-12-02 16:26:55 +08:00
/*********************************************************************
* MACROS
*/
typedef struct
{
uint16_t connHandle; // Connection handle of current connection
uint16_t connInterval;
uint16_t connSlaveLatency;
uint16_t connTimeout;
} peripheralConnItem_t;
/*********************************************************************
* 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);
2024-12-16 21:26:43 +08:00
void BSP_NeeedReplyCMdFirst(void);
void BSP_NoNeeedReplyCMd(void);
2024-12-02 16:26:55 +08:00
/*********************************************************************
*********************************************************************/
#ifdef __cplusplus
}
#endif
#endif