Compare commits
1 Commits
master
...
WT588FxxA-
Author | SHA1 | Date | |
---|---|---|---|
709c6e76d2 |
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -3,7 +3,7 @@ WpfApp1/WpfApp1/obj/*
|
|||
WpfApp1/WpfApp1/bin/*
|
||||
GD32F103C8T6/App/Output/*
|
||||
GD32F103C8T6/Bootloader/Output/*
|
||||
GD32F103C8T6/._GD32F10x.emProject
|
||||
*.emProject
|
||||
*.emSession
|
||||
*.jlink
|
||||
._*
|
|
@ -22,7 +22,7 @@
|
|||
#define API_FRAME_RESPONSE (0x01) /* 响应帧 */
|
||||
#define API_FRAME_NOTIFICATION (0x02) /* 通知帧 */
|
||||
|
||||
#define SOFTWARE_VERSION ("V1.28")
|
||||
#define SOFTWARE_VERSION ("V1.29")
|
||||
#define HARDWARE_VERSION ("V1.01")
|
||||
|
||||
extern uint8_t api_upgrade_mode;
|
||||
|
|
|
@ -1,328 +0,0 @@
|
|||
#include "qgel50x.h"
|
||||
|
||||
#ifdef USE_QGEL50X
|
||||
|
||||
/* 0: 未播放; 1: 正在播放 */
|
||||
static uint8_t qgel50x_status = 0; /* 播放状态(模块) */
|
||||
static uint8_t qgel50x_play_status = 0; /* 播放状态(用户) */
|
||||
|
||||
static uint8_t qgel50x_send_count = 0;
|
||||
|
||||
static uint8_t qgel50x_status_stop_try_count = 0;
|
||||
static uint8_t qgel50x_status_playing_try_count = 0;
|
||||
|
||||
static uint8_t qgel50x_door_opening_warning_task_uuid = 0;
|
||||
static uint8_t qgel50x_left_turn_warning_task_uuid = 0;
|
||||
static uint8_t qgel50x_right_turn_warning_task_uuid = 0;
|
||||
static uint8_t qgel50x_reverse_warning_task_uuid = 0;
|
||||
static uint8_t qgel50x_arrival_warning_task_uuid = 0;
|
||||
static uint8_t qgel50x_departure_warning_task_uuid = 0;
|
||||
static uint8_t qgel50x_please_note_that_task_uuid = 0;
|
||||
|
||||
static void qgel50x_door_opening_warning_task(uint8_t uuid);
|
||||
static void qgel50x_left_turn_warning_task(uint8_t uuid);
|
||||
static void qgel50x_right_turn_warning_task(uint8_t uuid);
|
||||
static void qgel50x_reverse_warning_task(uint8_t uuid);
|
||||
static void qgel50x_arrival_warning_task(uint8_t uuid);
|
||||
static void qgel50x_departure_warning_task(uint8_t uuid);
|
||||
static void qgel50x_please_note_that_task(uint8_t uuid);
|
||||
static void qgel50x_status_parsing_task(uint8_t uuid);
|
||||
|
||||
void qgel50x_init(void)
|
||||
{
|
||||
/* 创建任务, 并挂起 */
|
||||
qgel50x_door_opening_warning_task_uuid = task_create(qgel50x_door_opening_warning_task, 200);
|
||||
task_suspend(qgel50x_door_opening_warning_task_uuid);
|
||||
|
||||
qgel50x_left_turn_warning_task_uuid = task_create(qgel50x_left_turn_warning_task, 200);
|
||||
task_suspend(qgel50x_left_turn_warning_task_uuid);
|
||||
|
||||
qgel50x_right_turn_warning_task_uuid = task_create(qgel50x_right_turn_warning_task, 200);
|
||||
task_suspend(qgel50x_right_turn_warning_task_uuid);
|
||||
|
||||
qgel50x_reverse_warning_task_uuid = task_create(qgel50x_reverse_warning_task, 200);
|
||||
task_suspend(qgel50x_reverse_warning_task_uuid);
|
||||
|
||||
qgel50x_arrival_warning_task_uuid = task_create(qgel50x_arrival_warning_task, 200);
|
||||
task_suspend(qgel50x_arrival_warning_task_uuid);
|
||||
|
||||
qgel50x_departure_warning_task_uuid = task_create(qgel50x_departure_warning_task, 200);
|
||||
task_suspend(qgel50x_departure_warning_task_uuid);
|
||||
|
||||
qgel50x_please_note_that_task_uuid = task_create(qgel50x_please_note_that_task, 100);
|
||||
task_suspend(qgel50x_please_note_that_task_uuid);
|
||||
|
||||
task_create(qgel50x_status_parsing_task, 10);
|
||||
}
|
||||
|
||||
void qgel50x_send_pulse(uint8_t count)
|
||||
{
|
||||
for (uint8_t i = 0; i < count; i++)
|
||||
{
|
||||
gpio_bit_write(QGEL50X_TG1_PERIPH, QGEL50X_TG1_PIN, SET);
|
||||
delay_us(100);
|
||||
gpio_bit_write(QGEL50X_TG1_PERIPH, QGEL50X_TG1_PIN, RESET);
|
||||
delay_us(100);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 音量 +
|
||||
*/
|
||||
void qgel50x_volume_up(void)
|
||||
{
|
||||
qgel50x_send_pulse(3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 音量 -
|
||||
*/
|
||||
void qgel50x_volume_down(void)
|
||||
{
|
||||
qgel50x_send_pulse(4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 停止播放
|
||||
*/
|
||||
void qgel50x_stop(void)
|
||||
{
|
||||
/* 停止 */
|
||||
qgel50x_send_pulse(1);
|
||||
|
||||
delay_ms(100);
|
||||
|
||||
qgel50x_play_status = 0;
|
||||
|
||||
/* 挂起任务 */
|
||||
task_suspend(qgel50x_door_opening_warning_task_uuid);
|
||||
task_suspend(qgel50x_left_turn_warning_task_uuid);
|
||||
task_suspend(qgel50x_right_turn_warning_task_uuid);
|
||||
task_suspend(qgel50x_reverse_warning_task_uuid);
|
||||
task_suspend(qgel50x_arrival_warning_task_uuid);
|
||||
task_suspend(qgel50x_departure_warning_task_uuid);
|
||||
task_suspend(qgel50x_please_note_that_task_uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 开门预警
|
||||
*/
|
||||
void qgel50x_door_opening_warning(void)
|
||||
{
|
||||
task_resume(qgel50x_door_opening_warning_task_uuid);
|
||||
}
|
||||
|
||||
void qgel50x_left_turn_warning(void)
|
||||
{
|
||||
task_resume(qgel50x_left_turn_warning_task_uuid);
|
||||
}
|
||||
|
||||
void qgel50x_right_turn_warning(void)
|
||||
{
|
||||
task_resume(qgel50x_right_turn_warning_task_uuid);
|
||||
}
|
||||
|
||||
void qgel50x_reverse_warning(void)
|
||||
{
|
||||
task_resume(qgel50x_reverse_warning_task_uuid);
|
||||
}
|
||||
|
||||
void qgel50x_arrival_warning(void)
|
||||
{
|
||||
task_resume(qgel50x_arrival_warning_task_uuid);
|
||||
}
|
||||
|
||||
void qgel50x_departure_warning(void)
|
||||
{
|
||||
//task_resume(qgel50x_status_parsing_task_uuid);
|
||||
}
|
||||
|
||||
void qgel50x_please_note_that(void)
|
||||
{
|
||||
/* 开始任务 */
|
||||
task_resume(qgel50x_please_note_that_task_uuid);
|
||||
}
|
||||
|
||||
static void qgel50x_door_opening_warning_task(uint8_t uuid)
|
||||
{
|
||||
/* 默认以200ms间隔检测 */
|
||||
task_set_frequency(uuid, 200);
|
||||
|
||||
/* 未播放语音 */
|
||||
if(qgel50x_status == 0)
|
||||
{
|
||||
if(qgel50x_play_status == 0)
|
||||
{
|
||||
/* 车辆上下客,请勿靠近 */
|
||||
qgel50x_send_pulse(27);
|
||||
|
||||
/* 正在播放, 此时 模块状态 应为 1 */
|
||||
qgel50x_play_status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 未播放 */
|
||||
qgel50x_play_status = 0;
|
||||
|
||||
task_set_frequency(uuid, 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void qgel50x_left_turn_warning_task(uint8_t uuid)
|
||||
{
|
||||
/* 默认以200ms间隔检测 */
|
||||
task_set_frequency(uuid, 200);
|
||||
|
||||
/* 未播放语音 */
|
||||
if(qgel50x_status == 0)
|
||||
{
|
||||
if(qgel50x_play_status == 0)
|
||||
{
|
||||
/* 车辆左转,请注意避让 */
|
||||
qgel50x_send_pulse(31);
|
||||
|
||||
/* 正在播放, 此时 模块状态 应为 1 */
|
||||
qgel50x_play_status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 未播放 */
|
||||
qgel50x_play_status = 0;
|
||||
|
||||
task_set_frequency(uuid, 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void qgel50x_right_turn_warning_task(uint8_t uuid)
|
||||
{
|
||||
/* 默认以200ms间隔检测 */
|
||||
task_set_frequency(uuid, 200);
|
||||
|
||||
/* 未播放语音 */
|
||||
if(qgel50x_status == 0)
|
||||
{
|
||||
if(qgel50x_play_status == 0)
|
||||
{
|
||||
/* 车辆右转,请注意避让 */
|
||||
qgel50x_send_pulse(30);
|
||||
|
||||
/* 正在播放, 此时 模块状态 应为 1 */
|
||||
qgel50x_play_status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 未播放 */
|
||||
qgel50x_play_status = 0;
|
||||
|
||||
task_set_frequency(uuid, 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void qgel50x_reverse_warning_task(uint8_t uuid)
|
||||
{
|
||||
/* 默认以200ms间隔检测 */
|
||||
task_set_frequency(uuid, 200);
|
||||
|
||||
/* 未播放语音 */
|
||||
if(qgel50x_status == 0)
|
||||
{
|
||||
if(qgel50x_play_status == 0)
|
||||
{
|
||||
/* 倒车,请注意避让 */
|
||||
qgel50x_send_pulse(28);
|
||||
|
||||
/* 正在播放, 此时 模块状态 应为 1 */
|
||||
qgel50x_play_status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 未播放 */
|
||||
qgel50x_play_status = 0;
|
||||
|
||||
task_set_frequency(uuid, 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void qgel50x_arrival_warning_task(uint8_t uuid)
|
||||
{
|
||||
/* 默认以200ms间隔检测 */
|
||||
task_set_frequency(uuid, 200);
|
||||
|
||||
/* 未播放语音 */
|
||||
if(qgel50x_status == 0)
|
||||
{
|
||||
if(qgel50x_play_status == 0)
|
||||
{
|
||||
/* 车辆进站,请注意 */
|
||||
qgel50x_send_pulse(26);
|
||||
|
||||
/* 正在播放, 此时 模块状态 应为 1 */
|
||||
qgel50x_play_status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 未播放 */
|
||||
qgel50x_play_status = 0;
|
||||
|
||||
task_set_frequency(uuid, 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void qgel50x_departure_warning_task(uint8_t uuid)
|
||||
{
|
||||
}
|
||||
|
||||
static void qgel50x_please_note_that_task(uint8_t uuid)
|
||||
{
|
||||
qgel50x_send_count++;
|
||||
|
||||
switch (qgel50x_send_count)
|
||||
{
|
||||
case 1:
|
||||
qgel50x_send_pulse(15); /* 请 */
|
||||
task_set_frequency(uuid, 300);
|
||||
break;
|
||||
case 2:
|
||||
qgel50x_send_pulse(16); /* 注意 */
|
||||
task_set_frequency(uuid, 500);
|
||||
break;
|
||||
case 3:
|
||||
qgel50x_send_count = 0;
|
||||
task_set_frequency(uuid, 2000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void qgel50x_status_parsing_task(uint8_t uuid)
|
||||
{
|
||||
/* 正在播放 */
|
||||
if(gpio_input_bit_get(QGEL50X_TG4_PERIPH, QGEL50X_TG4_PIN) == SET)
|
||||
{
|
||||
qgel50x_status_playing_try_count++;
|
||||
|
||||
if(qgel50x_status_playing_try_count > 4)
|
||||
{
|
||||
qgel50x_status = SET;
|
||||
|
||||
qgel50x_status_playing_try_count = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qgel50x_status_stop_try_count++;
|
||||
|
||||
if(qgel50x_status_stop_try_count > 4)
|
||||
{
|
||||
qgel50x_status = RESET;
|
||||
|
||||
qgel50x_status_stop_try_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,24 +0,0 @@
|
|||
#ifndef QGEL50X_H
|
||||
#define QGEL50X_H
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#ifdef USE_QGEL50X
|
||||
|
||||
void qgel50x_init(void);
|
||||
void qgel50x_send_pulse(uint8_t count);
|
||||
|
||||
void qgel50x_volume_up(void);
|
||||
void qgel50x_volume_down(void);
|
||||
void qgel50x_stop(void);
|
||||
void qgel50x_door_opening_warning(void);
|
||||
void qgel50x_left_turn_warning(void);
|
||||
void qgel50x_right_turn_warning(void);
|
||||
void qgel50x_reverse_warning(void);
|
||||
void qgel50x_arrival_warning(void);
|
||||
void qgel50x_departure_warning(void);
|
||||
void qgel50x_please_note_that(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,326 +0,0 @@
|
|||
#include "v58.h"
|
||||
|
||||
/* 0: 未播放; 1: 正在播放 */
|
||||
static uint8_t v58_status = 0; /* 播放状态(模块) */
|
||||
static uint8_t v58_play_status = 0; /* 播放状态(用户) */
|
||||
|
||||
static uint8_t v58_send_count = 0;
|
||||
|
||||
static uint8_t v58_status_stop_try_count = 0;
|
||||
static uint8_t v58_status_playing_try_count = 0;
|
||||
|
||||
static uint8_t v58_door_opening_warning_task_uuid = 0;
|
||||
static uint8_t v58_left_turn_warning_task_uuid = 0;
|
||||
static uint8_t v58_right_turn_warning_task_uuid = 0;
|
||||
static uint8_t v58_reverse_warning_task_uuid = 0;
|
||||
static uint8_t v58_arrival_warning_task_uuid = 0;
|
||||
static uint8_t v58_departure_warning_task_uuid = 0;
|
||||
static uint8_t v58_please_note_that_task_uuid = 0;
|
||||
|
||||
static void v58_door_opening_warning_task(uint8_t uuid);
|
||||
static void v58_left_turn_warning_task(uint8_t uuid);
|
||||
static void v58_right_turn_warning_task(uint8_t uuid);
|
||||
static void v58_reverse_warning_task(uint8_t uuid);
|
||||
static void v58_arrival_warning_task(uint8_t uuid);
|
||||
static void v58_departure_warning_task(uint8_t uuid);
|
||||
static void v58_please_note_that_task(uint8_t uuid);
|
||||
static void v58_status_parsing_task(uint8_t uuid);
|
||||
|
||||
void v58_init(void)
|
||||
{
|
||||
/* 创建任务, 并挂起 */
|
||||
v58_door_opening_warning_task_uuid = task_create(v58_door_opening_warning_task, 200);
|
||||
task_suspend(v58_door_opening_warning_task_uuid);
|
||||
|
||||
v58_left_turn_warning_task_uuid = task_create(v58_left_turn_warning_task, 200);
|
||||
task_suspend(v58_left_turn_warning_task_uuid);
|
||||
|
||||
v58_right_turn_warning_task_uuid = task_create(v58_right_turn_warning_task, 200);
|
||||
task_suspend(v58_right_turn_warning_task_uuid);
|
||||
|
||||
v58_reverse_warning_task_uuid = task_create(v58_reverse_warning_task, 200);
|
||||
task_suspend(v58_reverse_warning_task_uuid);
|
||||
|
||||
v58_arrival_warning_task_uuid = task_create(v58_arrival_warning_task, 200);
|
||||
task_suspend(v58_arrival_warning_task_uuid);
|
||||
|
||||
v58_departure_warning_task_uuid = task_create(v58_departure_warning_task, 200);
|
||||
task_suspend(v58_departure_warning_task_uuid);
|
||||
|
||||
v58_please_note_that_task_uuid = task_create(v58_please_note_that_task, 100);
|
||||
task_suspend(v58_please_note_that_task_uuid);
|
||||
|
||||
task_create(v58_status_parsing_task, 10);
|
||||
}
|
||||
|
||||
void v58_send_pulse(uint8_t count)
|
||||
{
|
||||
for (uint8_t i = 0; i < count; i++)
|
||||
{
|
||||
gpio_bit_write(V58_DATA_PERIPH, V58_DATA_PIN, SET);
|
||||
delay_us(100);
|
||||
gpio_bit_write(V58_DATA_PERIPH, V58_DATA_PIN, RESET);
|
||||
delay_us(100);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 音量 +
|
||||
*/
|
||||
void v58_volume_up(void)
|
||||
{
|
||||
v58_send_pulse(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 音量 -
|
||||
*/
|
||||
void v58_volume_down(void)
|
||||
{
|
||||
v58_send_pulse(3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 停止播放
|
||||
*/
|
||||
void v58_stop(void)
|
||||
{
|
||||
delay_ms(100);
|
||||
|
||||
/* 停止 */
|
||||
v58_send_pulse(1);
|
||||
|
||||
delay_ms(100);
|
||||
|
||||
v58_play_status = 0;
|
||||
|
||||
/* 挂起任务 */
|
||||
task_suspend(v58_door_opening_warning_task_uuid);
|
||||
task_suspend(v58_left_turn_warning_task_uuid);
|
||||
task_suspend(v58_right_turn_warning_task_uuid);
|
||||
task_suspend(v58_reverse_warning_task_uuid);
|
||||
task_suspend(v58_arrival_warning_task_uuid);
|
||||
task_suspend(v58_departure_warning_task_uuid);
|
||||
task_suspend(v58_please_note_that_task_uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 开门预警
|
||||
*/
|
||||
void v58_door_opening_warning(void)
|
||||
{
|
||||
task_resume(v58_door_opening_warning_task_uuid);
|
||||
}
|
||||
|
||||
void v58_left_turn_warning(void)
|
||||
{
|
||||
task_resume(v58_left_turn_warning_task_uuid);
|
||||
}
|
||||
|
||||
void v58_right_turn_warning(void)
|
||||
{
|
||||
task_resume(v58_right_turn_warning_task_uuid);
|
||||
}
|
||||
|
||||
void v58_reverse_warning(void)
|
||||
{
|
||||
task_resume(v58_reverse_warning_task_uuid);
|
||||
}
|
||||
|
||||
void v58_arrival_warning(void)
|
||||
{
|
||||
task_resume(v58_arrival_warning_task_uuid);
|
||||
}
|
||||
|
||||
void v58_departure_warning(void)
|
||||
{
|
||||
// task_resume(v58_status_parsing_task_uuid);
|
||||
}
|
||||
|
||||
void v58_please_note_that(void)
|
||||
{
|
||||
/* 开始任务 */
|
||||
task_resume(v58_please_note_that_task_uuid);
|
||||
}
|
||||
|
||||
static void v58_door_opening_warning_task(uint8_t uuid)
|
||||
{
|
||||
/* 默认以200ms间隔检测 */
|
||||
task_set_frequency(uuid, 200);
|
||||
|
||||
/* 未播放语音 */
|
||||
if (v58_status == 0)
|
||||
{
|
||||
if (v58_play_status == 0)
|
||||
{
|
||||
/* 车辆上下客,请勿靠近 */
|
||||
v58_send_pulse(8);
|
||||
|
||||
/* 正在播放, 此时 模块状态 应为 1 */
|
||||
v58_play_status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 未播放 */
|
||||
v58_play_status = 0;
|
||||
|
||||
task_set_frequency(uuid, 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void v58_left_turn_warning_task(uint8_t uuid)
|
||||
{
|
||||
/* 默认以200ms间隔检测 */
|
||||
task_set_frequency(uuid, 200);
|
||||
|
||||
/* 未播放语音 */
|
||||
if (v58_status == 0)
|
||||
{
|
||||
if (v58_play_status == 0)
|
||||
{
|
||||
/* 车辆左转,请注意避让 */
|
||||
v58_send_pulse(10);
|
||||
|
||||
/* 正在播放, 此时 模块状态 应为 1 */
|
||||
v58_play_status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 未播放 */
|
||||
v58_play_status = 0;
|
||||
|
||||
task_set_frequency(uuid, 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void v58_right_turn_warning_task(uint8_t uuid)
|
||||
{
|
||||
/* 默认以200ms间隔检测 */
|
||||
task_set_frequency(uuid, 200);
|
||||
|
||||
/* 未播放语音 */
|
||||
if (v58_status == 0)
|
||||
{
|
||||
if (v58_play_status == 0)
|
||||
{
|
||||
/* 车辆右转,请注意避让 */
|
||||
v58_send_pulse(9);
|
||||
|
||||
/* 正在播放, 此时 模块状态 应为 1 */
|
||||
v58_play_status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 未播放 */
|
||||
v58_play_status = 0;
|
||||
|
||||
task_set_frequency(uuid, 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void v58_reverse_warning_task(uint8_t uuid)
|
||||
{
|
||||
/* 默认以200ms间隔检测 */
|
||||
task_set_frequency(uuid, 200);
|
||||
|
||||
/* 未播放语音 */
|
||||
if (v58_status == 0)
|
||||
{
|
||||
if (v58_play_status == 0)
|
||||
{
|
||||
/* 倒车,请注意避让 */
|
||||
v58_send_pulse(13);
|
||||
|
||||
/* 正在播放, 此时 模块状态 应为 1 */
|
||||
v58_play_status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 未播放 */
|
||||
v58_play_status = 0;
|
||||
|
||||
task_set_frequency(uuid, 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void v58_arrival_warning_task(uint8_t uuid)
|
||||
{
|
||||
/* 默认以200ms间隔检测 */
|
||||
task_set_frequency(uuid, 200);
|
||||
|
||||
/* 未播放语音 */
|
||||
if (v58_status == 0)
|
||||
{
|
||||
if (v58_play_status == 0)
|
||||
{
|
||||
/* 车辆进站,请注意 */
|
||||
v58_send_pulse(7);
|
||||
|
||||
/* 正在播放, 此时 模块状态 应为 1 */
|
||||
v58_play_status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 未播放 */
|
||||
v58_play_status = 0;
|
||||
|
||||
task_set_frequency(uuid, 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void v58_departure_warning_task(uint8_t uuid)
|
||||
{
|
||||
}
|
||||
|
||||
static void v58_please_note_that_task(uint8_t uuid)
|
||||
{
|
||||
v58_send_count++;
|
||||
|
||||
switch (v58_send_count)
|
||||
{
|
||||
case 1:
|
||||
v58_send_pulse(19); /* 请 */
|
||||
task_set_frequency(uuid, 360);
|
||||
break;
|
||||
case 2:
|
||||
v58_send_pulse(39); /* 注意 */
|
||||
task_set_frequency(uuid, 450);
|
||||
break;
|
||||
case 3:
|
||||
v58_send_count = 0;
|
||||
task_set_frequency(uuid, 2000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void v58_status_parsing_task(uint8_t uuid)
|
||||
{
|
||||
/* 正在播放 */
|
||||
if (gpio_input_bit_get(V58_STATUS_PERIPH, V58_STATUS_PIN) == SET)
|
||||
{
|
||||
v58_status_playing_try_count++;
|
||||
|
||||
if (v58_status_playing_try_count > 4)
|
||||
{
|
||||
v58_status = SET;
|
||||
|
||||
v58_status_playing_try_count = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
v58_status_stop_try_count++;
|
||||
|
||||
if (v58_status_stop_try_count > 4)
|
||||
{
|
||||
v58_status = RESET;
|
||||
|
||||
v58_status_stop_try_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#ifndef __V58_H
|
||||
#define __V58_H
|
||||
|
||||
#include "main.h"
|
||||
|
||||
void v58_init(void);
|
||||
void v58_send_pulse(uint8_t count);
|
||||
void v58_volume_up(void);
|
||||
void v58_volume_down(void);
|
||||
void v58_stop(void);
|
||||
void v58_door_opening_warning(void);
|
||||
void v58_left_turn_warning(void);
|
||||
void v58_right_turn_warning(void);
|
||||
void v58_reverse_warning(void);
|
||||
void v58_arrival_warning(void);
|
||||
void v58_departure_warning(void);
|
||||
void v58_please_note_that(void);
|
||||
|
||||
#endif
|
371
GD32F103C8T6/App/User/Peripheral/WT588FxxA/wt588fxxa.c
Normal file
371
GD32F103C8T6/App/User/Peripheral/WT588FxxA/wt588fxxa.c
Normal file
|
@ -0,0 +1,371 @@
|
|||
#include "wt588fxxa.h"
|
||||
|
||||
// /* 0: 未播放; 1: 正在播放 */
|
||||
// static uint8_t wt588fxxa_status = 0; /* 播放状态(模块) */
|
||||
// static uint8_t wt588fxxa_play_status = 0; /* 播放状态(用户) */
|
||||
|
||||
// static uint8_t wt588fxxa_send_count = 0;
|
||||
|
||||
// static uint8_t wt588fxxa_status_stop_try_count = 0;
|
||||
// static uint8_t wt588fxxa_status_playing_try_count = 0;
|
||||
|
||||
// static uint8_t wt588fxxa_door_opening_warning_task_uuid = 0;
|
||||
// static uint8_t wt588fxxa_left_turn_warning_task_uuid = 0;
|
||||
// static uint8_t wt588fxxa_right_turn_warning_task_uuid = 0;
|
||||
// static uint8_t wt588fxxa_reverse_warning_task_uuid = 0;
|
||||
// static uint8_t wt588fxxa_arrival_warning_task_uuid = 0;
|
||||
// static uint8_t wt588fxxa_departure_warning_task_uuid = 0;
|
||||
// static uint8_t wt588fxxa_please_note_that_task_uuid = 0;
|
||||
|
||||
// static void wt588fxxa_door_opening_warning_task(uint8_t uuid);
|
||||
// static void wt588fxxa_left_turn_warning_task(uint8_t uuid);
|
||||
// static void wt588fxxa_right_turn_warning_task(uint8_t uuid);
|
||||
// static void wt588fxxa_reverse_warning_task(uint8_t uuid);
|
||||
// static void wt588fxxa_arrival_warning_task(uint8_t uuid);
|
||||
// static void wt588fxxa_departure_warning_task(uint8_t uuid);
|
||||
// static void wt588fxxa_please_note_that_task(uint8_t uuid);
|
||||
// static void wt588fxxa_status_parsing_task(uint8_t uuid);
|
||||
|
||||
void wt588fxxa_init(void)
|
||||
{
|
||||
///* 创建任务, 并挂起 */
|
||||
//wt588fxxa_door_opening_warning_task_uuid = task_create(wt588fxxa_door_opening_warning_task, 200);
|
||||
//task_suspend(wt588fxxa_door_opening_warning_task_uuid);
|
||||
|
||||
//wt588fxxa_left_turn_warning_task_uuid = task_create(wt588fxxa_left_turn_warning_task, 200);
|
||||
//task_suspend(wt588fxxa_left_turn_warning_task_uuid);
|
||||
|
||||
//wt588fxxa_right_turn_warning_task_uuid = task_create(wt588fxxa_right_turn_warning_task, 200);
|
||||
//task_suspend(wt588fxxa_right_turn_warning_task_uuid);
|
||||
|
||||
//wt588fxxa_reverse_warning_task_uuid = task_create(wt588fxxa_reverse_warning_task, 200);
|
||||
//task_suspend(wt588fxxa_reverse_warning_task_uuid);
|
||||
|
||||
//wt588fxxa_arrival_warning_task_uuid = task_create(wt588fxxa_arrival_warning_task, 200);
|
||||
//task_suspend(wt588fxxa_arrival_warning_task_uuid);
|
||||
|
||||
//wt588fxxa_departure_warning_task_uuid = task_create(wt588fxxa_departure_warning_task, 200);
|
||||
//task_suspend(wt588fxxa_departure_warning_task_uuid);
|
||||
|
||||
//wt588fxxa_please_note_that_task_uuid = task_create(wt588fxxa_please_note_that_task, 100);
|
||||
//task_suspend(wt588fxxa_please_note_that_task_uuid);
|
||||
|
||||
//task_create(wt588fxxa_status_parsing_task, 10);
|
||||
|
||||
//wt588fxxa_send_pulse(0x1D);
|
||||
}
|
||||
|
||||
void wt588fxxa_send_pulse(uint8_t count)
|
||||
{
|
||||
// for (uint8_t i = 0; i < count; i++)
|
||||
// {
|
||||
// gpio_bit_write(wt588fxxa_DATA_PERIPH, wt588fxxa_DATA_PIN, SET);
|
||||
// delay_us(100);
|
||||
// gpio_bit_write(wt588fxxa_DATA_PERIPH, wt588fxxa_DATA_PIN, RESET);
|
||||
// delay_us(100);
|
||||
// }
|
||||
|
||||
uint8_t S_DATA;
|
||||
uint8_t B_DATA;
|
||||
S_DATA = count;
|
||||
//P_DATA = 0;
|
||||
gpio_bit_write(WT588FXXA_DATA_PERIPH, WT588FXXA_DATA_PIN, RESET);
|
||||
delay_ms(5); // 延时 5ms
|
||||
B_DATA = S_DATA & 0X01;
|
||||
for (uint8_t j = 0; j < 8; j++)
|
||||
{
|
||||
if (B_DATA == 1)
|
||||
{
|
||||
//P_DATA = 1;
|
||||
gpio_bit_write(WT588FXXA_DATA_PERIPH, WT588FXXA_DATA_PIN, SET);
|
||||
delay_us(600); // 延时 600us
|
||||
//P_DATA = 0;
|
||||
gpio_bit_write(WT588FXXA_DATA_PERIPH, WT588FXXA_DATA_PIN, RESET);
|
||||
delay_us(200); // 延时 200us
|
||||
}
|
||||
else
|
||||
{
|
||||
//P_DATA = 1;
|
||||
gpio_bit_write(WT588FXXA_DATA_PERIPH, WT588FXXA_DATA_PIN, SET);
|
||||
delay_us(200); // 延时 200us
|
||||
//P_DATA = 0;
|
||||
gpio_bit_write(WT588FXXA_DATA_PERIPH, WT588FXXA_DATA_PIN, RESET);
|
||||
delay_us(600); // 延时 600us
|
||||
}
|
||||
S_DATA = S_DATA >> 1;
|
||||
B_DATA = S_DATA & 0X01;
|
||||
}
|
||||
//P_DATA = 1;
|
||||
gpio_bit_write(WT588FXXA_DATA_PERIPH, WT588FXXA_DATA_PIN, SET);
|
||||
|
||||
delay_ms(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 音量 +
|
||||
*/
|
||||
void wt588fxxa_volume_up(void)
|
||||
{
|
||||
//wt588fxxa_send_pulse(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 音量 -
|
||||
*/
|
||||
void wt588fxxa_volume_down(void)
|
||||
{
|
||||
//wt588fxxa_send_pulse(3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 停止播放
|
||||
*/
|
||||
void wt588fxxa_stop(void)
|
||||
{
|
||||
delay_ms(100);
|
||||
|
||||
/* 停止 */
|
||||
wt588fxxa_send_pulse(0xFE);
|
||||
|
||||
delay_ms(100);
|
||||
|
||||
//wt588fxxa_play_status = 0;
|
||||
|
||||
///* 挂起任务 */
|
||||
//task_suspend(wt588fxxa_door_opening_warning_task_uuid);
|
||||
//task_suspend(wt588fxxa_left_turn_warning_task_uuid);
|
||||
//task_suspend(wt588fxxa_right_turn_warning_task_uuid);
|
||||
//task_suspend(wt588fxxa_reverse_warning_task_uuid);
|
||||
//task_suspend(wt588fxxa_arrival_warning_task_uuid);
|
||||
//task_suspend(wt588fxxa_departure_warning_task_uuid);
|
||||
//task_suspend(wt588fxxa_please_note_that_task_uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 开门预警
|
||||
*/
|
||||
void wt588fxxa_door_opening_warning(void)
|
||||
{
|
||||
//task_resume(wt588fxxa_door_opening_warning_task_uuid);
|
||||
wt588fxxa_send_pulse(0x06);
|
||||
wt588fxxa_send_pulse(0xF2);
|
||||
}
|
||||
|
||||
void wt588fxxa_left_turn_warning(void)
|
||||
{
|
||||
//task_resume(wt588fxxa_left_turn_warning_task_uuid);
|
||||
wt588fxxa_send_pulse(0x08);
|
||||
wt588fxxa_send_pulse(0xF2);
|
||||
}
|
||||
|
||||
void wt588fxxa_right_turn_warning(void)
|
||||
{
|
||||
//task_resume(wt588fxxa_right_turn_warning_task_uuid);
|
||||
wt588fxxa_send_pulse(0x07);
|
||||
wt588fxxa_send_pulse(0xF2);
|
||||
}
|
||||
|
||||
void wt588fxxa_reverse_warning(void)
|
||||
{
|
||||
//task_resume(wt588fxxa_reverse_warning_task_uuid);
|
||||
wt588fxxa_send_pulse(0x0B);
|
||||
wt588fxxa_send_pulse(0xF2);
|
||||
}
|
||||
|
||||
void wt588fxxa_arrival_warning(void)
|
||||
{
|
||||
wt588fxxa_send_pulse(0x05);
|
||||
wt588fxxa_send_pulse(0xF2);
|
||||
}
|
||||
|
||||
void wt588fxxa_departure_warning(void)
|
||||
{
|
||||
}
|
||||
|
||||
void wt588fxxa_please_note_that(void)
|
||||
{
|
||||
// /* 开始任务 */
|
||||
// task_resume(wt588fxxa_please_note_that_task_uuid);
|
||||
}
|
||||
|
||||
// static void wt588fxxa_door_opening_warning_task(uint8_t uuid)
|
||||
// {
|
||||
// /* 默认以200ms间隔检测 */
|
||||
// task_set_frequency(uuid, 200);
|
||||
|
||||
// /* 未播放语音 */
|
||||
// if (wt588fxxa_status == 0)
|
||||
// {
|
||||
// if (wt588fxxa_play_status == 0)
|
||||
// {
|
||||
// /* 车辆上下客,请勿靠近 */
|
||||
// wt588fxxa_send_pulse(0x06);
|
||||
|
||||
// /* 正在播放, 此时 模块状态 应为 1 */
|
||||
// wt588fxxa_play_status = 1;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// /* 未播放 */
|
||||
// wt588fxxa_play_status = 0;
|
||||
|
||||
// task_set_frequency(uuid, 2000);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// static void wt588fxxa_left_turn_warning_task(uint8_t uuid)
|
||||
// {
|
||||
// /* 默认以200ms间隔检测 */
|
||||
// task_set_frequency(uuid, 200);
|
||||
|
||||
// /* 未播放语音 */
|
||||
// if (wt588fxxa_status == 0)
|
||||
// {
|
||||
// if (wt588fxxa_play_status == 0)
|
||||
// {
|
||||
// /* 车辆左转,请注意避让 */
|
||||
// wt588fxxa_send_pulse(0x08);
|
||||
|
||||
// /* 正在播放, 此时 模块状态 应为 1 */
|
||||
// wt588fxxa_play_status = 1;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// /* 未播放 */
|
||||
// wt588fxxa_play_status = 0;
|
||||
|
||||
// task_set_frequency(uuid, 2000);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// void wt588fxxa_right_turn_warning_task(uint8_t uuid)
|
||||
// {
|
||||
// /* 默认以200ms间隔检测 */
|
||||
// task_set_frequency(uuid, 200);
|
||||
|
||||
// /* 未播放语音 */
|
||||
// if (wt588fxxa_status == 0)
|
||||
// {
|
||||
// if (wt588fxxa_play_status == 0)
|
||||
// {
|
||||
// /* 车辆右转,请注意避让 */
|
||||
// wt588fxxa_send_pulse(0x07);
|
||||
|
||||
// /* 正在播放, 此时 模块状态 应为 1 */
|
||||
// wt588fxxa_play_status = 1;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// /* 未播放 */
|
||||
// wt588fxxa_play_status = 0;
|
||||
|
||||
// task_set_frequency(uuid, 2000);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// void wt588fxxa_reverse_warning_task(uint8_t uuid)
|
||||
// {
|
||||
// /* 默认以200ms间隔检测 */
|
||||
// task_set_frequency(uuid, 200);
|
||||
|
||||
// /* 未播放语音 */
|
||||
// if (wt588fxxa_status == 0)
|
||||
// {
|
||||
// if (wt588fxxa_play_status == 0)
|
||||
// {
|
||||
// /* 倒车,请注意避让 */
|
||||
// wt588fxxa_send_pulse(0x0B);
|
||||
|
||||
// /* 正在播放, 此时 模块状态 应为 1 */
|
||||
// wt588fxxa_play_status = 1;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// /* 未播放 */
|
||||
// wt588fxxa_play_status = 0;
|
||||
|
||||
// task_set_frequency(uuid, 2000);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// static void wt588fxxa_arrival_warning_task(uint8_t uuid)
|
||||
// {
|
||||
// /* 默认以200ms间隔检测 */
|
||||
// task_set_frequency(uuid, 200);
|
||||
|
||||
// /* 未播放语音 */
|
||||
// if (wt588fxxa_status == 0)
|
||||
// {
|
||||
// if (wt588fxxa_play_status == 0)
|
||||
// {
|
||||
// /* 车辆进站,请注意 */
|
||||
// wt588fxxa_send_pulse(0x05);
|
||||
|
||||
// /* 正在播放, 此时 模块状态 应为 1 */
|
||||
// wt588fxxa_play_status = 1;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// /* 未播放 */
|
||||
// wt588fxxa_play_status = 0;
|
||||
|
||||
// task_set_frequency(uuid, 2000);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// static void wt588fxxa_departure_warning_task(uint8_t uuid)
|
||||
// {
|
||||
// }
|
||||
|
||||
// static void wt588fxxa_please_note_that_task(uint8_t uuid)
|
||||
// {
|
||||
// wt588fxxa_send_count++;
|
||||
|
||||
// switch (wt588fxxa_send_count)
|
||||
// {
|
||||
// case 1:
|
||||
// wt588fxxa_send_pulse(19); /* 请 */
|
||||
// task_set_frequency(uuid, 360);
|
||||
// break;
|
||||
// case 2:
|
||||
// wt588fxxa_send_pulse(39); /* 注意 */
|
||||
// task_set_frequency(uuid, 450);
|
||||
// break;
|
||||
// case 3:
|
||||
// wt588fxxa_send_count = 0;
|
||||
// task_set_frequency(uuid, 2000);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// static void wt588fxxa_status_parsing_task(uint8_t uuid)
|
||||
// {
|
||||
// /* 正在播放 */
|
||||
// if (gpio_input_bit_get(V58_STATUS_PERIPH, V58_STATUS_PIN) == RESET)
|
||||
// {
|
||||
// wt588fxxa_status_playing_try_count++;
|
||||
|
||||
// if (wt588fxxa_status_playing_try_count > 4)
|
||||
// {
|
||||
// wt588fxxa_status = SET;
|
||||
|
||||
// wt588fxxa_status_playing_try_count = 0;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// wt588fxxa_status_stop_try_count++;
|
||||
|
||||
// if (wt588fxxa_status_stop_try_count > 4)
|
||||
// {
|
||||
// wt588fxxa_status = RESET;
|
||||
|
||||
// wt588fxxa_status_stop_try_count = 0;
|
||||
// }
|
||||
// }
|
||||
// }
|
19
GD32F103C8T6/App/User/Peripheral/WT588FxxA/wt588fxxa.h
Normal file
19
GD32F103C8T6/App/User/Peripheral/WT588FxxA/wt588fxxa.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
#ifndef __WT588FXXA_H
|
||||
#define __WT588FXXA_H
|
||||
|
||||
#include "main.h"
|
||||
|
||||
void wt588fxxa_init(void);
|
||||
void wt588fxxa_send_pulse(uint8_t count);
|
||||
void wt588fxxa_volume_up(void);
|
||||
void wt588fxxa_volume_down(void);
|
||||
void wt588fxxa_stop(void);
|
||||
void wt588fxxa_door_opening_warning(void);
|
||||
void wt588fxxa_left_turn_warning(void);
|
||||
void wt588fxxa_right_turn_warning(void);
|
||||
void wt588fxxa_reverse_warning(void);
|
||||
void wt588fxxa_arrival_warning(void);
|
||||
void wt588fxxa_departure_warning(void);
|
||||
void wt588fxxa_please_note_that(void);
|
||||
|
||||
#endif
|
|
@ -148,7 +148,7 @@ void app_init(void)
|
|||
api_init();
|
||||
|
||||
/* 语音芯片初始化 */
|
||||
v58_init();
|
||||
wt588fxxa_init();
|
||||
|
||||
m62429_init();
|
||||
|
||||
|
@ -507,7 +507,7 @@ static void vehicle_status_parsing_task(uint8_t uuid)
|
|||
/* 优先级最高, 如果状态为触发, 关闭语音 */
|
||||
if (reversing_status == 0)
|
||||
{
|
||||
v58_stop();
|
||||
wt588fxxa_stop();
|
||||
|
||||
/* 修改系统当前状态 */
|
||||
diaodu_status = 0xFF;
|
||||
|
@ -554,7 +554,7 @@ static void vehicle_status_parsing_task(uint8_t uuid)
|
|||
if (diaodu_status == 1)
|
||||
{
|
||||
/* 关闭语音 */
|
||||
v58_stop();
|
||||
wt588fxxa_stop();
|
||||
|
||||
/* 重置进站状态 */
|
||||
diaodu_status_temporry = diaodu_status = 0;
|
||||
|
@ -601,7 +601,7 @@ static void vehicle_status_parsing_task(uint8_t uuid)
|
|||
status_type = 4;
|
||||
|
||||
/* 优先级最高,关闭语音 */
|
||||
v58_stop();
|
||||
wt588fxxa_stop();
|
||||
|
||||
door_status = 0x01;
|
||||
turn_left_status = 0x01;
|
||||
|
@ -752,34 +752,34 @@ EXECUTE:
|
|||
strobe_light_reset();
|
||||
|
||||
/* 停止语音播报 */
|
||||
v58_stop();
|
||||
wt588fxxa_stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 停止语音播报 */
|
||||
v58_stop();
|
||||
wt588fxxa_stop();
|
||||
|
||||
/* 播报语音 */
|
||||
switch (status_type)
|
||||
{
|
||||
case 0:
|
||||
v58_door_opening_warning();
|
||||
wt588fxxa_door_opening_warning();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
v58_left_turn_warning();
|
||||
wt588fxxa_left_turn_warning();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
v58_right_turn_warning();
|
||||
wt588fxxa_right_turn_warning();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
v58_reverse_warning();
|
||||
wt588fxxa_reverse_warning();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
v58_arrival_warning();
|
||||
wt588fxxa_arrival_warning();
|
||||
break;
|
||||
|
||||
case 5:
|
||||
|
@ -929,7 +929,7 @@ void api_notify_get_can_type(void)
|
|||
|
||||
void api_notify_send_audio_pulse(uint8_t pulse_count)
|
||||
{
|
||||
v58_send_pulse(pulse_count);
|
||||
wt588fxxa_send_pulse(pulse_count);
|
||||
|
||||
api_response_send_audio_pulse(API_SUCCESS);
|
||||
}
|
||||
|
@ -939,26 +939,31 @@ void api_notify_data_forwarding(uint8_t type, uint8_t value)
|
|||
switch (type)
|
||||
{
|
||||
case 0x00:
|
||||
vehicle_status_trigger_mode = 1;
|
||||
door_front_upload_status = 0x01;
|
||||
door_front_status_temporary = value;
|
||||
break;
|
||||
|
||||
case 0x01:
|
||||
vehicle_status_trigger_mode = 1;
|
||||
door_back_upload_status = 0x01;
|
||||
door_back_status_temporary = value;
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
vehicle_status_trigger_mode = 1;
|
||||
turn_left_upload_status = 0x01;
|
||||
turn_left_status_temporary = value;
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
vehicle_status_trigger_mode = 1;
|
||||
turn_right_upload_status = 0x01;
|
||||
turn_right_status_temporary = value;
|
||||
break;
|
||||
|
||||
case 0x04:
|
||||
vehicle_status_trigger_mode = 1;
|
||||
reversing_upload_status = 0x01;
|
||||
reversing_status_temporary = value;
|
||||
break;
|
||||
|
|
|
@ -60,10 +60,10 @@ static void bsp_initialization(void)
|
|||
gpio_config(AMP_CTRL_PERIPH, AMP_CTRL_PIN, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, SET);
|
||||
|
||||
/* DATA 控制脚 初始化 */
|
||||
gpio_config(V58_DATA_PERIPH, V58_DATA_PIN, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, RESET);
|
||||
gpio_config(WT588FXXA_DATA_PERIPH, WT588FXXA_DATA_PIN, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, RESET);
|
||||
|
||||
/* STATUS 控制脚 初始化 */
|
||||
gpio_config(V58_STATUS_PERIPH, V58_STATUS_PIN, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, nullptr);
|
||||
gpio_config(WT588FXXA_STATUS_PERIPH, WT588FXXA_STATUS_PIN, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, nullptr);
|
||||
|
||||
iic_config(M62429_SDA_PERIPH, M62429_SDA_PIN, M62429_SCL_PERIPH, M62429_SCL_PIN);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "diaodu.h"
|
||||
#include "setting.h"
|
||||
#include "m62429.h"
|
||||
#include "v58.h"
|
||||
#include "wt588fxxa.h"
|
||||
|
||||
/* 上位机 通讯串口 */
|
||||
#define HOST_USART_PERIPH USART1
|
||||
|
@ -90,13 +90,13 @@
|
|||
#define AMP_CTRL_PERIPH GPIOB
|
||||
#define AMP_CTRL_PIN GPIO_PIN_5
|
||||
|
||||
/* V58 DATA 控制脚 */
|
||||
#define V58_DATA_PERIPH GPIOA
|
||||
#define V58_DATA_PIN GPIO_PIN_4
|
||||
/* WT588FXXA DATA 控制脚 */
|
||||
#define WT588FXXA_DATA_PERIPH GPIOA
|
||||
#define WT588FXXA_DATA_PIN GPIO_PIN_7
|
||||
|
||||
/* AK517 STATUS 控制脚 */
|
||||
#define V58_STATUS_PERIPH GPIOA
|
||||
#define V58_STATUS_PIN GPIO_PIN_7
|
||||
/* WT588FXXA STATUS 控制脚 */
|
||||
#define WT588FXXA_STATUS_PERIPH GPIOA
|
||||
#define WT588FXXA_STATUS_PIN GPIO_PIN_4
|
||||
|
||||
#define M62429_SCL_PERIPH GPIOB
|
||||
#define M62429_SCL_PIN GPIO_PIN_10
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
arm_target_device_name="CS32F103C8"
|
||||
arm_target_interface_type="SWD"
|
||||
c_preprocessor_definitions="ARM_MATH_CM3;GD32F10X_MD;USE_STDPERIPH_DRIVER;__GD32F103_SUBFAMILY;__GD32F10X_FAMILY;__NO_FPU_ENABLE"
|
||||
c_user_include_directories="$(ProjectDir);$(ProjectDir)/CMSIS_5/CMSIS/Core/Include;$(ProjectDir)/User;$(ProjectDir)/User/Peripheral/Api;$(ProjectDir)/User/Peripheral/AK517;$(ProjectDir)/User/Peripheral/CAN;$(ProjectDir)/User/Peripheral/DiaoDu;$(ProjectDir)/User/Peripheral/M62429;$(ProjectDir)/User/Peripheral/QGEL50X;$(ProjectDir)/User/Peripheral/V58;$(ProjectDir)/../../../../arm/GD32F10x/Driver/Include;$(ProjectDir)/../../../../arm/GD32F10x/System/Include;$(ProjectDir)/../../../../arm/GD32F10x/Utils/Byte"
|
||||
c_user_include_directories="$(ProjectDir);$(ProjectDir)/CMSIS_5/CMSIS/Core/Include;$(ProjectDir)/User;$(ProjectDir)/User/Peripheral/Api;$(ProjectDir)/User/Peripheral/AK517;$(ProjectDir)/User/Peripheral/CAN;$(ProjectDir)/User/Peripheral/DiaoDu;$(ProjectDir)/User/Peripheral/M62429;$(ProjectDir)/User/Peripheral/QGEL50X;$(ProjectDir)/User/Peripheral/V58;$(ProjectDir)/User/Peripheral/WT588FXXA;$(ProjectDir)/../../../../arm/GD32F10x/Driver/Include;$(ProjectDir)/../../../../arm/GD32F10x/System/Include;$(ProjectDir)/../../../../arm/GD32F10x/Utils/Byte"
|
||||
debug_register_definition_file="$(ProjectDir)/GD32F10x_MD_Registers.xml"
|
||||
debug_stack_pointer_start="__stack_end__"
|
||||
debug_start_from_entry_point_symbol="Yes"
|
||||
|
@ -41,7 +41,7 @@
|
|||
gcc_entry_point="Reset_Handler"
|
||||
link_linker_script_file="$(ProjectDir)/GD32F10x_Flash.icf"
|
||||
linker_memory_map_file="$(ProjectDir)/GD32F103C8_MemoryMap.xml"
|
||||
linker_output_format="hex"
|
||||
linker_output_format="bin"
|
||||
linker_printf_fp_enabled="Float"
|
||||
linker_section_placements_segments="FLASH1 RX 0x08000000 0x00020000;RAM1 RWX 0x20000000 0x00005000;"
|
||||
macros="DeviceHeaderFile=$(PackagesDir)/GD32F10x/Device/Include/gd32f10x.h;DeviceSystemFile=$(PackagesDir)/GD32F10x/Device/Source/system_gd32f10x.c;DeviceVectorsFile=$(PackagesDir)/GD32F10x/Source/gd32f10x_md_Vectors.s;DeviceFamily=GD32F10x;DeviceSubFamily=GD32F103;Target=GD32F103C8"
|
||||
|
@ -165,9 +165,9 @@
|
|||
<file file_name="User/Peripheral/M62429/m62429.c" />
|
||||
<file file_name="User/Peripheral/M62429/m62429.h" />
|
||||
</folder>
|
||||
<folder Name="V58">
|
||||
<file file_name="User/Peripheral/V58/v58.c" />
|
||||
<file file_name="User/Peripheral/V58/v58.h" />
|
||||
<folder Name="WT588FXXA">
|
||||
<file file_name="User/Peripheral/WT588FxxA/wt588fxxa.c" />
|
||||
<file file_name="User/Peripheral/WT588FxxA/wt588fxxa.h" />
|
||||
</folder>
|
||||
</folder>
|
||||
<file file_name="User/app.c" />
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
<session>
|
||||
<Bookmarks/>
|
||||
<Breakpoints groups="Breakpoints" active_group="Breakpoints">
|
||||
<BreakpointListItem trigger="" line="218" counter="0" hardwareBreakpoint="" isFunctionBreakpoint="false" action="" expression="" group="Breakpoints" type="Breakpoint" state="2" filename="App/User/app.c" useHWbreakpoint="false"/>
|
||||
<BreakpointListItem trigger="" line="241" counter="0" hardwareBreakpoint="" isFunctionBreakpoint="false" action="" expression="" group="Breakpoints" type="Breakpoint" state="2" filename="App/User/app.c" useHWbreakpoint="false"/>
|
||||
<BreakpointListItem trigger="" line="248" counter="0" hardwareBreakpoint="" isFunctionBreakpoint="false" action="" expression="" group="Breakpoints" type="Breakpoint" state="2" filename="App/User/app.c" useHWbreakpoint="false"/>
|
||||
<BreakpointListItem trigger="" line="92" counter="0" hardwareBreakpoint="" isFunctionBreakpoint="false" action="" expression="" group="Breakpoints" type="Breakpoint" state="2" filename="../../../arm/GD32F10x/System/Source/task.c" useHWbreakpoint="false"/>
|
||||
</Breakpoints>
|
||||
<ExecutionProfileWindow/>
|
||||
|
@ -33,11 +34,13 @@
|
|||
<ProjectSessionItem path="GD32F10x"/>
|
||||
<ProjectSessionItem path="GD32F10x;App"/>
|
||||
<ProjectSessionItem path="GD32F10x;App;Device"/>
|
||||
<ProjectSessionItem path="GD32F10x;App;Device;Driver"/>
|
||||
<ProjectSessionItem path="GD32F10x;App;Device;Driver;Include"/>
|
||||
<ProjectSessionItem path="GD32F10x;App;Device;System"/>
|
||||
<ProjectSessionItem path="GD32F10x;App;Device;System;Source"/>
|
||||
<ProjectSessionItem path="GD32F10x;App;User"/>
|
||||
<ProjectSessionItem path="GD32F10x;App;User;Api"/>
|
||||
<ProjectSessionItem path="GD32F10x;App;User;Peripheral"/>
|
||||
<ProjectSessionItem path="GD32F10x;App;User;Peripheral;Api"/>
|
||||
<ProjectSessionItem path="GD32F10x;App;User;Peripheral;M62429"/>
|
||||
<ProjectSessionItem path="GD32F10x;App;User;Peripheral;V58"/>
|
||||
<ProjectSessionItem path="GD32F10x;Bootloader"/>
|
||||
|
@ -88,27 +91,27 @@
|
|||
<Watches active="0" update="Never"/>
|
||||
</Watch4>
|
||||
<Files>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="0" y="5" useTextEdit="1" path="App/main.c" left="0" top="0" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="22" y="111" useTextEdit="1" openedFrom="F:/Works/Tvis/AVS/GD32F103C8T6/App/User/app.c" path="App/main.h" left="0" top="61" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="19" y="695" useTextEdit="1" openedFrom="X:/Works/Tvis/AVS/V1.20/App/User/Peripheral/IR/ir.c" path="App/User/app.c" left="0" selected="1" top="662" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="52" y="24" useTextEdit="1" path="App/User/Api/api.h" left="0" top="18" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="38" y="199" useTextEdit="1" openedFrom="X:/Works/Tvis/AVS/GD32F103C8T6/App/User/Api/api.h" path="App/User/Api/api.c" left="0" top="187" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="0" y="56" useTextEdit="1" openedFrom="F:/Works/Tvis/AVS/GD32F103C8T6(1.1)/App/main.c" path="../../../arm/GD32F10x/System/Source/task.c" left="0" top="34" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="99" y="70" useTextEdit="1" path="App/main.c" left="0" top="45" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="8" y="107" useTextEdit="1" openedFrom="/Volumes/HIKVISION/Works/Tvis/AVS/GD32F103C8T6/App/main.c" path="App/main.h" left="0" top="89" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="46" y="172" useTextEdit="1" openedFrom="X:/Works/Tvis/AVS/V1.20/App/User/Peripheral/IR/ir.c" path="App/User/app.c" left="0" selected="1" top="137" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="17" y="38" useTextEdit="1" openedFrom="G:/Works/Tvis/AVS/GD32F103C8T6/App/User/app.c" path="../../../arm/GD32F10x/System/Source/task.c" left="0" top="35" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="24" y="4" useTextEdit="1" openedFrom="F:/Works/Tvis/AVS/GD32F103C8T6/App/User/Api/api.c" path="../../../arm/GD32F10x/System/Source/setting.c" left="9" top="1" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="8" y="5" useTextEdit="1" openedFrom="F:/Works/arm/GD32F10x/System/Source/setting.c" path="../../../arm/GD32F10x/System/Include/setting.h" left="0" top="1" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="26" y="20" useTextEdit="1" path="App/User/Peripheral/CAN/can_parsing.c" left="11" top="17" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="0" y="0" useTextEdit="1" path="App/User/Peripheral/DiaoDu/diaodu.c" left="0" top="0" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="5" y="99" useTextEdit="1" path="App/User/Peripheral/M62429/m62429.c" left="0" top="55" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="29" y="22" useTextEdit="1" path="App/User/Peripheral/M62429/m62429.c" left="0" top="0" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="0" y="0" useTextEdit="1" path="App/User/Peripheral/IR/ir.h" left="0" top="0" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="55" y="72" useTextEdit="1" path="App/User/Peripheral/IR/ir.c" left="0" top="64" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="35" y="6" useTextEdit="1" path="App/User/Peripheral/M62429/m62429.h" left="20" top="3" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="32" y="16" useTextEdit="1" path="App/User/Peripheral/V58/v58.h" left="17" top="13" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="23" y="198" useTextEdit="1" openedFrom="F:/Works/Tvis/AVS/GD32F103C8T6(1.1)/App/main.c" path="../../../arm/GD32F10x/System/Source/can.c" left="0" top="173" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="23" y="198" useTextEdit="1" openedFrom="F:/Works/Tvis/AVS/GD32F103C8T6(1.1)/App/main.c" path="../../../arm/GD32F10x/System/Source/can.c" left="0" top="177" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="0" y="122" useTextEdit="1" openedFrom="F:/Works/arm/GD32F10x/System/Source/can.c" path="../../../arm/GD32F10x/Driver/Source/gd32f10x_rcu.c" left="0" top="119" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="41" y="36" useTextEdit="1" path="Bootloader/main.h" left="0" top="2" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="41" y="36" useTextEdit="1" path="Bootloader/main.h" left="0" top="11" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="8" y="32" useTextEdit="1" path="Bootloader/main.c" left="0" top="14" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="73" y="117" useTextEdit="1" path="GD32F10x.emProject" left="0" top="110" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="9" y="6" useTextEdit="1" path="../../../arm/GD32F10x/System/Include/system.h" left="0" top="0" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="54" y="24" useTextEdit="1" path="App/User/Peripheral/Api/api.h" left="0" top="5" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="14" y="83" useTextEdit="1" openedFrom="/Volumes/HIKVISION/Works/Tvis/AVS/GD32F103C8T6/App/User/Peripheral/V58/v58.h" path="App/User/Peripheral/V58/v58.c" left="0" top="60" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="49" y="314" useTextEdit="1" openedFrom="/Volumes/HIKVISION/Works/Tvis/AVS/GD32F103C8T6/App/User/Peripheral/V58/v58.c" path="../../../arm/GD32F10x/Driver/Include/gd32f10x.h" left="0" top="296" codecName="UTF-8"/>
|
||||
<SessionOpenFile windowGroup="DockEditLeft" x="0" y="0" useTextEdit="1" path="App/User/app.h" left="0" top="0" codecName="UTF-8"/>
|
||||
</Files>
|
||||
<EMStudioWindow activeProject="App" fileDialogDefaultFilter="*.c" autoConnectTarget="J-Link" buildConfiguration="Debug" sessionSettings="" debugSearchFileMap="/Volumes/HIKVISION/Works/Tvis/AVS/GD32F103C8T6/App/SEGGER_THUMB_Startup.s
F:/Works/Tvis/AVS/GD32F103C8T6/App/SEGGER_THUMB_Startup.s
CMSIS_5/CMSIS/Core/Include/cmsis_gcc.h
/Volumes/HIKVISION/Works/Tvis/AVS/GD32F103C8T6/App/User/Peripheral/AK517/ak517.h
CMSIS_5/CMSIS/Core/Include/core_cm3.h
/Volumes/HIKVISION/Works/Tvis/AVS/GD32F103C8T6/App/User/Peripheral/AK517/ak517.c
User\Peripheral\V58/v58.c
/Volumes/HIKVISION/Works/Tvis/AVS/GD32F103C8T6/App/User/Peripheral/V58/v58.c" fileDialogInitialDirectory="/Volumes/HIKVISION/Works/Tvis/AVS/GD32F103C8T6/App/User/Peripheral/V58" debugSearchPath="" autoConnectCapabilities="3199"/>
|
||||
<EMStudioWindow activeProject="App" fileDialogDefaultFilter="*.c" autoConnectTarget="J-Link" buildConfiguration="Debug" sessionSettings="" debugSearchFileMap="/Volumes/HIKVISION/Works/Tvis/AVS/GD32F103C8T6/App/SEGGER_THUMB_Startup.s
F:/Works/Tvis/AVS/GD32F103C8T6/App/SEGGER_THUMB_Startup.s
CMSIS_5/CMSIS/Core/Include/cmsis_gcc.h
/Volumes/HIKVISION/Works/Tvis/AVS/GD32F103C8T6/App/User/Peripheral/AK517/ak517.h
CMSIS_5/CMSIS/Core/Include/core_cm3.h
/Volumes/HIKVISION/Works/Tvis/AVS/GD32F103C8T6/App/User/Peripheral/AK517/ak517.c
User/Peripheral/M62429/m62429.c

User/Peripheral/V58/v58.c
/Volumes/HIKVISION/Works/Tvis/AVS/GD32F103C8T6/App/User/Peripheral/V58/v58.c" fileDialogInitialDirectory="/Volumes/HIKVISION/Works/Tvis/AVS/GD32F103C8T6/App/User/Peripheral/V58" debugSearchPath="" autoConnectCapabilities="3711"/>
|
||||
</session>
|
||||
|
|
Loading…
Reference in New Issue
Block a user