Skip to content

Commit de71b93

Browse files
xiarihfKwang-Hui
authored andcommitted
Add emw3080 light & swtich example Readme documents
(cherry-picked from commit 17684e0) Signed-off-by: qiang3.zhang <28670379+xiarihf@users.noreply.github.com>
1 parent be52592 commit de71b93

File tree

4 files changed

+97
-0
lines changed

4 files changed

+97
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SmartThings SDK for Direct Connected Devices for C - Light Example
2+
3+
## Introduction
4+
5+
SmartThings direct-connected device is Wi-Fi enabled device that uses the SmartThings cloud as its primary cloud infrastructure. And this device will use the MQTT protocol for communication.
6+
7+
## Getting started
8+
9+
For information on detailed workflow, please refer to the [Getting Started](../../../doc/getting_started.md)
10+
11+
## Components and Capabilities
12+
13+
SmartThings Device is defined using components and capabilities. Capabilities define the features of the device, and capabilities are grouped into components.
14+
Components and Capabilities are contained in device profile. You can create a device profile in Developer Workspace and associate it with an integration.
15+
16+
This example assumes the following components and capabilities are used:
17+
18+
'main' component
19+
- 'healthCheck' capability
20+
- 'switch' capability
21+
- 'switchLevel' capability
22+
- 'colorTemperature' capability
23+
- 'activityLightingMode' capability
24+
25+
'monitor' component
26+
- 'dustSensor' capability
27+
28+
('healthCheck' capability is automatically added by Developer Workspace. It doesn't need handler at device side)
29+
30+
## SmartThings SDK for Direct Connected Devices - Config
31+
If you want to use specific SmartThings Device SDK build options, you can directly modify the build configuration file. For this example, SmartThings Device SDK config is saved in 'sdkconfig.h' file. If you want to change this, please execute the following :
32+
```sh
33+
$ cd ~/st-device-sdk-c-ref
34+
$ vim apps/emw3080/light_example/sdkconfig.h
35+
```
36+
37+
## Test device schematics
38+
This example uses EMW3080 GPIO like below.
39+
Please refer below picture for __MXChip EMW3080__.
40+
> Note: If your device's schematics doesn't match with belows.
41+
> Please modify GPIO defines for your device at [device_control.h](main/device_control.h)
42+
> ```c
43+
> #define GPIO_INPUT_BUTTON MICO_GPIO_1 //SWD CLK
44+
> #define GPIO_OUTPUT_COLORLED_R MICO_GPIO_2 //SWD IO
45+
> #define GPIO_OUTPUT_COLORLED_G MICO_GPIO_7 //RTS
46+
> #define GPIO_OUTPUT_COLORLED_B MICO_GPIO_8 //CTS
47+
> ```
48+
49+
### MXChip EMW3080
50+
| MXChip EMW3080 |
51+
|-----------------------------------------------------------------------|
52+
|![MXChip EMW3080](../../../doc/res/Light_Example_MXChip_EMW3080.png) |
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# SmartThings SDK for Direct Connected Devices for C - Switch Example
2+
3+
## Introduction
4+
5+
SmartThings direct-connected device is Wi-Fi enabled device that uses the SmartThings cloud as its primary cloud infrastructure. And this device will use the MQTT protocol for communication.
6+
7+
## Getting started
8+
9+
For information on detailed workflow, please refer to the [Getting Started](../../../doc/getting_started.md)
10+
11+
## Components and Capabilities
12+
13+
SmartThings Device is defined using components and capabilities. Capabilities define the features of the device, and capabilities are grouped into components.
14+
Components and Capabilities are contained in device profile. You can create a device profile in Developer Workspace and associate it with an integration.
15+
16+
This example assumes the following components and capabilities are used:
17+
18+
'main' component
19+
- 'healthCheck' capability
20+
- 'switch' capability
21+
22+
('healthCheck' capability is automatically added by Developer Workspace. It doesn't need handler at device side)
23+
24+
## SmartThings SDK for Direct Connected Devices - Config
25+
If you want to use specific SmartThings Device SDK build options, you can directly modify the build configuration file. For this example, SmartThings Device SDK config is saved in 'sdkconfig.h' file. If you want to change this, please execute the following :
26+
```sh
27+
$ cd ~/st-device-sdk-c-ref
28+
$ vim apps/emw3080/switch_example/sdkconfig.h
29+
```
30+
31+
## Test device schematics
32+
This example uses EMW3080 GPIO like below.
33+
Please refer below picture for __MXChip EMW3080__.
34+
> Note: If your device's schematics doesn't match with belows.
35+
> Please modify GPIO defines for your device at [device_control.h](main/device_control.h)
36+
> ```c
37+
> #define GPIO_OUTPUT_NOTIFICATION_LED MICO_GPIO_7 //RTS
38+
> #define GPIO_INPUT_BUTTON MICO_GPIO_1 //SWD CLK
39+
> #define GPIO_OUTPUT_MAINLED MICO_GPIO_2 //SWD IO
40+
> ```
41+
42+
### MXChip EMW3080
43+
| MXChip EMW3080 |
44+
|-----------------------------------------------------------------------|
45+
|![MXChip EMW3080](../../../doc/res/Switch_Example_MXChip_EMW3080.png) |
228 KB
Loading
264 KB
Loading

0 commit comments

Comments
 (0)