24 changed files with 359 additions and 215 deletions
-
4.settings/language.settings.xml
-
3.vscode/settings.json
-
3Core/Inc/spi.h
-
30Core/Src/gpio.c
-
1Core/Src/main.c
-
105Core/Src/spi.c
-
2LWIP/Target/ethernetif.c
-
39README.md
-
12iflytop_xsync/xs_udp.c
-
10iflytop_xsync/xs_udp.h
-
42usrc/base_service/fpga_if.c
-
39usrc/base_service/fpga_if.h
-
48usrc/main.cpp
-
32usrc/service/device.cpp
-
12usrc/service/device.hpp
-
5usrc/service/device_info.cpp
-
13usrc/service/device_info.hpp
-
10usrc/service/extern_if_service.c
-
8usrc/service/extern_if_service.h
-
2usrc/service/reg_manager.c
-
4usrc/service/reg_manager.h
-
36usrc/service/report_generator_service.c
-
12usrc/service/report_generator_service.h
-
102xsync_stm32.ioc
@ -1,38 +1,3 @@ |
|||
``` |
|||
基础组件 |
|||
------------------------- |
|||
1. 微秒定时器 |
|||
2. 网络端口 |
|||
3. 日志接口 |
|||
5. GPIO初始化中断处理 |
|||
6. 网络消息解析处理 |
|||
7. SPI读写 |
|||
8. 线程 |
|||
9. 按键检测 |
|||
------------------------- |
|||
|
|||
------------------------- |
|||
凌云光项目之间共享基础组件 |
|||
------------------------- |
|||
|
|||
线程划分 |
|||
1. UDP接收消息和消息解析。 |
|||
2. 主线程循环点亮LED。 |
|||
3. 按键监听线程,按住回复出厂设置按键,重启设备,设备恢复出厂设置。 |
|||
``` |
|||
|
|||
|
|||
``` |
|||
开发任务: |
|||
1. 支持flash存储 |
|||
2. 支持按键恢复出厂设置 |
|||
3. 支持自动生成MAC地址并保存 |
|||
4. 支持PC指令 |
|||
1. PING指令 |
|||
2. 配置寄存器指令 |
|||
3. 读取寄存器指令 |
|||
4. 支持重新生成MAC地址指令 |
|||
5. flush_flash |
|||
5. 读取写入寄存器 |
|||
``` |
|||
|
|||
ref:https://iflytop1.feishu.cn/docx/FPqjdaTtkoBeU9x4qbjcD6vxnUc |
|||
``` |
@ -1,32 +0,0 @@ |
|||
#include "device.hpp"
|
|||
|
|||
#include "iflytop_xsync/iflytop_xsync.h"
|
|||
#include "project_configs.h"
|
|||
|
|||
using namespace iflytop; |
|||
// extern DMA_HandleTypeDef PC_DEBUG_UART_DMA_HANDLER;
|
|||
#define TAG "Device"
|
|||
|
|||
void Device::init() { |
|||
XS_LOGI(TAG, "%s:%s", PC_PROJECT_NAME, PC_VERSION); |
|||
xs_gpio_init_as_output(&m_debug_led, PC_DEBUG_LIGHT_GPIO, kxs_gpio_nopull, false, false); |
|||
|
|||
// chip_cfg_t chipcfg = {};
|
|||
// chipcfg.us_dleay_tim = &PC_SYS_DELAY_US_TIMER;
|
|||
// chipcfg.tim_irq_scheduler_tim = &PC_SYS_TIM_IRQ_SCHEDULER_TIMER;
|
|||
// chipcfg.huart = &PC_DEBUG_UART;
|
|||
// chipcfg.debuglight = PC_DEBUG_LIGHT_GPIO;
|
|||
|
|||
// chip_init(&chipcfg);
|
|||
|
|||
// zos_cfg_t zoscfg;
|
|||
// zos_init(&zoscfg);
|
|||
} |
|||
void Device::loop() { |
|||
while (1) { |
|||
// xs_gpio_write(&m_debug_led, true);
|
|||
// xs_delay_ms(1000);
|
|||
// xs_gpio_write(&m_debug_led, false);
|
|||
// xs_delay_ms(1000);
|
|||
} |
|||
} |
@ -1,12 +0,0 @@ |
|||
#pragma once
|
|||
#include "iflytop_xsync/iflytop_xsync.h"
|
|||
#include "project_configs.h"
|
|||
namespace iflytop { |
|||
class Device { |
|||
xs_gpio_t m_debug_led; |
|||
|
|||
public: |
|||
void init(); |
|||
void loop(); |
|||
}; |
|||
} // namespace iflytop
|
@ -0,0 +1,5 @@ |
|||
|
|||
|
|||
#include "device_info.hpp"
|
|||
|
|||
void device_info_init() {} |
@ -0,0 +1,13 @@ |
|||
#pragma once
|
|||
#include "iflytop_xsync/iflytop_xsync.h"
|
|||
#include "project_configs.h"
|
|||
|
|||
#ifdef __cplusplus
|
|||
extern "C" { |
|||
#endif
|
|||
|
|||
void device_info_init(); |
|||
|
|||
#ifdef __cplusplus
|
|||
} |
|||
#endif
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue