first submission
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
/********************************** (C) COPYRIGHT *******************************
|
||||
* File Name : app.h
|
||||
* Author : WCH
|
||||
* Version : V1.0
|
||||
* Date : 2018/11/12
|
||||
* 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 app_H
|
||||
#define app_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define APP_SILENT_ADV_EVT (1 << 0)
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief 应用层初始化
|
||||
*/
|
||||
void App_Init(void);
|
||||
|
||||
/**
|
||||
* @brief 发送当前灯的状态给天猫精灵
|
||||
*/
|
||||
void send_led_state(void);
|
||||
|
||||
/**
|
||||
* @brief 发送复位事件给天猫精灵,发送完成后将清除配网状态,重置自身mesh网络
|
||||
*/
|
||||
void send_reset_indicate(void);
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,56 @@
|
||||
/********************************** (C) COPYRIGHT *******************************
|
||||
* File Name : app_generic_onoff_model.h
|
||||
* Author : WCH
|
||||
* Version : V1.1
|
||||
* Date : 2021/11/18
|
||||
* 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 app_generic_onoff_model_H
|
||||
#define app_generic_onoff_model_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "MESH_LIB.h"
|
||||
|
||||
#define MSG_PIN GPIO_Pin_14
|
||||
#define MSG_PCENR RCC_APB2Periph_GPIOB
|
||||
#define MSG_GPIO GPIOB
|
||||
|
||||
extern const struct bt_mesh_model_op gen_onoff_op[];
|
||||
|
||||
/**
|
||||
* @brief 삿혤뎠품됐榴檄.
|
||||
*
|
||||
* @param led_pin - 多신.
|
||||
*
|
||||
* @return 됐榴檄
|
||||
*/
|
||||
BOOL read_led_state(uint32_t led_pin);
|
||||
|
||||
/**
|
||||
* @brief �零뎠품됐榴檄.
|
||||
*
|
||||
* @param led_pin - 多신.
|
||||
* @param on - 榴檄.
|
||||
*/
|
||||
void set_led_state(uint32_t led_pin, BOOL on);
|
||||
|
||||
/**
|
||||
* @brief 럇瘻뎠품됐榴檄
|
||||
*
|
||||
* @param led_pin - 多신.
|
||||
*/
|
||||
void toggle_led_state(uint32_t led_pin);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,219 @@
|
||||
/********************************** (C) COPYRIGHT *******************************
|
||||
* File Name : app_mesh_config.h
|
||||
* Author : WCH
|
||||
* Version : V1.1
|
||||
* Date : 2021/11/18
|
||||
* 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 APP_MESH_CONFIG_H
|
||||
#define APP_MESH_CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/**************************功能配置,建议直接参考不同例程*****************************/
|
||||
|
||||
// relay功能
|
||||
#define CONFIG_BLE_MESH_RELAY 1
|
||||
// 代理功能
|
||||
#define CONFIG_BLE_MESH_PROXY 0
|
||||
// GATT层配网功能
|
||||
#define CONFIG_BLE_MESH_PB_GATT 0
|
||||
// FLASH存储功能
|
||||
#define CONFIG_BLE_MESH_SETTINGS 1
|
||||
// 朋友节点功能
|
||||
#define CONFIG_BLE_MESH_FRIEND 0
|
||||
// 低功耗节点功能
|
||||
#define CONFIG_BLE_MESH_LOW_POWER 0
|
||||
// config模型客户端功能
|
||||
#define CONFIG_BLE_MESH_CFG_CLI 0
|
||||
// health模型客户端功能
|
||||
#define CONFIG_BLE_MESH_HLTH_CLI 0
|
||||
|
||||
/************************************参数配置******************************************/
|
||||
|
||||
// Net数据缓存个数
|
||||
#define CONFIG_MESH_ADV_BUF_COUNT_MIN (6)
|
||||
#define CONFIG_MESH_ADV_BUF_COUNT_DEF (10)
|
||||
#define CONFIG_MESH_ADV_BUF_COUNT_MAX (256)
|
||||
|
||||
// RPL数据缓存个数,需不小于配网发起者支持的配网设备节点个数
|
||||
#define CONFIG_MESH_RPL_COUNT_MIN (6)
|
||||
#define CONFIG_MESH_RPL_COUNT_DEF (20)
|
||||
#define CONFIG_MESH_RPL_COUNT_MAX (128)
|
||||
|
||||
// RPL缓存循环使用,开启后网络中节点数量不受RPL限制,但NVS将不存储RPL数据
|
||||
#define CONFIG_MESH_ALLOW_RPL_CYCLE (FALSE)
|
||||
|
||||
// IV Update State Timer 基于96H的分频系数
|
||||
#define CONFIG_MESH_IVU_DIVIDER_MIN (1)
|
||||
#define CONFIG_MESH_IVU_DIVIDER_DEF (96)
|
||||
#define CONFIG_MESH_IVU_DIVIDER_MAX (96)
|
||||
|
||||
// 代理黑白名单功能存储个数
|
||||
#define CONFIG_MESH_PROXY_FILTER_MIN (2)
|
||||
#define CONFIG_MESH_PROXY_FILTER_DEF (5)
|
||||
#define CONFIG_MESH_PROXY_FILTER_MAX (20)
|
||||
|
||||
// 消息贮存个数
|
||||
#define CONFIG_MESH_MSG_CACHE_MIN (3)
|
||||
#define CONFIG_MESH_MSG_CACHE_DEF (20)
|
||||
#define CONFIG_MESH_MSG_CACHE_MAX (20)
|
||||
|
||||
// 子网络个数
|
||||
#define CONFIG_MESH_SUBNET_COUNT_MIN (1)
|
||||
#define CONFIG_MESH_SUBNET_COUNT_DEF (1)
|
||||
#define CONFIG_MESH_SUBNET_COUNT_MAX (4)
|
||||
|
||||
// APP key个数
|
||||
#define CONFIG_MESH_APPKEY_COUNT_MIN (1)
|
||||
#define CONFIG_MESH_APPKEY_COUNT_DEF (3)
|
||||
#define CONFIG_MESH_APPKEY_COUNT_MAX (5)
|
||||
|
||||
// 可存储的模型密钥数量
|
||||
#define CONFIG_MESH_MOD_KEY_COUNT_MIN (1)
|
||||
#define CONFIG_MESH_MOD_KEY_COUNT_DEF (1)
|
||||
#define CONFIG_MESH_MOD_KEY_COUNT_MAX (3)
|
||||
|
||||
// 可存储的订阅地址数量
|
||||
#define CONFIG_MESH_MOD_GROUP_COUNT_MIN (1)
|
||||
#define CONFIG_MESH_MOD_GROUP_COUNT_DEF (6)
|
||||
#define CONFIG_MESH_MOD_GROUP_COUNT_MAX (64)
|
||||
|
||||
// 是否允许一个网络中存在同地址的节点(使能后分包功能不可用)
|
||||
#define CONFIG_MESH_ALLOW_SAME_ADDR (FALSE)
|
||||
|
||||
// 不分包消息支持的长度(超过此长度则需要分包,默认值为7,注意同网络里所有设备配置需统一)
|
||||
#define CONFIG_MESH_UNSEG_LENGTH_MIN (7)
|
||||
#define CONFIG_MESH_UNSEG_LENGTH_DEF (7)
|
||||
#define CONFIG_MESH_UNSEG_LENGTH_MAX (221)
|
||||
|
||||
// 每个消息的最大分包数
|
||||
#define CONFIG_MESH_TX_SEG_MIN (2)
|
||||
#define CONFIG_MESH_TX_SEG_DEF (8)
|
||||
#define CONFIG_MESH_TX_SEG_MAX (32)
|
||||
|
||||
// 允许同时存在的分包消息的最大发送个数
|
||||
#define CONFIG_MESH_TX_SEG_COUNT_MIN (1)
|
||||
#define CONFIG_MESH_TX_SEG_COUNT_DEF (2)
|
||||
#define CONFIG_MESH_TX_SEG_COUNT_MAX (4)
|
||||
|
||||
// 允许同时存在的分包消息的最大接收个数
|
||||
#define CONFIG_MESH_RX_SEG_COUNT_MIN (1)
|
||||
#define CONFIG_MESH_RX_SEG_COUNT_DEF (2)
|
||||
#define CONFIG_MESH_RX_SEG_COUNT_MAX (4)
|
||||
|
||||
// 每个接收的分包消息的最大字节数
|
||||
#define CONFIG_MESH_RX_SDU_MIN (12)
|
||||
#define CONFIG_MESH_RX_SDU_DEF (192)
|
||||
#define CONFIG_MESH_RX_SDU_MAX (384)
|
||||
|
||||
// 虚拟地址个数
|
||||
#define CONFIG_MESH_LABEL_COUNT_MIN (1)
|
||||
#define CONFIG_MESH_LABEL_COUNT_DEF (2)
|
||||
#define CONFIG_MESH_LABEL_COUNT_MAX (4)
|
||||
|
||||
// NVS存储使用扇区个数
|
||||
#define CONFIG_MESH_SECTOR_COUNT_MIN (2)
|
||||
#define CONFIG_MESH_SECTOR_COUNT_DEF (3)
|
||||
|
||||
// NVS存储扇区大小
|
||||
#define CONFIG_MESH_SECTOR_SIZE_DEF (4096)
|
||||
|
||||
// NVS存储首地址
|
||||
#define CONFIG_MESH_NVS_ADDR_DEF (448*1024+0x08000000)
|
||||
|
||||
// RPL更新超过多少次后存储
|
||||
#define CONFIG_MESH_RPL_STORE_RATE_MIN (5)
|
||||
#define CONFIG_MESH_RPL_STORE_RATE_DEF (60)
|
||||
#define CONFIG_MESH_RPL_STORE_RATE_MAX (3600)
|
||||
|
||||
// SEQ更新超过多少次后存储
|
||||
#define CONFIG_MESH_SEQ_STORE_RATE_MIN (5)
|
||||
#define CONFIG_MESH_SEQ_STORE_RATE_DEF (60)
|
||||
#define CONFIG_MESH_SEQ_STORE_RATE_MAX (3600)
|
||||
|
||||
// 其他信息更新后存储的超时时长(s)
|
||||
#define CONFIG_MESH_STORE_RATE_MIN (2)
|
||||
#define CONFIG_MESH_STORE_RATE_DEF (2)
|
||||
#define CONFIG_MESH_STORE_RATE_MAX (5)
|
||||
|
||||
// 朋友节点支持的每个消息的分包个数
|
||||
#define CONFIG_MESH_FRIEND_SEG_RX_COUNT_MIN (1)
|
||||
#define CONFIG_MESH_FRIEND_SEG_RX_COUNT_DEF (2)
|
||||
#define CONFIG_MESH_FRIEND_SEG_RX_COUNT_MAX (4)
|
||||
|
||||
// 朋友节点支持的订阅个数
|
||||
#define CONFIG_MESH_FRIEND_SUB_SIZE_MIN (1)
|
||||
#define CONFIG_MESH_FRIEND_SUB_SIZE_DEF (4)
|
||||
#define CONFIG_MESH_FRIEND_SUB_SIZE_MAX (8)
|
||||
|
||||
// 朋友节点支持的低功耗节点个数
|
||||
#define CONFIG_MESH_FRIEND_LPN_COUNT_MIN (1)
|
||||
#define CONFIG_MESH_FRIEND_LPN_COUNT_DEF (1)
|
||||
#define CONFIG_MESH_FRIEND_LPN_COUNT_MAX (4)
|
||||
|
||||
// 朋友节点存储的消息队列大小
|
||||
#define CONFIG_MESH_QUEUE_SIZE_MIN (2)
|
||||
#define CONFIG_MESH_QUEUE_SIZE_DEF (4)
|
||||
#define CONFIG_MESH_QUEUE_SIZE_MAX (30)
|
||||
|
||||
// 朋友节点接收窗口大小(ms)
|
||||
#define CONFIG_MESH_FRIEND_RECV_WIN_MIN (1)
|
||||
#define CONFIG_MESH_FRIEND_RECV_WIN_DEF (30)
|
||||
#define CONFIG_MESH_FRIEND_RECV_WIN_MAX (255)
|
||||
|
||||
// 低功耗节点的请求消息队列大小
|
||||
#define CONFIG_MESH_LPN_REQ_QUEUE_SIZE_MIN (2)
|
||||
#define CONFIG_MESH_LPN_REQ_QUEUE_SIZE_DEF (2)
|
||||
#define CONFIG_MESH_LPN_REQ_QUEUE_SIZE_MAX (20)
|
||||
|
||||
// 低功耗节点的请求消息间隔(100ms)
|
||||
#define CONFIG_MESH_LPN_POLLINTERVAL_MIN (1)
|
||||
#define CONFIG_MESH_LPN_POLLINTERVAL_DEF (80)
|
||||
#define CONFIG_MESH_LPN_POLLINTERVAL_MAX (3455999)
|
||||
|
||||
// 低功耗节点的请求消息超时时长(100ms)
|
||||
#define CONFIG_MESH_LPN_POLLTIMEOUT_MIN (10)
|
||||
#define CONFIG_MESH_LPN_POLLTIMEOUT_DEF (300)
|
||||
#define CONFIG_MESH_LPN_POLLTIMEOUT_MAX (3455999)
|
||||
|
||||
// 低功耗节点支持的接收延迟(ms)
|
||||
#define CONFIG_MESH_LPN_RECV_DELAY_MIN (10)
|
||||
#define CONFIG_MESH_LPN_RECV_DELAY_DEF (100)
|
||||
#define CONFIG_MESH_LPN_RECV_DELAY_MAX (255)
|
||||
|
||||
// 朋友关系重建等待时长(s)
|
||||
#define CONFIG_MESH_RETRY_TIMEOUT_MIN (3)
|
||||
#define CONFIG_MESH_RETRY_TIMEOUT_DEF (10)
|
||||
#define CONFIG_MESH_RETRY_TIMEOUT_MAX (60)
|
||||
|
||||
// 配网发起者支持的配网设备节点个数
|
||||
#define CONFIG_MESH_PROV_NODE_COUNT_DEF (0)
|
||||
|
||||
// ADV_RF配置
|
||||
#define CONFIG_MESH_RF_ACCESSADDRESS (0x8E89BED6)
|
||||
#define CONFIG_MESH_RF_CHANNEL_37 (37)
|
||||
#define CONFIG_MESH_RF_CHANNEL_38 (38)
|
||||
#define CONFIG_MESH_RF_CHANNEL_39 (39)
|
||||
|
||||
#define APP_DBG(X...) \
|
||||
if(1) \
|
||||
{ \
|
||||
PRINT("APP_DBG %s> ", __FUNCTION__); \
|
||||
PRINT(X); \
|
||||
PRINT("\n"); \
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,188 @@
|
||||
/********************************** (C) COPYRIGHT *******************************
|
||||
* File Name : app_vendor_model.h
|
||||
* Author : WCH
|
||||
* Version : V1.0
|
||||
* Date : 2018/11/12
|
||||
* 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 app_vendor_model_H
|
||||
#define app_vendor_model_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/******************************************************************************/
|
||||
|
||||
#include "MESH_LIB.h"
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define CID_ALI_GENIE 0x01A8
|
||||
|
||||
#define OP_VENDOR_MESSAGE_ATTR_GET BLE_MESH_MODEL_OP_3(0xD0, CID_ALI_GENIE)
|
||||
#define OP_VENDOR_MESSAGE_ATTR_SET BLE_MESH_MODEL_OP_3(0xD1, CID_ALI_GENIE)
|
||||
#define OP_VENDOR_MESSAGE_ATTR_SET_UNACK BLE_MESH_MODEL_OP_3(0xD2, CID_ALI_GENIE)
|
||||
#define OP_VENDOR_MESSAGE_ATTR_STATUS BLE_MESH_MODEL_OP_3(0xD3, CID_ALI_GENIE)
|
||||
#define OP_VENDOR_MESSAGE_ATTR_INDICATION BLE_MESH_MODEL_OP_3(0xD4, CID_ALI_GENIE)
|
||||
#define OP_VENDOR_MESSAGE_ATTR_CONFIRMATION BLE_MESH_MODEL_OP_3(0xD5, CID_ALI_GENIE)
|
||||
#define OP_VENDOR_MESSAGE_ATTR_TRANSPARENT_MSG BLE_MESH_MODEL_OP_3(0xCF, CID_ALI_GENIE)
|
||||
|
||||
#define ALI_SYS_ATTR_TYPE_ERROR 0x0000
|
||||
#define ALI_SYS_ATTR_TYPE_VERSION 0xFF01
|
||||
#define ALI_SYS_ATTR_TYPE_DEV_FEATURE 0xFF02
|
||||
#define ALI_SYS_ATTR_TYPE_TOTAL_FLASH_SIZE 0xFF03
|
||||
#define ALI_SYS_ATTR_TYPE_USED_FLASH_SIZE 0xFF04
|
||||
#define ALI_SYS_ATTR_TYPE_FREE_FLASH_SIZE 0xFF05
|
||||
#define ALI_SYS_ATTR_TYPE_ENGINEER_MODE 0xFF06
|
||||
|
||||
#define ALI_GEN_ATTR_TYPE_WORK_STATUS 0xF001
|
||||
#define ALI_GEN_ATTR_TYPE_USER_ID 0xF002
|
||||
#define ALI_GEN_ATTR_TYPE_DEVICE_NAME 0xF003
|
||||
#define ALI_GEN_ATTR_TYPE_MODE_NUMBER 0xF004
|
||||
#define ALI_GEN_ATTR_TYPE_ONOFF_PLAN 0xF008
|
||||
#define ALI_GEN_ATTR_TYPE_EVENT_TRIGGER 0xF009
|
||||
#define ALI_GEN_ATTR_TYPE_EVENT_CLEAR 0xF019
|
||||
#define ALI_GEN_ATTR_TYPE_SIGNAL_INTENSITY 0xF00A
|
||||
#define ALI_GEN_ATTR_TYPE_DELTA_VALUE 0xF00B
|
||||
#define ALI_GEN_ATTR_TYPE_ELEMENT_COUNT 0xF00C
|
||||
#define ALI_GEN_ATTR_TYPE_ATTR_SWITCH 0xF00D
|
||||
#define ALI_GEN_ATTR_TYPE_REMOTE_ADDRESS 0xF00E
|
||||
#define ALI_GEN_ATTR_TYPE_NEARBY_SIGNAL_INTEN 0xF00F
|
||||
#define ALI_GEN_ATTR_TYPE_SET_VALUE_TIMING 0xF010
|
||||
#define ALI_GEN_ATTR_TYPE_SET_VALUE_PERIODIC 0xF011
|
||||
#define ALI_GEN_ATTR_TYPE_DEL_TIMING 0xF012
|
||||
#define ALI_GEN_ATTR_TYPE_REQ_UPDATE_TIMING 0xF013
|
||||
#define ALI_GEN_ATTR_TYPE_SETTING_TIMING 0xF01D
|
||||
#define ALI_GEN_ATTR_TYPE_TIME_ZONE 0xF01E
|
||||
#define ALI_GEN_ATTR_TYPE_UNIX_TIMER 0xF01F
|
||||
#define ALI_GEN_ATTR_TYPE_POWERDOWN_MEM 0xF021
|
||||
#define ALI_GEN_ATTR_TYPE_CALORIES 0x06D5
|
||||
#define ALI_GEN_ATTR_TYPE_SPORTCOUNT 0x0212
|
||||
#define ALI_GEN_ATTR_TYPE_POWER_STATE 0x0100
|
||||
#define ALI_GEN_ATTR_TYPE_BRIGHTNESS 0x0121
|
||||
#define ALI_GEN_ATTR_TYPE_HARDWARE_RESET 0x0023
|
||||
|
||||
#define ALI_TM_SUB_ADDRESS 0xF000
|
||||
|
||||
/** Default number of Indication */
|
||||
#define CONFIG_INDICATE_NUM (3)
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief 发送数据的开始和结束回调函数定义
|
||||
*/
|
||||
struct bt_adv_ind_send_cb
|
||||
{
|
||||
void (*start)(int err, void *cb_data);
|
||||
void (*end)(int err, void *cb_data);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 发送参数结构体
|
||||
*/
|
||||
struct indicate_param
|
||||
{
|
||||
uint8_t tid;
|
||||
uint8_t trans_cnt;
|
||||
int32_t period;
|
||||
int32_t rand;
|
||||
uint8_t send_ttl;
|
||||
|
||||
void *cb_data;
|
||||
const struct bt_adv_ind_send_cb *cb;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief indicate 发送缓存
|
||||
*/
|
||||
struct bt_mesh_indicate
|
||||
{
|
||||
struct indicate_param param;
|
||||
struct net_buf *buf;
|
||||
uint8_t event;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 天猫精灵相关信息结构体
|
||||
*/
|
||||
struct bt_als_cfg
|
||||
{
|
||||
/** Company Identify */
|
||||
uint16_t cid;
|
||||
|
||||
/** Product Identify */
|
||||
uint32_t pid;
|
||||
|
||||
/** Mac Address */
|
||||
uint8_t mac[6];
|
||||
|
||||
/** Secret Information */
|
||||
uint8_t secret[16];
|
||||
|
||||
/** Currently Library Version */
|
||||
uint32_t version;
|
||||
};
|
||||
|
||||
extern struct bt_mesh_model vnd_models[1];
|
||||
extern uint8_t static_key[16];
|
||||
extern uint8_t tm_uuid[16];
|
||||
extern const struct bt_mesh_model_cb bt_mesh_als_vendor_model_cb;
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief TID selection method
|
||||
*
|
||||
* @return next TID
|
||||
*/
|
||||
uint8_t als_avail_tid_get(void);
|
||||
|
||||
/**
|
||||
* @brief 找一个空的indicate,并分配内存
|
||||
*
|
||||
* @param len - 需要分配的数据长度
|
||||
*
|
||||
* @return indicate结构体指针
|
||||
*/
|
||||
struct bt_mesh_indicate *bt_mesh_ind_alloc(uint16_t len);
|
||||
|
||||
/**
|
||||
* @brief 启动发送通知的事件
|
||||
*
|
||||
* @param ind - indicate结构体指针
|
||||
*/
|
||||
void bt_mesh_indicate_send(struct bt_mesh_indicate *ind);
|
||||
|
||||
/**
|
||||
* @brief 发送当前LED状态,当有LED状态更新时都需要调用此函数
|
||||
*
|
||||
* @param param - 发送通知的发送参数
|
||||
*/
|
||||
void send_led_indicate(struct indicate_param *param);
|
||||
|
||||
/**
|
||||
* @brief 释放所有未发送的通知
|
||||
*/
|
||||
void bt_mesh_indicate_reset(void);
|
||||
|
||||
/**
|
||||
* @brief 阿里 厂家模型 初始化
|
||||
*
|
||||
* @param model - 回调模型参数
|
||||
*
|
||||
* @return always success
|
||||
*/
|
||||
int als_vendor_init(struct bt_mesh_model *model);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,37 @@
|
||||
/********************************** (C) COPYRIGHT *******************************
|
||||
* File Name : ch32v20x_conf.h
|
||||
* Author : WCH
|
||||
* Version : V1.0.0
|
||||
* Date : 2022/06/16
|
||||
* Description : Library configuration file.
|
||||
*********************************************************************************
|
||||
* 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 __CH32V20x_CONF_H
|
||||
#define __CH32V20x_CONF_H
|
||||
|
||||
#include "ch32v20x_adc.h"
|
||||
#include "ch32v20x_bkp.h"
|
||||
#include "ch32v20x_can.h"
|
||||
#include "ch32v20x_crc.h"
|
||||
#include "ch32v20x_dbgmcu.h"
|
||||
#include "ch32v20x_dma.h"
|
||||
#include "ch32v20x_exti.h"
|
||||
#include "ch32v20x_flash.h"
|
||||
#include "ch32v20x_gpio.h"
|
||||
#include "ch32v20x_i2c.h"
|
||||
#include "ch32v20x_iwdg.h"
|
||||
#include "ch32v20x_pwr.h"
|
||||
#include "ch32v20x_rcc.h"
|
||||
#include "ch32v20x_rtc.h"
|
||||
#include "ch32v20x_spi.h"
|
||||
#include "ch32v20x_tim.h"
|
||||
#include "ch32v20x_usart.h"
|
||||
#include "ch32v20x_wwdg.h"
|
||||
#include "ch32v20x_it.h"
|
||||
#include "ch32v20x_misc.h"
|
||||
|
||||
#endif /* __CH32V20x_CONF_H */
|
||||
@@ -0,0 +1,18 @@
|
||||
/********************************** (C) COPYRIGHT *******************************
|
||||
* File Name : ch32v20x_it.h
|
||||
* Author : WCH
|
||||
* Version : V1.0.0
|
||||
* Date : 2022/06/16
|
||||
* Description : This file contains the headers of the interrupt handlers.
|
||||
*********************************************************************************
|
||||
* 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 __CH32V20x_IT_H
|
||||
#define __CH32V20x_IT_H
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
#endif /* __CH32V20x_IT_H */
|
||||
@@ -0,0 +1,31 @@
|
||||
/********************************** (C) COPYRIGHT *******************************
|
||||
* File Name : system_ch32v20x.h
|
||||
* Author : WCH
|
||||
* Version : V1.0.0
|
||||
* Date : 2022/06/16
|
||||
* Description : CH32V20x Device Peripheral Access Layer System Header File.
|
||||
*********************************************************************************
|
||||
* 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 __SYSTEM_ch32v20x_H
|
||||
#define __SYSTEM_ch32v20x_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern uint32_t SystemCoreClock; /* System Clock Frequency (Core Clock) */
|
||||
|
||||
/* System_Exported_Functions */
|
||||
extern void SystemInit(void);
|
||||
extern void SystemCoreClockUpdate(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*__CH32V20x_SYSTEM_H */
|
||||
Reference in New Issue
Block a user