This commit is contained in:
houpengfei 2021-09-26 08:49:57 +08:00
parent a16d5b21f0
commit 335e8a6ea2
34 changed files with 256 additions and 48 deletions

5
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"files.associations": {
"oled_demo.h": "c"
}
}

View File

@ -103,13 +103,13 @@
* 预售微店(微信扫码)
![](./figures/Niobe/预售链接.png)
![](./applications/figures/预售链接.png)
* Niobe开发板全貌图
![](./figures/Niobe/全貌图.jpg)
![](./applications/figures/全貌图.jpg)
![](./figures/Niobe/341d541732a8bb7b49afe4859720702.jpg)
![](./applications/figures/341d541732a8bb7b49afe4859720702.jpg)
![](./figures/Niobe/6924eeb198d01b9918c2f6b7187898e.jpg)
![](./applications/figures/6924eeb198d01b9918c2f6b7187898e.jpg)

View File

@ -25,7 +25,7 @@ lite_component("app") {
# "TW101_GPIO_led:gpio_led_example",
# "TW102_EXTI_key:exti_key_example",
# "TW103_PWM_led:pwm_led_example",
"TW104_ADC_voltage:adc_voltage",
# "TW104_ADC_voltage:adc_voltage",
# "TW105_I2C_sht30:i2c_sht30",
# "TW106_UART:uart_test",
# "TW301_APP_oled:oled_demo",

View File

@ -1,3 +1,16 @@
# Copyright (c) 2021 Talkweb 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("helloworld"){
sources =[
"hello_world.c"

View File

@ -2,12 +2,12 @@
## Hello World
沿袭程序界的传统第一个程序都是Hello World。在Sandwich WiFi IoT开发板中指的是通过开发板串口在串口日志中输出Hello World字符串。
沿袭程序界的传统第一个程序都是Hello World。在Niobe WiFi IoT开发板中指的是通过开发板串口在串口日志中输出Hello World字符串。
Sandwich WiFi IoT开发板系统代码中Hello World程序位于applications目录下面具体路径如下
Niobe WiFi IoT开发板系统代码中Hello World程序位于applications目录下面具体路径如下
```tex
applications/sandwich/TW001_OS_helloworld/hello_world.c
applications/app/TW001_OS_helloworld/hello_world.c
```
## 编译调试

View File

@ -1,3 +1,16 @@
# Copyright (c) 2021 Talkweb 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("os_thread_example"){
sources =[
"os_thread_example.c"

View File

@ -1,7 +1,7 @@
# Niobe WiFi IoT开发板OpenHarmony内核编程开发——Thread多线程
本示例将演示如何在Niobe WiFi IoT开发板上使用cmsis 2.0 接口进行多线程开发
![Niobe](../../../figures/Niobe/niobe.png)
![Niobe](../../figures/niobe.png)
## Thread API分析
## osThreadNew()
@ -81,7 +81,7 @@ static void OS_Thread_example(void)
### 修改 BUILD.gn 文件
修改 `applications`路径下 BUILD.gn 文件,指定 `os_thread_example` 参与编译。
修改 `applications\app`路径下 BUILD.gn 文件,指定 `os_thread_example` 参与编译。
```r
#"TW001_OS_helloworld:helloworld_example",

View File

@ -1,3 +1,16 @@
# Copyright (c) 2021 Talkweb 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("os_timer_example"){
sources =[
"os_timer_example.c"

View File

@ -1,7 +1,7 @@
# Niobe开发板OpenHarmony内核编程开发——定时器
本示例将演示如何在Niobe开发板上使用cmsis 2.0 接口进行定时器开发
本示例将演示如何在Niobe Wifi IoT开发板上使用cmsis 2.0 接口进行定时器开发
![Niobe](../../../figures/Niobe/niobe.png)
![Niobe](../../figures/niobe.png)
## Timer API分析

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Talkweb Co., Ltd.
* Copyright (c) 2021 Talkweb 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

View File

@ -1,3 +1,16 @@
# Copyright (c) 2021 Talkweb 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("os_event_example"){
sources =[
"os_event_example.c"

View File

@ -1,7 +1,7 @@
# Niobe开发板OpenHarmony内核编程开发——事件标志
本示例将演示如何在Niobe开发板上使用cmsis 2.0 接口使用事件标志同步线程
本示例将演示如何在Niobe Wifi IoT开发板上使用cmsis 2.0 接口使用事件标志同步线程
![Niobe](../../../figures/Niobe/niobe.png)
![Niobe](../../figures/niobe.png)
## EventFlags API分析

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Talkweb Co., Ltd.
* Copyright (c) 2021 Talkweb 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

View File

@ -1,3 +1,16 @@
# Copyright (c) 2021 Talkweb 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("mutex_example"){
sources =[
"os_mutex_example.c"

View File

@ -1,7 +1,7 @@
# Niobe WiFi IoT开发板OpenHarmony内核编程开发——mutex
本示例将演示如何在Niobe WiFi IoT开发板上使用cmsis 2.0 接口进行互斥锁开发
![Niobe](../../../figures/Niobe/niobe.png)
![Niobe](../../figures/niobe.png)
## mutex API分析
## osThreadNew()
@ -156,7 +156,7 @@ void os_mutex_example(void)
### 修改 BUILD.gn 文件
修改 `applications/app/`路径下 BUILD.gn 文件,指定 `mutex_example` 参与编译。
修改 `applications/app`路径下 BUILD.gn 文件,指定 `mutex_example` 参与编译。
```r
#"TW001_OS_helloworld:helloworld_example",

View File

@ -1,3 +1,18 @@
/*
* Copyright (c) 2021 Talkweb 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 <string.h>
#include <unistd.h>

View File

@ -1,3 +1,18 @@
/*
* Copyright (c) 2021 Talkweb 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 <string.h>
#include <unistd.h>

View File

@ -1,7 +1,7 @@
# Niobe WiFi IoT开发板OpenHarmony内核编程开发——message
本示例将演示如何在Niobe WiFi IoT开发板上使用cmsis 2.0 接口进行消息队列开发
![Niobe](../../../figures/Niobe/niobe.png)
![Niobe](../../figures/niobe.png)
## message API分析
## osThreadNew()
@ -92,7 +92,7 @@ osStatus_t osMessageQueueGet (osMessageQueueId_t mq_id,void *msg_ptr,uint8_t *ms
在Msg_example函数中通过osThreadNew()函数创建了Thread_MsgQ1、Thread_MsgQ2两个线程Thread_MsgQ1、Thread_MsgQ2两个线程启动后会输出打印日志。
```c
void Thread_MsgQ1(void *arg)
void Thread_MsgQueue1(void *arg)
{
while (1)
{
@ -136,15 +136,15 @@ static void Msg_example(void)
attr.stack_size = 1024 * 10;
attr.priority = 10;
attr.name = "Thread_MsgQ1";
if (osThreadNew(Thread_MsgQ1, NULL, &attr) == NULL)
attr.name = "Thread_MsgQueue1";
if (osThreadNew(Thread_MsgQueue1, NULL, &attr) == NULL)
{
printf("create Thread_MsgQ1 failed!\n");
printf("create Thread_MsgQueue1 failed!\n");
}
attr.name = "Thread_MsgQ2";
if (osThreadNew(Thread_MsgQ2, NULL, &attr) == NULL)
attr.name = "Thread_MsgQueue2";
if (osThreadNew(Thread_MsgQueue2, NULL, &attr) == NULL)
{
printf("create Thread_MsgQ2 failed!\n");
printf("create Thread_MsgQueue2 failed!\n");
}
}

View File

@ -1,3 +1,17 @@
/*
* Copyright (c) 2021 Talkweb 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 <string.h>
#include <unistd.h>
@ -13,7 +27,7 @@ static char *g_cmsisMessageInfo[] = {"msg1", "msg2", "msg3", "msg4", "msg5", "ms
//message queue id
osMessageQueueId_t MsgQueue;
void Thread_MsgQ1(void *arg)
void Thread_MsgQueue1(void *arg)
{
while (1)
{
@ -57,15 +71,15 @@ static void Msg_example(void)
attr.stack_size = 1024 * 10;
attr.priority = 10;
attr.name = "Thread_MsgQ1";
if (osThreadNew(Thread_MsgQ1, NULL, &attr) == NULL)
attr.name = "Thread_MsgQueue1";
if (osThreadNew(Thread_MsgQueue1, NULL, &attr) == NULL)
{
printf("create Thread_MsgQ1 failed!\n");
printf("create Thread_MsgQueue1 failed!\n");
}
attr.name = "Thread_MsgQ2";
if (osThreadNew(Thread_MsgQ2, NULL, &attr) == NULL)
attr.name = "Thread_MsgQueue2";
if (osThreadNew(Thread_MsgQueue2, NULL, &attr) == NULL)
{
printf("create Thread_MsgQ2 failed!\n");
printf("create Thread_MsgQueue2 failed!\n");
}
}

View File

@ -1,3 +1,16 @@
# Copyright (c) 2021 Talkweb 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("exti_key_example"){
sources =[
"exti_example.c"

View File

@ -1,3 +1,16 @@
# Copyright (c) 2021 Talkweb 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("pwm_led_example"){
sources =[
"pwm_led_example.c"

View File

@ -1,3 +1,16 @@
# Copyright (c) 2021 Talkweb 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("adc_voltage"){
sources =[
"adc_voltage.c"

View File

@ -1,3 +1,16 @@
# Copyright (c) 2021 Talkweb 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("i2c_sht30"){
sources =[
"i2c_sht30.c"

View File

@ -1,3 +1,16 @@
# Copyright (c) 2021 Talkweb 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("uart_test"){
sources =[
"uart_test.c"

View File

@ -1,3 +1,16 @@
# Copyright (c) 2021 Talkweb 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("oled_demo"){
sources =[
"oled_demo.c"

View File

@ -1,3 +1,17 @@
/*
* Copyright (c) 2021 Talkweb 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 <unistd.h>
#include "stdio.h"
#include "ohos_init.h"
@ -9,7 +23,6 @@
#include <hi_stdlib.h>
#include "oled_demo.h"
#include "oledfont.h"
#include "led3_demo.h"
#include <hi_adc.h>
u8 OLED_GRAM[144][8];

View File

@ -1,3 +1,17 @@
/*
* Copyright (c) 2021 Talkweb 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.
*/
#ifndef __OLED_H
#define __OLED_H

View File

@ -28,15 +28,15 @@
https://gitee.com/mirrors/pyenv
```
### 下载代码
### 下载代码(二选一)
#### 使用git的下载方式
#### 方式一: 使用git的下载方式
```
git clone https://gitee.com/talkweb_oh/niobe.git
```
#### 使用repo的下载方式
#### 方式二: 使用repo的下载方式
```
# 初始化

View File

@ -98,15 +98,4 @@ docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-dock
```
docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.5
```
* 通过如下命令启动不同平台的编译
```
hb set #设置工作目录
. #输入源码所在目录,点(.)表示当前目录。
#在显示的页面中通过键盘上下键选择需要编译的平台,通过回车确定选择。
#选择talkweb niobe开发板
#编译release 版本
hb build -b release -f #执行编译
```

View File

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

View File

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

View File

Before

Width:  |  Height:  |  Size: 992 KiB

After

Width:  |  Height:  |  Size: 992 KiB

View File

Before

Width:  |  Height:  |  Size: 895 KiB

After

Width:  |  Height:  |  Size: 895 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB