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
+44-29
Original file line number
Diff line number
Diff line change
@@ -5,62 +5,77 @@ 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
+
Compilation Flags
18
+
*****************
19
+
20
+
Functional changes
21
+
^^^^^^^^^^^^^^^^^^
22
+
23
+
* 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>`_.
24
+
To ensure your project compiles correctly, make sure to have the ``-MMD -c`` flags in your C and C++ extra flags.
25
+
26
+
APIs
27
+
----
28
+
14
29
ADC
15
-
---
30
+
***
16
31
17
32
Removed APIs
18
-
************
33
+
^^^^^^^^^^^^
19
34
20
35
* ``analogSetClockDiv``
21
36
* ``adcAttachPin``
22
37
* ``analogSetVRefPin``
23
38
24
39
BLE
25
-
---
40
+
***
26
41
27
42
Changes in APIs
28
-
***************
43
+
^^^^^^^^^^^^^^^
29
44
30
45
* Changed APIs return and parameter type from ``std::string`` to Arduino style ``String``.
31
46
* Changed UUID data type from ``uint16_t`` to ``BLEUUID`` class.
32
47
* ``BLEScan::start`` and ``BLEScan::getResults`` methods return type changed from ``BLEScanResults`` to ``BLEScanResults*``.
33
48
34
49
Hall Sensor
35
-
-----------
50
+
***********
36
51
37
52
Hall sensor is no longer supported.
38
53
39
54
Removed APIs
40
-
************
55
+
^^^^^^^^^^^^
41
56
42
57
* ``hallRead``
43
58
44
59
I2S
45
-
---
60
+
***
46
61
47
62
The I2S driver has been completely redesigned and refactored to use the new ESP-IDF driver.
48
63
For more information about the new API, check :doc:`/api/i2s`.
49
64
50
65
LEDC
51
-
----
66
+
****
52
67
53
68
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
69
For more information about the new API, check :doc:`/api/ledc`.
55
70
56
71
Removed APIs
57
-
************
72
+
^^^^^^^^^^^^
58
73
59
74
* ``ledcSetup``
60
75
* ``ledcAttachPin``
61
76
62
77
New APIs
63
-
********
78
+
^^^^^^^^
64
79
65
80
* ``ledcAttach`` used to set up the LEDC pin (merged ``ledcSetup`` and ``ledcAttachPin`` functions).
66
81
* ``ledcOutputInvert`` used to attach the interrupt to a timer using arguments.
@@ -69,18 +84,18 @@ New APIs
69
84
* ``ledcFadeWithInterruptArg`` used to set up and start a fade on a given LEDC pin with an interrupt using arguments.
70
85
71
86
Changes in APIs
72
-
***************
87
+
^^^^^^^^^^^^^^^
73
88
74
89
* ``ledcDetachPin`` renamed to ``ledcDetach``.
75
90
* In all functions, input parameter ``channel`` has been changed to ``pin``.
76
91
77
92
RMT
78
-
---
93
+
***
79
94
80
95
For more information about the new API, check :doc:`/api/rmt`.
81
96
82
97
Removed APIs
83
-
************
98
+
^^^^^^^^^^^^
84
99
85
100
* ``_rmtDumpStatus``
86
101
* ``rmtSetTick``
@@ -90,7 +105,7 @@ Removed APIs
90
105
* ``rmtReadData``
91
106
92
107
New APIs
93
-
********
108
+
^^^^^^^^
94
109
95
110
* ``rmtSetEOT``
96
111
* ``rmtWriteAsync``
@@ -99,7 +114,7 @@ New APIs
99
114
100
115
101
116
Changes in APIs
102
-
***************
117
+
^^^^^^^^^^^^^^^
103
118
104
119
* In all functions, input parameter ``rmt_obj_t* rmt`` has been changed to ``int pin``.
105
120
* ``rmtInit`` return parameter changed to bool.
@@ -114,37 +129,37 @@ Changes in APIs
114
129
* ``rmtSetCarrier`` input parameters ``uint32_t low, uint32_t high`` have been changed to ``uint32_t frequency_Hz, float duty_percent``.
115
130
116
131
SigmaDelta
117
-
----------
132
+
**********
118
133
119
134
SigmaDelta has been refactored to use the new ESP-IDF driver.
120
135
For more information about the new API, check :doc:`/api/sigmadelta`.
121
136
122
137
Removed APIs
123
-
************
138
+
^^^^^^^^^^^^
124
139
125
140
* ``sigmaDeltaSetup``
126
141
* ``sigmaDeltaRead``
127
142
128
143
New APIs
129
-
********
144
+
^^^^^^^^
130
145
131
146
* ``sigmaDeltaAttach`` used to set up the SigmaDelta pin (channel is acquired automatically).
132
147
* ``timerGetFrequency`` used to get the actual frequency of the timer.
133
148
* ``timerAttachInterruptArg`` used to attach the interrupt to a timer using arguments.
134
149
135
150
Changes in APIs
136
-
***************
151
+
^^^^^^^^^^^^^^^
137
152
138
153
* ``sigmaDeltaDetachPin`` renamed to ``sigmaDeltaDetach``.
139
154
* ``sigmaDeltaWrite`` input parameter ``channel`` has been changed to ``pin``.
140
155
141
156
Timer
142
-
-----
157
+
*****
143
158
144
159
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
160
146
161
Removed APIs
147
-
************
162
+
^^^^^^^^^^^^
148
163
149
164
* ``timerGetConfig``
150
165
* ``timerSetConfig``
@@ -164,30 +179,30 @@ Removed APIs
164
179
* ``timerAttachInterruptFlag``
165
180
166
181
New APIs
167
-
********
182
+
^^^^^^^^
168
183
169
184
* ``timerAlarm`` used to set up Alarm for the timer and enable it automatically (merged ``timerAlarmWrite`` and ``timerAlarmEnable`` functions).
170
185
* ``timerGetFrequency`` used to get the actual frequency of the timer.
171
186
* ``timerAttachInterruptArg`` used to attach the interrupt to a timer using arguments.
172
187
173
188
Changes in APIs
174
-
***************
189
+
^^^^^^^^^^^^^^^
175
190
176
191
* ``timerBegin`` has now only 1 parameter (frequency). There is an automatic calculation of the divider using different clock sources
177
192
to achieve the selected frequency.
178
193
* ``timerAttachInterrupt`` has now only 2 parameters. The ``edge`` parameter has been removed.
179
194
180
195
UART (HardwareSerial)
181
-
---------------------
196
+
*********************
182
197
183
198
Changes in APIs
184
-
***************
199
+
^^^^^^^^^^^^^^^
185
200
186
201
* ``setHwFlowCtrlMode`` input parameter ``uint8_t mode`` has been changed to ``SerialHwFlowCtrl mode``.
187
202
* ``setMode`` input parameter ``uint8_t mode`` has been changed to ``SerialMode mode``.
188
203
189
204
Functional changes
190
-
******************
205
+
^^^^^^^^^^^^^^^^^^
191
206
192
207
* Default pins for some SoCs have been changed to avoid conflicts with other peripherals:
193
208
* ESP32's UART1 RX and TX pins are now GPIO26 and GPIO27, respectively;
@@ -203,10 +218,10 @@ Functional changes
203
218
* 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
219
205
220
WiFi
206
-
----
221
+
****
207
222
208
223
Functional changes
209
-
******************
224
+
^^^^^^^^^^^^^^^^^^
210
225
211
226
* 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
227
* ``WiFiServer`` has functions ``accept()`` and ``available()`` with the same functionality. In Arduino, ``available()`` should work differently so it is now deprecated.
0 commit comments