2 Star 0 Fork 0

liangkz/OpenBrotherPzCar

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
pzcar_wheel_ctrl.h 1.84 KB
一键复制 编辑 原始数据 按行查看 历史
/*
* Copyright (C) 2023 HiHope Open Source Organization .
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
*
* limitations under the License.
*/
#ifndef PZCAR_WHEEL_CTRL_H
#define PZCAR_WHEEL_CTRL_H
#include "ohos_init.h"
#include "cmsis_os2.h"
#include "net_config.h"
typedef enum {
eMode_Auto,
eMode_Track,
eMode_AudCmd,
eMode_NetCtrl,
eMode_Max,
} CarMode;
typedef enum {
eSt_Stop,
eSt_Forward,
eSt_TurnLeft,
eSt_TurnRight,
eSt_Backward,
eSt_BackLeft,
eSt_BackRight,
eSt_Max,
} CarState;
typedef enum {
eSp_Min = 0,
eSp_Low = 1000,
eSp_Medium = 2000,
eSp_High = 3000,
eSp_Max = 3600,
} CarSpeed;
typedef struct {
CarMode e_CM;
CarState e_ST;
NetState e_NetST;
NetCtrlMode e_NetMode;
osThreadId_t netCtrlTaskId;
osThreadId_t udpServRecvTaskId;
osThreadId_t tcpServRecvTaskId;
unsigned char apInited;
unsigned char staInited;
short d_speed_curr;
short d_speed_def;
short d_speed_min;
short d_speed_max;
short d_duration;
short d_duration_def;
} PzCarInfo;
void WheelMovementCtrl(CarState eSt, const signed short speed, const unsigned short duration);
void WheelMovementCmd(const char* cmd, const signed short speed, const unsigned short duration);
void WheelCmd(const char* cmd);
osThreadId_t WheelTaskEntry(void);
#endif // PZCAR_WHEEL_CTRL_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liangkzgitee/PzCar.git
git@gitee.com:liangkzgitee/PzCar.git
liangkzgitee
PzCar
OpenBrotherPzCar
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385