RF_W13无卡设备
上传云端
This commit is contained in:
30
BLV_RF_W13_V04_20260114/User/include/includes.h
Normal file
30
BLV_RF_W13_V04_20260114/User/include/includes.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef _INCLUDES_H_
|
||||
#define _INCLUDES_H_
|
||||
|
||||
#include "CH57x_common.h"
|
||||
#include "CONFIG.h"
|
||||
#include "HAL.h"
|
||||
#include "gattprofile.h"
|
||||
#include "peripheral.h"
|
||||
#include "debug.h"
|
||||
#include "uart.h"
|
||||
#include "sensor_scan.h"
|
||||
#include "flash.h"
|
||||
|
||||
#define FW_Version 0x04
|
||||
#define EE_Version 0x04
|
||||
|
||||
/********************
|
||||
* <20><>periphera.c<>ļ<EFBFBD><C4BC>е<EFBFBD> static uint8_t scanRspData[] <20><><EFBFBD><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
*
|
||||
* */
|
||||
|
||||
|
||||
|
||||
|
||||
extern volatile uint32_t SysTick_100us;
|
||||
extern volatile uint32_t SysTick_1ms;
|
||||
extern volatile uint32_t SysTick_1s;
|
||||
|
||||
#endif
|
||||
71
BLV_RF_W13_V04_20260114/User/main.c
Normal file
71
BLV_RF_W13_V04_20260114/User/main.c
Normal file
@@ -0,0 +1,71 @@
|
||||
/********************************** (C) COPYRIGHT *******************************
|
||||
* File Name : main.c
|
||||
* Author : WCH
|
||||
* Version : V1.1
|
||||
* Date : 2026/01/14
|
||||
* Description : <20><><EFBFBD><EFBFBD><EFBFBD>ӻ<EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3>ʼ<EFBFBD><CABC>
|
||||
*******************************************************************************/
|
||||
|
||||
/******************************************************************************/
|
||||
/* ͷ<>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> */
|
||||
#include "../User/include/includes.h"
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* GLOBAL TYPEDEFS
|
||||
*/
|
||||
__attribute__((aligned(4))) uint32_t MEM_BUF[BLE_MEMHEAP_SIZE / 4];
|
||||
|
||||
#if(defined(BLE_MAC)) && (BLE_MAC == TRUE)
|
||||
const uint8_t MacAddr[6] = {0x84, 0xC2, 0xE4, 0x03, 0x02, 0x02};
|
||||
#endif
|
||||
|
||||
|
||||
#define ceshi 0x00
|
||||
|
||||
/*********************************************************************
|
||||
* @fn main
|
||||
* @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* @return none
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
HSECFG_Capacitance(HSECap_18p);
|
||||
SetSysClock(CLK_SOURCE_HSE_PLL_100MHz);
|
||||
#if(defined(HAL_SLEEP)) && (HAL_SLEEP == TRUE)
|
||||
GPIOA_ModeCfg(GPIO_Pin_All, GPIO_ModeIN_PU);
|
||||
#endif
|
||||
WDT_Init();
|
||||
|
||||
UARTx_Init(UART_0,115200,BLV_DETInfo_Recv_Processing); //RS485ͨѶ<CDA8><D1B6><EFBFBD><EFBFBD>
|
||||
|
||||
CH57x_BLEInit(); //<2F><>ʼ<EFBFBD><CABC> BLE Э<><D0AD>ջ<EFBFBD>ײ<EFBFBD>
|
||||
HAL_Init(); //<2F><>ʼ<EFBFBD><CABC>Ӳ<EFBFBD><D3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㣨HAL<41><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>оƬ<D0BE><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>衣
|
||||
GAPRole_PeripheralInit(); //<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>裨Peripheral<61><6C><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB> GAP <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
EEPROM_Init();
|
||||
Peripheral_Init(); //Ӧ<>ò<EFBFBD><C3B2>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>
|
||||
Sensor_Init(); //IOɨ<4F><C9A8><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>
|
||||
|
||||
Dbg_Println(DBG_BIT_DEVICE_STATUS,"MCU Start:%s",VER_LIB);
|
||||
PRINT("MCU_Rst:%04x\n", R8_RESET_STATUS);
|
||||
|
||||
while(1)
|
||||
{
|
||||
WDT_Feed();
|
||||
|
||||
UART_RECEIVE();
|
||||
|
||||
DIP_ScanTask();
|
||||
|
||||
TMOS_SystemProcess();
|
||||
|
||||
Blv_CardlessPower_Tack();
|
||||
|
||||
print_RDRsta_Tack();
|
||||
|
||||
Action_Task();
|
||||
}
|
||||
}
|
||||
|
||||
/******************************** endfile @ main ******************************/
|
||||
Reference in New Issue
Block a user