Skip to content

Commit 6b22f0e

Browse files
committed
feat(docs): Add Zigbee library documentation
1 parent f788911 commit 6b22f0e

32 files changed

+4294
-0
lines changed

docs/en/libraries.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,15 @@ The Arduino ESP32 offers some unique APIs, described in this section:
9191
:glob:
9292

9393
api/*
94+
95+
Zigbee APIs
96+
-----------
97+
98+
.. toctree::
99+
:maxdepth: 1
100+
:glob:
101+
102+
zigbee/zigbee
103+
zigbee/zigbee_core
104+
zigbee/zigbee_ep
105+
zigbee/ep_*

docs/en/zigbee/ep_analog.rst

Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
1+
############
2+
ZigbeeAnalog
3+
############
4+
5+
About
6+
-----
7+
8+
The ``ZigbeeAnalog`` class provides analog input and output endpoints for Zigbee networks. This endpoint implements the Zigbee Home Automation (HA) standard for analog signal processing and control.
9+
Analog Input (AI) is meant to be used for sensors that provide an analog signal, such as temperature, humidity, pressure to be sent to the coordinator.
10+
Analog Output (AO) is meant to be used for actuators that require an analog signal, such as dimmers, valves, etc. to be controlled by the coordinator.
11+
12+
13+
Common API
14+
----------
15+
16+
Constructor
17+
***********
18+
19+
ZigbeeAnalog
20+
^^^^^^^^^^^^
21+
22+
Creates a new Zigbee analog endpoint.
23+
24+
.. code-block:: arduino
25+
26+
ZigbeeAnalog(uint8_t endpoint);
27+
28+
* ``endpoint`` - Endpoint number (1-254)
29+
30+
Cluster Management
31+
******************
32+
33+
addAnalogInput
34+
^^^^^^^^^^^^^^
35+
36+
Adds analog input cluster to the endpoint.
37+
38+
.. code-block:: arduino
39+
40+
bool addAnalogInput();
41+
42+
This function will return ``true`` if successful, ``false`` otherwise.
43+
44+
addAnalogOutput
45+
^^^^^^^^^^^^^^^
46+
47+
Adds analog output cluster to the endpoint.
48+
49+
.. code-block:: arduino
50+
51+
bool addAnalogOutput();
52+
53+
This function will return ``true`` if successful, ``false`` otherwise.
54+
55+
Analog Input API
56+
----------------
57+
58+
Configuration Methods
59+
*********************
60+
61+
setAnalogInputApplication
62+
^^^^^^^^^^^^^^^^^^^^^^^^^
63+
64+
Sets the application type for the analog input.
65+
66+
.. code-block:: arduino
67+
68+
bool setAnalogInputApplication(uint32_t application_type);
69+
70+
* ``application_type`` - Application type constant (see esp_zigbee_zcl_analog_input.h for values)
71+
72+
This function will return ``true`` if successful, ``false`` otherwise.
73+
74+
setAnalogInputDescription
75+
^^^^^^^^^^^^^^^^^^^^^^^^^
76+
77+
Sets a custom description for the analog input.
78+
79+
.. code-block:: arduino
80+
81+
bool setAnalogInputDescription(const char *description);
82+
83+
* ``description`` - Description string
84+
85+
This function will return ``true`` if successful, ``false`` otherwise.
86+
87+
setAnalogInputResolution
88+
^^^^^^^^^^^^^^^^^^^^^^^^
89+
90+
Sets the resolution for the analog input.
91+
92+
.. code-block:: arduino
93+
94+
bool setAnalogInputResolution(float resolution);
95+
96+
* ``resolution`` - Resolution value
97+
98+
This function will return ``true`` if successful, ``false`` otherwise.
99+
100+
setAnalogInputMinMax
101+
^^^^^^^^^^^^^^^^^^^^
102+
103+
Sets the minimum and maximum values for the analog input.
104+
105+
.. code-block:: arduino
106+
107+
bool setAnalogInputMinMax(float min, float max);
108+
109+
* ``min`` - Minimum value
110+
* ``max`` - Maximum value
111+
112+
This function will return ``true`` if successful, ``false`` otherwise.
113+
114+
Value Control
115+
*************
116+
117+
setAnalogInput
118+
^^^^^^^^^^^^^^
119+
120+
Sets the analog input value.
121+
122+
.. code-block:: arduino
123+
124+
bool setAnalogInput(float analog);
125+
126+
* ``analog`` - Analog input value
127+
128+
This function will return ``true`` if successful, ``false`` otherwise.
129+
130+
Reporting Methods
131+
*****************
132+
133+
setAnalogInputReporting
134+
^^^^^^^^^^^^^^^^^^^^^^^
135+
136+
Sets the reporting configuration for analog input.
137+
138+
.. code-block:: arduino
139+
140+
bool setAnalogInputReporting(uint16_t min_interval, uint16_t max_interval, float delta);
141+
142+
* ``min_interval`` - Minimum reporting interval in seconds
143+
* ``max_interval`` - Maximum reporting interval in seconds
144+
* ``delta`` - Minimum change in value to trigger a report
145+
146+
This function will return ``true`` if successful, ``false`` otherwise.
147+
148+
reportAnalogInput
149+
^^^^^^^^^^^^^^^^^
150+
151+
Manually reports the current analog input value.
152+
153+
.. code-block:: arduino
154+
155+
bool reportAnalogInput();
156+
157+
This function will return ``true`` if successful, ``false`` otherwise.
158+
159+
Analog Output API
160+
-----------------
161+
162+
Configuration Methods
163+
*********************
164+
165+
setAnalogOutputApplication
166+
^^^^^^^^^^^^^^^^^^^^^^^^^^
167+
168+
Sets the application type for the analog output.
169+
170+
.. code-block:: arduino
171+
172+
bool setAnalogOutputApplication(uint32_t application_type);
173+
174+
* ``application_type`` - Application type constant (see esp_zigbee_zcl_analog_output.h for values)
175+
176+
This function will return ``true`` if successful, ``false`` otherwise.
177+
178+
setAnalogOutputDescription
179+
^^^^^^^^^^^^^^^^^^^^^^^^^^
180+
181+
Sets a custom description for the analog output.
182+
183+
.. code-block:: arduino
184+
185+
bool setAnalogOutputDescription(const char *description);
186+
187+
* ``description`` - Description string
188+
189+
This function will return ``true`` if successful, ``false`` otherwise.
190+
191+
setAnalogOutputResolution
192+
^^^^^^^^^^^^^^^^^^^^^^^^^
193+
194+
Sets the resolution for the analog output.
195+
196+
.. code-block:: arduino
197+
198+
bool setAnalogOutputResolution(float resolution);
199+
200+
* ``resolution`` - Resolution value
201+
202+
This function will return ``true`` if successful, ``false`` otherwise.
203+
204+
setAnalogOutputMinMax
205+
^^^^^^^^^^^^^^^^^^^^^
206+
207+
Sets the minimum and maximum values for the analog output.
208+
209+
.. code-block:: arduino
210+
211+
bool setAnalogOutputMinMax(float min, float max);
212+
213+
* ``min`` - Minimum value
214+
* ``max`` - Maximum value
215+
216+
This function will return ``true`` if successful, ``false`` otherwise.
217+
218+
Value Control
219+
*************
220+
221+
setAnalogOutput
222+
^^^^^^^^^^^^^^^
223+
224+
Sets the analog output value.
225+
226+
.. code-block:: arduino
227+
228+
bool setAnalogOutput(float analog);
229+
230+
* ``analog`` - Analog output value
231+
232+
This function will return ``true`` if successful, ``false`` otherwise.
233+
234+
getAnalogOutput
235+
^^^^^^^^^^^^^^^
236+
237+
Gets the current analog output value.
238+
239+
.. code-block:: arduino
240+
241+
float getAnalogOutput();
242+
243+
This function will return current analog output value.
244+
245+
Reporting Methods
246+
*****************
247+
248+
reportAnalogOutput
249+
^^^^^^^^^^^^^^^^^^
250+
251+
Manually reports the current analog output value.
252+
253+
.. code-block:: arduino
254+
255+
bool reportAnalogOutput();
256+
257+
This function will return ``true`` if successful, ``false`` otherwise.
258+
259+
Event Handling
260+
**************
261+
262+
onAnalogOutputChange
263+
^^^^^^^^^^^^^^^^^^^^
264+
265+
Sets a callback function to be called when the analog output value changes.
266+
267+
.. code-block:: arduino
268+
269+
void onAnalogOutputChange(void (*callback)(float analog));
270+
271+
* ``callback`` - Function to call when analog output changes
272+
273+
Example
274+
-------
275+
276+
Analog Input/Output
277+
*******************
278+
279+
.. literalinclude:: ../../../libraries/Zigbee/examples/Zigbee_Analog_Input_Output/Zigbee_Analog_Input_Output.ino
280+
:language: arduino

0 commit comments

Comments
 (0)