标题:
bc26 NBiot模块原理图pcb源码
[打印本页]
作者:
zhangsmart1101
时间:
2024-8-21 15:27
标题:
bc26 NBiot模块原理图pcb源码
51hei.png
(13.02 KB, 下载次数: 10)
下载附件
2024-8-23 00:45 上传
#include "main.h"
#include "usart.h"
#include "timer.h"
#include "BC26.h"
#include "led.h"
#include "SMP.h"
#include "systempz.h"
GPIO_InitTypeDef GPIO_InitStructure;
static __IO uint32_t TimingDelay;
extern int err;
//***与服务器进行交互,模块可以通过UDP方式传数据到服务器端,服务器也可以支持下发数据到设备端进行显示打印*****************/
/* Private function prototypes -----------------------------------------------*/
void Delay(__IO uint32_t nTime);
/** @addtogroup Template_Project
* @{
*/
/**
* @brief Main program.
* @param None
* @retval None
*/
int main(void)
{
if (SysTick_Config(SystemCoreClock / 1000))//设置24bit定时器 1ms中断一次
{
/* Capture error */
while (1);
}
LED_Init();
uart1_init(115200);
uart2_init(115200);
uart3_init(115200);
printf("\r\n ############ ############\r\n ############("__DATE__ " - " __TIME__ ")############");
////////液晶屏的显示驱动//////
GPIO_Configuration();
printf("INIT EINK EINK GPIO\r\n");
MYRESET(); // 电子纸控制器硬件复位
printf("EINK LCD RESET..\r\n");
READBUSY();
printf("EINK BUSY READ..\r\n");
INIT_SSD1673();
printf("EINK DISPLAY BMP PICTURE OK\r\n");
////////////////
Uart1_SendStr("init stm32L COM1 \r\n"); //打印信息
//Uart2_SendStr("init stm32L COM2 \r\n"); //和NBIOT连接
Uart3_SendStr("init stm32L COM3 \r\n"); //用于其他TTL或者485
while(BC26_Init());
BC26_PDPACT();
BC26_ConUDP();
while (1)
{
BC26_Senddata("15","123\r\n");//发数据
Delay(1000);
BC26_RECData();
GPIO_ToggleBits(GPIOC,GPIO_Pin_3);//翻转LED
}
}
/**
* @brief Inserts a delay time.
* @param nTime: specifies the delay time length, in milliseconds.
* @retval None
*/
void Delay(__IO uint32_t nTime)
{
TimingDelay = nTime;
while(TimingDelay != 0);
}
/**
* @brief Decrements the TimingDelay variable.
* @param None
* @retval None
*/
void TimingDelay_Decrement(void)
{
if (TimingDelay != 0x00)
{
TimingDelay--;
}
}
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
/* Infinite loop */
while (1)
{
}
}
#endif
/**
* @}
*/
复制代码
还未完成,仅供参考:
bc26.7z
(1.96 MB, 下载次数: 3)
2024-8-23 00:48 上传
点击文件名下载附件
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1