You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/migration_guides/2.x_to_3.0.rst
+41-29
Original file line number
Diff line number
Diff line change
@@ -5,62 +5,74 @@ Migration from 2.x to 3.0
5
5
Introduction
6
6
------------
7
7
8
-
This is a guide to highlight **breaking changes** in the API and to help the migration of projects from versions 2.X (based on ESP-IDF 4.4) to version 3.0 (based on ESP-IDF 5.1) of the Arduino ESP32 core.
8
+
This is a guide to highlight **breaking changes** in the API and build system to help the migration of projects from versions 2.X (based on ESP-IDF 4.4) to version 3.0 (based on ESP-IDF 5.1) of the Arduino ESP32 core.
9
9
10
10
All the examples on the version 3.0.0 were updated to be compatible to the new API. The old examples from the versions below 3.0.0 will be not compatible with the version 3.0.0 or newer releases.
11
11
12
12
For more information about all changes and new features, check project `RELEASE NOTES <https://github.com/espressif/arduino-esp32/releases>`_.
13
13
14
+
Build System
15
+
------------
16
+
17
+
Extra Flags
18
+
***********
19
+
20
+
* If your project uses extra flags in the compilation process, it will now overwrite `some required default flags <https://github.com/espressif/arduino-esp32/blob/e5330d1797accfc8334e645372595d1bfda07ba2/platform.txt#L66-L67>`_.
21
+
To ensure your project compiles correctly, make sure to have the ``-MMD -c`` flags in your C and C++ extra flags.
22
+
23
+
APIs
24
+
----
25
+
14
26
ADC
15
-
---
27
+
***
16
28
17
29
Removed APIs
18
-
************
30
+
^^^^^^^^^^^^
19
31
20
32
* ``analogSetClockDiv``
21
33
* ``adcAttachPin``
22
34
* ``analogSetVRefPin``
23
35
24
36
BLE
25
-
---
37
+
***
26
38
27
39
Changes in APIs
28
-
***************
40
+
^^^^^^^^^^^^^^^
29
41
30
42
* Changed APIs return and parameter type from ``std::string`` to Arduino style ``String``.
31
43
* Changed UUID data type from ``uint16_t`` to ``BLEUUID`` class.
32
44
* ``BLEScan::start`` and ``BLEScan::getResults`` methods return type changed from ``BLEScanResults`` to ``BLEScanResults*``.
33
45
34
46
Hall Sensor
35
-
-----------
47
+
***********
36
48
37
49
Hall sensor is no longer supported.
38
50
39
51
Removed APIs
40
-
************
52
+
^^^^^^^^^^^^
41
53
42
54
* ``hallRead``
43
55
44
56
I2S
45
-
---
57
+
***
46
58
47
59
The I2S driver has been completely redesigned and refactored to use the new ESP-IDF driver.
48
60
For more information about the new API, check :doc:`/api/i2s`.
49
61
50
62
LEDC
51
-
----
63
+
****
52
64
53
65
The LEDC API has been changed in order to support the Peripheral Manager and make it easier to use, as LEDC channels are now automatically assigned to pins.
54
66
For more information about the new API, check :doc:`/api/ledc`.
55
67
56
68
Removed APIs
57
-
************
69
+
^^^^^^^^^^^^
58
70
59
71
* ``ledcSetup``
60
72
* ``ledcAttachPin``
61
73
62
74
New APIs
63
-
********
75
+
^^^^^^^^
64
76
65
77
* ``ledcAttach`` used to set up the LEDC pin (merged ``ledcSetup`` and ``ledcAttachPin`` functions).
66
78
* ``ledcOutputInvert`` used to attach the interrupt to a timer using arguments.
@@ -69,18 +81,18 @@ New APIs
69
81
* ``ledcFadeWithInterruptArg`` used to set up and start a fade on a given LEDC pin with an interrupt using arguments.
70
82
71
83
Changes in APIs
72
-
***************
84
+
^^^^^^^^^^^^^^^
73
85
74
86
* ``ledcDetachPin`` renamed to ``ledcDetach``.
75
87
* In all functions, input parameter ``channel`` has been changed to ``pin``.
76
88
77
89
RMT
78
-
---
90
+
***
79
91
80
92
For more information about the new API, check :doc:`/api/rmt`.
81
93
82
94
Removed APIs
83
-
************
95
+
^^^^^^^^^^^^
84
96
85
97
* ``_rmtDumpStatus``
86
98
* ``rmtSetTick``
@@ -90,7 +102,7 @@ Removed APIs
90
102
* ``rmtReadData``
91
103
92
104
New APIs
93
-
********
105
+
^^^^^^^^
94
106
95
107
* ``rmtSetEOT``
96
108
* ``rmtWriteAsync``
@@ -99,7 +111,7 @@ New APIs
99
111
100
112
101
113
Changes in APIs
102
-
***************
114
+
^^^^^^^^^^^^^^^
103
115
104
116
* In all functions, input parameter ``rmt_obj_t* rmt`` has been changed to ``int pin``.
105
117
* ``rmtInit`` return parameter changed to bool.
@@ -114,37 +126,37 @@ Changes in APIs
114
126
* ``rmtSetCarrier`` input parameters ``uint32_t low, uint32_t high`` have been changed to ``uint32_t frequency_Hz, float duty_percent``.
115
127
116
128
SigmaDelta
117
-
----------
129
+
**********
118
130
119
131
SigmaDelta has been refactored to use the new ESP-IDF driver.
120
132
For more information about the new API, check :doc:`/api/sigmadelta`.
121
133
122
134
Removed APIs
123
-
************
135
+
^^^^^^^^^^^^
124
136
125
137
* ``sigmaDeltaSetup``
126
138
* ``sigmaDeltaRead``
127
139
128
140
New APIs
129
-
********
141
+
^^^^^^^^
130
142
131
143
* ``sigmaDeltaAttach`` used to set up the SigmaDelta pin (channel is acquired automatically).
132
144
* ``timerGetFrequency`` used to get the actual frequency of the timer.
133
145
* ``timerAttachInterruptArg`` used to attach the interrupt to a timer using arguments.
134
146
135
147
Changes in APIs
136
-
***************
148
+
^^^^^^^^^^^^^^^
137
149
138
150
* ``sigmaDeltaDetachPin`` renamed to ``sigmaDeltaDetach``.
139
151
* ``sigmaDeltaWrite`` input parameter ``channel`` has been changed to ``pin``.
140
152
141
153
Timer
142
-
-----
154
+
*****
143
155
144
156
Timer has been refactored to use the new ESP-IDF driver and its API got simplified. For more information about the new API check :doc:`/api/timer`.
145
157
146
158
Removed APIs
147
-
************
159
+
^^^^^^^^^^^^
148
160
149
161
* ``timerGetConfig``
150
162
* ``timerSetConfig``
@@ -164,30 +176,30 @@ Removed APIs
164
176
* ``timerAttachInterruptFlag``
165
177
166
178
New APIs
167
-
********
179
+
^^^^^^^^
168
180
169
181
* ``timerAlarm`` used to set up Alarm for the timer and enable it automatically (merged ``timerAlarmWrite`` and ``timerAlarmEnable`` functions).
170
182
* ``timerGetFrequency`` used to get the actual frequency of the timer.
171
183
* ``timerAttachInterruptArg`` used to attach the interrupt to a timer using arguments.
172
184
173
185
Changes in APIs
174
-
***************
186
+
^^^^^^^^^^^^^^^
175
187
176
188
* ``timerBegin`` has now only 1 parameter (frequency). There is an automatic calculation of the divider using different clock sources
177
189
to achieve the selected frequency.
178
190
* ``timerAttachInterrupt`` has now only 2 parameters. The ``edge`` parameter has been removed.
179
191
180
192
UART (HardwareSerial)
181
-
---------------------
193
+
*********************
182
194
183
195
Changes in APIs
184
-
***************
196
+
^^^^^^^^^^^^^^^
185
197
186
198
* ``setHwFlowCtrlMode`` input parameter ``uint8_t mode`` has been changed to ``SerialHwFlowCtrl mode``.
187
199
* ``setMode`` input parameter ``uint8_t mode`` has been changed to ``SerialMode mode``.
188
200
189
201
Functional changes
190
-
******************
202
+
^^^^^^^^^^^^^^^^^^
191
203
192
204
* Default pins for some SoCs have been changed to avoid conflicts with other peripherals:
193
205
* ESP32's UART1 RX and TX pins are now GPIO26 and GPIO27, respectively;
@@ -203,10 +215,10 @@ Functional changes
203
215
* If the application only uses RX or TX, ``begin(baud, -1, tx)`` or ``begin(baud, rx)`` will change only the assigned pin and keep the other unchanged.
204
216
205
217
WiFi
206
-
----
218
+
****
207
219
208
220
Functional changes
209
-
******************
221
+
^^^^^^^^^^^^^^^^^^
210
222
211
223
* In Arduino (and other frameworks) the method named ``flush()`` is intended to send out the transmit buffer content. ``WiFiClient`` and ``WiFiUDP`` method ``flush()`` won't clear the receive buffer anymore. A new method called ``clear()`` is now used for that. Currently ``flush()`` does nothing in ``WiFiClient``, ``WiFiClientSecure`` and ``WiFiUDP``.
212
224
* ``WiFiServer`` has functions ``accept()`` and ``available()`` with the same functionality. In Arduino, ``available()`` should work differently so it is now deprecated.
0 commit comments