当前位置: 首页 > news >正文

聂教练做0网站专业做网站优化需要多久

聂教练做0网站,专业做网站优化需要多久,克拉玛依住房和建设局网站,江苏优质网站制作公司本篇实现对gpio的控制#xff0c;通过控制输出进行gpio的点灯操作。 硬件 我们来操作IO2#xff0c;控制绿色的灯。 软件 GPIO API API名称 说明 hi_u32 hi_gpio_deinit(hi_void); GPIO模块初始化 hi_u32 hi_io_set_pull(hi_io_name id, hi_io_pull val); 设置某个IO…本篇实现对gpio的控制通过控制输出进行gpio的点灯操作。 硬件 我们来操作IO2控制绿色的灯。 软件 GPIO API API名称 说明 hi_u32 hi_gpio_deinit(hi_void); GPIO模块初始化 hi_u32 hi_io_set_pull(hi_io_name id, hi_io_pull val); 设置某个IO上下拉功能。 hi_u32 hi_gpio_set_dir(hi_gpio_idx id, hi_gpio_dir dir); 设置GPIO引脚方向id参数用于指定引脚dir参数用于指定输入或输出 hi_u32 hi_gpio_set_ouput_val(hi_gpio_idx id, hi_gpio_value val); 设置GPIO引脚的输出状态id参数用于指定引脚val参数用于指定高电平或低电平 hi_u32 hi_io_set_func(hi_io_name id, hi_u8 val); 设置引脚功能id参数用于指定引脚val用于指定引脚功能 hi_u32 hi_gpio_deinit(hi_void); 解除GPIO模块初始化 修改D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\demo\BUILD.gn文件让工程编译led代码 # Copyright (c) 2023 Beijing HuaQing YuanJian Education Technology Co., Ltd # 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. import(//build/lite/config/component/lite_component.gni)lite_component(demo) {features [base_01_led:base_led_example,] }创建D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\demo\base_01_led文件夹 文件夹中创建D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\demo\base_01_led\base_led_example.c文件D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\demo\base_01_led\BUILD.gn文件 # Copyright (c) 2023 Beijing HuaQing YuanJian Education Technology Co., Ltd # 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. static_library(base_led_example) {sources [base_led_example.c,]include_dirs [//utils/native/lite/include,//kernel/liteos_m/kal/cmsis,//base/iot_hardware/peripheral/interfaces/kits,//vendor/hqyj/fs_hi3861/common/bsp/include] } /** Copyright (c) 2023 Beijing HuaQing YuanJian Education Technology Co., Ltd* 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.*/#include stdio.h #include unistd.h#include cmsis_os2.h #include hi_gpio.h #include hi_io.h #include ohos_init.h#define LED HI_IO_NAME_GPIO_2 // 开发板三色灯其中一个引脚osThreadId_t Task1_ID 0; // 任务1 ID hi_gpio_value val, val_last; // GPIO的状态值 #define TASK_STACK_SIZE 1024 #define TASK_DELAY_TIME (1000 * 1000)/*** description: 任务1* param {*}* return {*}*/ void Task1(void) {printf(enter Task 1.......\r\n);hi_gpio_init(); // GPIO初始化hi_io_set_pull(LED, HI_IO_PULL_DOWN); // 设置GPIO下拉保证上电时为灭灯状态hi_io_set_func(LED, HI_IO_FUNC_GPIO_2_GPIO); // 设置IO2为GPIO功能hi_gpio_set_dir(LED, HI_GPIO_DIR_OUT); // 设置GPIO为输入模式while (1) {hi_gpio_set_ouput_val(LED, HI_GPIO_VALUE0); // 设置GPIO引脚为低电平usleep(TASK_DELAY_TIME); // 1s sleephi_gpio_set_ouput_val(LED, HI_GPIO_VALUE1); // 设置GPIO引脚为高电平usleep(TASK_DELAY_TIME); // 1s sleep} }/*** description: 初始化并创建任务* param {*}* return {*}*/ static void base_led_demo(void) {printf([demo] Enter base_led_demo()!\r\n);osThreadAttr_t taskOptions;taskOptions.name Task1; // 任务的名字taskOptions.attr_bits 0; // 属性位taskOptions.cb_mem NULL; // 堆空间地址taskOptions.cb_size 0; // 堆空间大小taskOptions.stack_mem NULL; // 栈空间地址taskOptions.stack_size TASK_STACK_SIZE; // 栈空间大小 单位:字节taskOptions.priority osPriorityNormal; // 任务的优先级:wqTask1_ID osThreadNew((osThreadFunc_t)Task1, NULL, taskOptions); // 创建任务1if (Task1_ID ! NULL) {printf(ID %d, Create Task1_ID is OK!\r\n, Task1_ID);} } SYS_RUN(base_led_demo);目录结构 │ config.json │ ├─common │ └─bsp │ ├─include │ └─src ├─demo │ │ BUILD.gn │ │ │ ├─base_00_helloworld │ │ base_helloworld_example.c │ │ BUILD.gn │ │ │ └─base_01_led │ base_led_example.c │ BUILD.gn │ └─doc│ HarmonyOS开发板实验指导书 v2.1.pdf│ 华清远见 FS_Hi3861开发指导.md│ 华清远见 FS_Hi3861新手入门手册.md│├─board│ FS-Hi3861-V4.2.pdf│ FS-Hi3861QDB-V3.2.pdf│ hi-12f_kit_v1.1.0A7E6BCB9%A6-20211025.pdf│ hi-12f_v1.1.2-A7E6BCB9%A6-20211202.pdf│ nodemcu-hi-07s_12f-kit_v1.1-20210913.pdf│ RTplay2.01_2024-06-14.pdf│└─figures 使用build 效果就是LED间隔1秒闪烁。
http://www.hkea.cn/news/14259056/

相关文章:

  • 做网站5年工资多少制作书签的作文
  • 做seo 教你如何选择网站关键词多用户软件商城
  • 胶州专业网站建设公司创建公司网站需要准备哪些素材
  • 上海外贸建站商城wordpress default
  • 域名是否就是网站如何制作一个软件
  • 办公网站建设方案diy定制网站
  • 淮南商城网站建设地址wordpress文件执行顺序
  • asp网站开发软件建设银行网站的目的是什么意思
  • 什么样的网站可以做站内站集团管理软件
  • 便宜做网站8818找马云做网站
  • 有专业做网站的吗gre考专教做蛋糕的网站
  • 泰安网站建设制作电话号码做一个中英文网站的价格
  • 深圳网站建设托管哪个公司的网络最好用
  • 自己建网站免费阿里云域名注册证书
  • 个人电子商务网站 制作合肥房产网官网首页
  • 房屋中介网站模板彩票网站是怎么做的
  • 河南整站百度快照优化做内网网站
  • 山东站群网站建设成都住房和城乡建设局 网站
  • 网站添加关键词如何自己做淘宝客推广网站
  • 杭州网站建设公司电话开发公司个人工作总结
  • 济南网站运营公司教育网站怎么做引导栏的
  • 网站收录上万没有流量中小学网站建设有什么好处
  • 网站icp备案证明文件idea做网站登录
  • 国家工业和信息化部网站备案系统网站违规关键词
  • 厦门市建设局网站住房保障大数据营销的特点
  • 建设工程考试官方网站莱芜信息港金点子招聘
  • ps做网站 大小甘肃省建设厅招标办网站
  • fireworks8做网站wordpress主题 淘宝客
  • 科技广告公司网站模板建设门户网站 业务模板
  • 哪个公司建设网站怎样建设凡科网站