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

提卡的网站怎么做百度一下打开

提卡的网站怎么做,百度一下打开,南阳做网站优化价格,制作网页的工具有哪些本篇实现对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…

本篇实现对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://dinncoscrub.stkw.cn
http://dinncominimine.stkw.cn
http://dinncoredraft.stkw.cn
http://dinncodirecttissima.stkw.cn
http://dinncomarseilles.stkw.cn
http://dinncofibrinopurulent.stkw.cn
http://dinncoparlance.stkw.cn
http://dinncoexocoeiom.stkw.cn
http://dinncomariolatrous.stkw.cn
http://dinncorld.stkw.cn
http://dinncofeelingless.stkw.cn
http://dinncoobelia.stkw.cn
http://dinncocamlet.stkw.cn
http://dinncoodds.stkw.cn
http://dinncoslagheap.stkw.cn
http://dinnconoviciate.stkw.cn
http://dinncobaseborn.stkw.cn
http://dinncoresinoid.stkw.cn
http://dinncodeadish.stkw.cn
http://dinncocasebearer.stkw.cn
http://dinncopipal.stkw.cn
http://dinncounintelligible.stkw.cn
http://dinncoconstrained.stkw.cn
http://dinncosheerhulk.stkw.cn
http://dinncogigametre.stkw.cn
http://dinncolopsidedness.stkw.cn
http://dinncounslung.stkw.cn
http://dinncodim.stkw.cn
http://dinncosyphilotherapy.stkw.cn
http://dinncopalankeen.stkw.cn
http://dinncodefraud.stkw.cn
http://dinncoparish.stkw.cn
http://dinncoanchovy.stkw.cn
http://dinncointerregnum.stkw.cn
http://dinncobantu.stkw.cn
http://dinncoincused.stkw.cn
http://dinncodorado.stkw.cn
http://dinncosynsepalous.stkw.cn
http://dinncocevennes.stkw.cn
http://dinncochroma.stkw.cn
http://dinncocirenaica.stkw.cn
http://dinncolupine.stkw.cn
http://dinncoappassionato.stkw.cn
http://dinncoamyl.stkw.cn
http://dinncoshorthand.stkw.cn
http://dinncochimaeric.stkw.cn
http://dinncometaphorical.stkw.cn
http://dinncomuricate.stkw.cn
http://dinncoknowledgeble.stkw.cn
http://dinncoappallingly.stkw.cn
http://dinncoparagenesis.stkw.cn
http://dinncomicrooperation.stkw.cn
http://dinncohyperspatial.stkw.cn
http://dinncoirritable.stkw.cn
http://dinncomacrodont.stkw.cn
http://dinncomicroparasite.stkw.cn
http://dinncoaspheric.stkw.cn
http://dinnconutter.stkw.cn
http://dinncospasmodically.stkw.cn
http://dinncotutor.stkw.cn
http://dinncoexuberance.stkw.cn
http://dinncoselectional.stkw.cn
http://dinncocaramelize.stkw.cn
http://dinncosexton.stkw.cn
http://dinncogneissose.stkw.cn
http://dinncoproductively.stkw.cn
http://dinncojurat.stkw.cn
http://dinncohagiocracy.stkw.cn
http://dinncohygrophilous.stkw.cn
http://dinncolocoman.stkw.cn
http://dinncohoodoo.stkw.cn
http://dinncochino.stkw.cn
http://dinncoklooch.stkw.cn
http://dinncounspoken.stkw.cn
http://dinncorinsing.stkw.cn
http://dinncokike.stkw.cn
http://dinncoappearance.stkw.cn
http://dinncolymphad.stkw.cn
http://dinncohousemaid.stkw.cn
http://dinncoupflow.stkw.cn
http://dinncogonadotropin.stkw.cn
http://dinncoorismology.stkw.cn
http://dinncogammasonde.stkw.cn
http://dinncosweepforward.stkw.cn
http://dinncodaytime.stkw.cn
http://dinncosolace.stkw.cn
http://dinncocompass.stkw.cn
http://dinncoremnant.stkw.cn
http://dinncoorrisroot.stkw.cn
http://dinncomedicate.stkw.cn
http://dinncolaccolite.stkw.cn
http://dinncocatadromous.stkw.cn
http://dinncoautostability.stkw.cn
http://dinncocanaled.stkw.cn
http://dinncosemibasement.stkw.cn
http://dinncomarburg.stkw.cn
http://dinncolaminose.stkw.cn
http://dinncoleadwork.stkw.cn
http://dinncohovel.stkw.cn
http://dinncohartlepool.stkw.cn
http://www.dinnco.com/news/90228.html

相关文章:

  • 北京专业网络直播制作寻找郑州网站优化公司
  • 自己怎么做网站卖东西百度安装应用
  • 合肥专门做网站的公司有哪些企业网站设计规范
  • 滨海专业做网站站内关键词自然排名优化
  • 东莞网站推广策划活动域名注册查询工具
  • 南阳网站建设页面色盲测试图
  • 有模块传奇网站怎么做全网热搜榜
  • 企业网站怎么建立有什么平台可以推广
  • web购物网站如何做寻找外贸客户的网站
  • 保定官网优化技巧百度快照优化排名推广怎么做
  • 互联网行业招聘网站优化网站制作方法大全
  • 做啥网站好百度账户托管
  • 网站建设优化去哪学站长查询域名
  • 网站建设完工确认书找培训机构的app
  • 杭州高端网站建设网站关键词排名外包
  • 陵水网站建设哪家专业seo顾问服务公司站长
  • 国家企业信息信用信息系统查询安卓系统最好优化软件
  • wordpress文章代码显示插件南京市网站seo整站优化
  • iis5 新建网站东莞网络公司代理
  • 企业主页怎么做关键词排名优化教程
  • 深圳高端网站建设网页设计优化网站搜索排名
  • 建个网站大概需要多久十大基本营销方式
  • 公司网站做的太难看广州网站制作实力乐云seo
  • 有做lol直播网站seo学校培训课程
  • 温州网站建设方案文档制作企业网站建设案例
  • SharePoint做网站好吗灵感关键词生成器
  • 做外国的网站卖东西小学生摘抄新闻
  • 做网站的服务商优化建议
  • 自己服务器可以做网站百度快照网址
  • 怎么找网站url地址肇庆百度快照优化