Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit 0442314

Browse files
authored
v3.2.1
### Releases v3.2.1 1. Initial porting to many Generic boards using WiFi/Ethernet modules/shields. 2. Add support to SAMD21/SAMD51, nRF52, STM32F/L/H/G/WB/MP1 with WiFiNINA, W5x00, ENC28J60, LAN8742A Ethernet modules/shields. 3. Add functions. 4. Completely new examples using NTP time to update DS3231 RTC and/or local clock.
1 parent 19db459 commit 0442314

File tree

69 files changed

+14993
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+14993
-0
lines changed

CONTRIBUTING.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## Contributing
2+
3+
### Reporting Bugs
4+
5+
Please report bugs in [NTPClient_Generic Issues](https://github.com/khoih-prog/NTPClient_Generic/issues) if you find them.
6+
7+
However, before reporting a bug please check through the following:
8+
9+
* [Existing Open Issues](https://github.com/khoih-prog/NTPClient_Generic/issues) - someone might have already encountered this.
10+
11+
If you don't find anything, please [open a new issue](https://github.com/khoih-prog/NTPClient_Generic/issues/new).
12+
13+
### How to submit a bug report
14+
15+
Please ensure to specify the following:
16+
17+
* Arduino IDE version (e.g. 1.8.13) or Platform.io version
18+
* `ESP8266`, `ESP32` or board's Core Version (e.g. ESP8266 core v2.7.4, ESP32 v1.0.4, etc.)
19+
* Contextual information (e.g. what you were trying to achieve)
20+
* Simplest possible steps to reproduce
21+
* Anything that might be relevant in your opinion, such as:
22+
* Operating system (Windows, Ubuntu, etc.) and the output of `uname -a`
23+
* Network configuration
24+
25+
26+
### Example
27+
28+
```
29+
Arduino IDE version: 1.8.13
30+
ESP8266 Core Version 2.7.4
31+
OS: Ubuntu 20.04 LTS
32+
Linux xy-Inspiron-3593 5.4.0-51-generic #56-Ubuntu SMP Mon Oct 5 14:28:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
33+
34+
Context:
35+
I encountered an endless loop while trying to connect to Local WiFi.
36+
37+
Steps to reproduce:
38+
1. ...
39+
2. ...
40+
3. ...
41+
4. ...
42+
```
43+
### Sending Feature Requests
44+
45+
Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful.
46+
47+
There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/NTPClient_Generic/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
48+
49+
### Sending Pull Requests
50+
51+
Pull Requests with changes and fixes are also welcome!
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
/*
2+
Copyright (c) 2011 Arduino. All right reserved.
3+
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
This library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12+
See the GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with this library; if not, write to the Free Software
16+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#ifndef _VARIANT_ARDUINO_STM32_
20+
#define _VARIANT_ARDUINO_STM32_
21+
22+
#ifdef __cplusplus
23+
extern "C" {
24+
#endif // __cplusplus
25+
26+
/*----------------------------------------------------------------------------
27+
* Pins
28+
*----------------------------------------------------------------------------*/
29+
30+
#define PG9 0
31+
#define PG14 1
32+
#define PF15 2
33+
#define PE13 3
34+
#define PF14 4
35+
#define PE11 5
36+
#define PE9 6
37+
#define PF13 7
38+
#define PF12 8
39+
#define PD15 9
40+
#define PD14 10
41+
#define PA7 A10
42+
#define PA6 A11
43+
#define PA5 A12
44+
#define PB9 14
45+
#define PB8 15
46+
#define PC6 16
47+
#define PB15 17
48+
#define PB13 18
49+
#define PB12 19
50+
#define PA15 20
51+
#define PC7 21
52+
#define PB5 22
53+
#define PB3 23
54+
#define PA4 A13
55+
#define PB4 25
56+
#define PB6 26
57+
#define PB2 27
58+
#define PD13 28
59+
#define PD12 29
60+
#define PD11 30
61+
#define PE2 31
62+
#define PA0 A14
63+
#define PB0 33 // LED_GREEN
64+
#define PE0 34
65+
#define PB11 35
66+
#define PB10 36
67+
#define PE15 37
68+
#define PE14 38
69+
#define PE12 39
70+
#define PE10 40
71+
#define PE7 41
72+
#define PE8 42
73+
#define PC8 43
74+
#define PC9 44
75+
#define PC10 45
76+
#define PC11 46
77+
#define PC12 47
78+
#define PD2 48
79+
#define PG2 49
80+
#define PG3 50
81+
#define PD7 51
82+
#define PD6 52
83+
#define PD5 53
84+
#define PD4 54
85+
#define PD3 55
86+
// 56 is PE2 (31)
87+
#define PE4 57
88+
#define PE5 58
89+
#define PE6 59
90+
#define PE3 60
91+
#define PF8 A15
92+
#define PF7 A16
93+
#define PF9 A17
94+
#define PG1 64
95+
#define PG0 65
96+
#define PD1 66
97+
#define PD0 67
98+
#define PF0 68
99+
#define PF1 69
100+
#define PF2 70
101+
// 71 is PA7 (11)
102+
// 72 is NC
103+
#define PB7 73 // LED_BLUE
104+
#define PB14 74 // LED_RED
105+
#define PC13 75 // USER_BTN
106+
#define PD9 76 // Serial Rx
107+
#define PD8 77 // Serial Tx
108+
#define PA3 A0
109+
#define PC0 A1
110+
#define PC3 A2
111+
#define PF3 A3
112+
#define PF5 A4
113+
#define PF10 A5
114+
#define PB1 A6
115+
#define PC2 A7
116+
#define PF4 A8
117+
#define PF6 A9
118+
119+
// This must be a literal
120+
#define NUM_DIGITAL_PINS 88
121+
// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
122+
#define NUM_ANALOG_INPUTS 18
123+
124+
// On-board LED pin number
125+
#define LED_BUILTIN PB0
126+
#define LED_GREEN LED_BUILTIN
127+
#define LED_BLUE PB7
128+
#define LED_RED PB14
129+
130+
// On-board user button
131+
#define USER_BTN PC13
132+
133+
// Timer Definitions
134+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
135+
#define TIMER_TONE TIM6
136+
#define TIMER_SERVO TIM7
137+
138+
// UART Definitions
139+
#define SERIAL_UART_INSTANCE 3 //Connected to ST-Link
140+
141+
// Serial pin used for console (ex: stlink)
142+
// Rerquired by Firmata
143+
#define PIN_SERIAL_RX PD9
144+
#define PIN_SERIAL_TX PD8
145+
146+
/* Extra HAL modules */
147+
#define HAL_DAC_MODULE_ENABLED
148+
#define HAL_ETH_MODULE_ENABLED
149+
150+
// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
151+
// By default 2MB single bank
152+
#define FLASH_BASE_ADDRESS 0x081C0000
153+
#define FLASH_DATA_SECTOR 11
154+
155+
#ifdef __cplusplus
156+
} // extern "C"
157+
#endif
158+
/*----------------------------------------------------------------------------
159+
* Arduino objects - C++ only
160+
*----------------------------------------------------------------------------*/
161+
162+
#ifdef __cplusplus
163+
// These serial port names are intended to allow libraries and architecture-neutral
164+
// sketches to automatically default to the correct port name for a particular type
165+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
166+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
167+
//
168+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
169+
//
170+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
171+
//
172+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
173+
//
174+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
175+
//
176+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
177+
// pins are NOT connected to anything by default.
178+
#define SERIAL_PORT_MONITOR Serial
179+
180+
// KH mod to add Serial1, for ESP-AT
181+
//#define SERIAL_PORT_HARDWARE Serial
182+
#define SERIAL_PORT_HARDWARE Serial1
183+
#endif
184+
185+
#endif /* _VARIANT_ARDUINO_STM32_ */
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
/*
2+
Copyright (c) 2011 Arduino. All right reserved.
3+
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
This library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12+
See the GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with this library; if not, write to the Free Software
16+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#ifndef _VARIANT_ARDUINO_STM32_
20+
#define _VARIANT_ARDUINO_STM32_
21+
22+
#ifdef __cplusplus
23+
extern "C" {
24+
#endif // __cplusplus
25+
26+
/*----------------------------------------------------------------------------
27+
* Pins
28+
*----------------------------------------------------------------------------*/
29+
30+
#define PA3 0
31+
#define PA2 1
32+
#define PA10 2
33+
#define PB3 3
34+
#define PB5 4
35+
#define PB4 5
36+
#define PB10 6
37+
#define PA8 7
38+
#define PA9 8
39+
#define PC7 9
40+
#define PB6 10
41+
#define PA7 A6
42+
#define PA6 A7
43+
#define PA5 13
44+
#define PB9 14
45+
#define PB8 15
46+
// ST Morpho
47+
// CN7 Left Side
48+
#define PC10 16
49+
#define PC12 17
50+
// 18 is NC - BOOT0
51+
#define PA13 19 // SWD
52+
#define PA14 20 // SWD
53+
#define PA15 21
54+
#define PB7 22
55+
#define PC13 23
56+
#define PC14 24
57+
#define PC15 25
58+
#define PH0 26
59+
#define PH1 27
60+
#define PC2 A8
61+
#define PC3 A9
62+
// CN7 Right Side
63+
#define PC11 30
64+
#define PD2 31
65+
// CN10 Left Side
66+
#define PC9 32
67+
// CN10 Right side
68+
#define PC8 33
69+
#define PC6 34
70+
#define PC5 A10
71+
#define PA12 36
72+
#define PA11 37
73+
#define PB12 38
74+
#define PB11 39
75+
#define PB2 40
76+
#define PB1 41
77+
#define PB15 42
78+
#define PB14 43
79+
#define PB13 44
80+
#define PC4 A11
81+
#define PA0 A0
82+
#define PA1 A1
83+
#define PA4 A2
84+
#define PB0 A3
85+
#define PC1 A4
86+
#define PC0 A5
87+
88+
// This must be a literal
89+
#define NUM_DIGITAL_PINS 52
90+
// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
91+
#define NUM_ANALOG_INPUTS 12
92+
93+
// On-board LED pin number
94+
#define LED_BUILTIN 13
95+
#define LED_GREEN LED_BUILTIN
96+
97+
// On-board user button
98+
#define USER_BTN PC13
99+
100+
// Timer Definitions
101+
// Use TIM6 when possible as servo and tone don't need GPIO output pin
102+
#define TIMER_TONE TIM6
103+
#define TIMER_SERVO TIM2
104+
105+
// UART Definitions
106+
#define SERIAL_UART_INSTANCE 2 //Connected to ST-Link
107+
// Default pin used for 'Serial' instance (ex: ST-Link)
108+
// Mandatory for Firmata
109+
#define PIN_SERIAL_RX 0
110+
#define PIN_SERIAL_TX 1
111+
112+
/* Extra HAL modules */
113+
#define HAL_DAC_MODULE_ENABLED
114+
115+
#ifdef __cplusplus
116+
} // extern "C"
117+
#endif
118+
/*----------------------------------------------------------------------------
119+
* Arduino objects - C++ only
120+
*----------------------------------------------------------------------------*/
121+
122+
#ifdef __cplusplus
123+
// These serial port names are intended to allow libraries and architecture-neutral
124+
// sketches to automatically default to the correct port name for a particular type
125+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
126+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
127+
//
128+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
129+
//
130+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
131+
//
132+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
133+
//
134+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
135+
//
136+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
137+
// pins are NOT connected to anything by default.
138+
#define SERIAL_PORT_MONITOR Serial
139+
140+
// KH mod to add Serial1, for ESP-AT
141+
//#define SERIAL_PORT_HARDWARE Serial
142+
#define SERIAL_PORT_HARDWARE Serial1
143+
#endif
144+
145+
#endif /* _VARIANT_ARDUINO_STM32_ */

0 commit comments

Comments
 (0)