BOM-DAT/RJ-45-dat/44-57-14-31-07-2023.png
... ...
Binary files a/BOM-DAT/RJ-45-dat/44-57-14-31-07-2023.png and /dev/null differ
BOM-DAT/RJ-45-dat/59-08-14-28-12-2022.png
... ...
Binary files a/BOM-DAT/RJ-45-dat/59-08-14-28-12-2022.png and /dev/null differ
BOM-DAT/RJ-45-dat/RJ45-DAT.md
... ...
@@ -1,19 +0,0 @@
1
-
2
-
3
-# RJ45
4
-
5
-## standard
6
-
7
-datasheet
8
-
9
-https://datasheet.lcsc.com/lcsc/2204251600_HCTL-HC-RJ45-059-1-2_C3000199.pdf
10
-
11
-
12
-
13
-![](59-08-14-28-12-2022.png)
14
-
15
-
16
-
17
-## dual port silm
18
-
19
-![](44-57-14-31-07-2023.png)
... ...
\ No newline at end of file
BOM-DAT/RJ11-dat/RJ11-dat.md
BOM-DAT/RJ45-dat/44-57-14-31-07-2023.png
... ...
Binary files /dev/null and b/BOM-DAT/RJ45-dat/44-57-14-31-07-2023.png differ
BOM-DAT/RJ45-dat/59-08-14-28-12-2022.png
... ...
Binary files /dev/null and b/BOM-DAT/RJ45-dat/59-08-14-28-12-2022.png differ
BOM-DAT/RJ45-dat/RJ45-DAT.md
... ...
@@ -0,0 +1,26 @@
1
+
2
+
3
+# RJ45
4
+
5
+- [[RJ45-dat]] - [[RJ11-dat]]
6
+
7
+
8
+
9
+## standard
10
+
11
+datasheet
12
+
13
+https://datasheet.lcsc.com/lcsc/2204251600_HCTL-HC-RJ45-059-1-2_C3000199.pdf
14
+
15
+
16
+
17
+![](59-08-14-28-12-2022.png)
18
+
19
+
20
+
21
+## dual port silm
22
+
23
+![](44-57-14-31-07-2023.png)
24
+
25
+
26
+
SDK-dat/ESP-SDK-dat/esp-idf-dat/esp-idf-dat.md
... ...
@@ -10,6 +10,8 @@
10 10
11 11
- [[esp-idf-error-dat]]
12 12
13
+- [[interface-SDK-dat]] - [[I2C-SDK-dat]] - [[ethernet-SDK-dat]]
14
+
13 15
## demo code
14 16
15 17
- https://github.com/Edragon/esp-idf-code
SDK-dat/ESP-SDK-dat/esp-idf-dat/esp-idf-vscode-dat/esp-idf-vscode-dat.md
... ...
@@ -2,6 +2,10 @@
2 2
3 3
# esp-idf-vscode-dat
4 4
5
+- [[esp-idf-vscode-install-dat]] - [[esp-idf-vscode-compile-dat]]
6
+
7
+- [[I2C-dat]] - [[ethernet-dat]]
8
+
5 9
e:\work-data\IDF
6 10
7 11
e:\work-data\IDF_tools
... ...
@@ -16,7 +20,7 @@ e:\work-data\IDF_tools
16 20
https://docs.espressif.com/projects/vscode-esp-idf-extension/en/latest/
17 21
18 22
19
-- [[esp-idf-vscode-install-dat]] - [[esp-idf-vscode-compile-dat]]
23
+
20 24
21 25
22 26
- [[ESP-IDF-dat]]
SDK-dat/interface-SDK-dat/I2C-SDK-dat/2025-08-09-12-52-02.png
... ...
Binary files /dev/null and b/SDK-dat/interface-SDK-dat/I2C-SDK-dat/2025-08-09-12-52-02.png differ
SDK-dat/interface-SDK-dat/I2C-SDK-dat/2025-08-09-12-53-11.png
... ...
Binary files /dev/null and b/SDK-dat/interface-SDK-dat/I2C-SDK-dat/2025-08-09-12-53-11.png differ
SDK-dat/interface-SDK-dat/I2C-SDK-dat/I2C-SDK-dat.md
... ...
@@ -0,0 +1,92 @@
1
+
2
+# I2C-SDK-dat
3
+
4
+## python
5
+
6
+### I2C scan
7
+
8
+- [[py-rpi-i2c-scan-dat]] - [[LM75-dat]]
9
+
10
+output
11
+
12
+ root@raspberrypi:~# python py-rpi-i2c-scan.py
13
+ ============================================================
14
+ Raspberry Pi I2C Address Scanner
15
+ ============================================================
16
+ I2C Scanner initialized on bus 1
17
+ Scanning I2C bus for devices...
18
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f
19
+ 00: -- -- -- -- -- -- -- -- -- -- -- -- --
20
+ 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
21
+ 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
22
+ 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
23
+ 40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
24
+ 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
25
+ 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
26
+ 70: -- -- -- -- -- -- -- --
27
+
28
+ Found 1 device(s):
29
+ ------------------------------------------------------------
30
+ Address: 0x48 ( 72) - ADS1115/ADS1015 ADC or TMP102 Temperature Sensor
31
+
32
+ Scan complete!
33
+
34
+ Note: Make sure I2C is enabled in raspi-config
35
+ Install required library:
36
+
37
+ pip install smbus2
38
+
39
+
40
+## ESP-IDF
41
+
42
+
43
+### I2C on ESP32-P4
44
+
45
+I2C is a commonly used serial communication bus that operates with two wires: one for data (SDA, Serial Data) and one for clock (SCL, Serial Clock). It supports multi-master and multi-slave modes.
46
+
47
+On the ESP32-P4, there are two I2C bus interfaces. The chip's internal GPIO matrix allows you to assign any GPIO pin for I2C, giving you flexibility in pin selection. ESP32-P4 supports both Slave and Master modes. In most cases, you will use Master mode to initiate communication, control, and send/receive data to/from slave devices (such as sensors with I2C interfaces).
48
+
49
+For ESP32-P4-NANO, the default I2C pins are SCL (GPIO8) and SDA (GPIO7).
50
+
51
+![](2025-08-09-12-52-02.png)
52
+
53
+#### I2C Configuration in ESP-IDF
54
+
55
+In ESP-IDF, you configure the I2C bus using the `i2c_master_bus_config_t` structure:
56
+
57
+- `clk_source`: Selects the I2C bus clock source. Use `I2C_CLK_SRC_DEFAULT` for the default clock source (recommended).
58
+- `i2c_port`: Sets which I2C port/controller to use. ESP32-P4 has two ports; use this to select between them if needed.
59
+- `scl_io_num`: Sets the GPIO number for the SCL (clock) line. For ESP32-P4-NANO, use 8.
60
+- `sda_io_num`: Sets the GPIO number for the SDA (data) line. For ESP32-P4-NANO, use 7.
61
+- `glitch_ignore_cnt`: Sets the glitch filter period for the master bus. Glitches shorter than this value are ignored (typically set to 7).
62
+- `enable_internal_pullup`: Enables internal pull-ups. On ESP32-P4-NANO, external pull-ups are already present, so set this to false.
63
+
64
+Example configuration:
65
+
66
+```c
67
+i2c_master_bus_config_t i2c_bus_config = {
68
+ .clk_source = I2C_CLK_SRC_DEFAULT,
69
+ .i2c_port = I2C_NUM_0,
70
+ .scl_io_num = 8,
71
+ .sda_io_num = 7,
72
+ .glitch_ignore_cnt = 7,
73
+ .flags.enable_internal_pullup = false,
74
+};
75
+```
76
+
77
+#### Using i2c_tools and menuconfig
78
+
79
+Open the `i2c_tools` project, select the correct COM port and chip model, and click the ⚙️ (settings) icon. This opens the SDK Configuration Editor (menuconfig). Search for "I2C" in the search bar; you will see the SCL and SDA GPIO numbers match the defaults (SCL: GPIO8, SDA: GPIO7).
80
+
81
+Next, click the 🔥 (build/flash/monitor) button to compile, flash, and monitor the project. In the terminal, you will see a command menu. When you run `i2cdetect`, it will print all detected I2C addresses. If a device is present, its address will be shown (for example, address 18 is the onboard ES8311 Codec audio chip, which will be explained in the I2S section).
82
+
83
+![](2025-08-09-12-53-11.png)
84
+
85
+#### Next Steps: Communicating with I2C Devices
86
+
87
+You have now completed basic I2C device communication. To use I2C devices, you often need to write register configurations to the device at its I2C address. This requires writing initialization code for each device you want to use. Different I2C devices have different addresses; you can use the `i2ctools` utility to scan for connected devices, then consult the device datasheet for register and configuration details to implement I2C communication in your program.
88
+
89
+
90
+## ref
91
+
92
+- [[interface-SDK-dat]]
... ...
\ No newline at end of file
SDK-dat/interface-SDK-dat/ethernet-SDK-dat/2025-08-09-13-00-18.png
... ...
Binary files /dev/null and b/SDK-dat/interface-SDK-dat/ethernet-SDK-dat/2025-08-09-13-00-18.png differ
SDK-dat/interface-SDK-dat/ethernet-SDK-dat/2025-08-09-13-01-03.png
... ...
Binary files /dev/null and b/SDK-dat/interface-SDK-dat/ethernet-SDK-dat/2025-08-09-13-01-03.png differ
SDK-dat/interface-SDK-dat/ethernet-SDK-dat/2025-08-09-13-01-26.png
... ...
Binary files /dev/null and b/SDK-dat/interface-SDK-dat/ethernet-SDK-dat/2025-08-09-13-01-26.png differ
SDK-dat/interface-SDK-dat/ethernet-SDK-dat/2025-08-09-13-01-55.png
... ...
Binary files /dev/null and b/SDK-dat/interface-SDK-dat/ethernet-SDK-dat/2025-08-09-13-01-55.png differ
SDK-dat/interface-SDK-dat/ethernet-SDK-dat/ethernet-SDK-dat.md
... ...
@@ -0,0 +1,44 @@
1
+
2
+# ethernet-SDK-dat
3
+
4
+
5
+## ESP-IDF Example: Ethernet Driver
6
+
7
+This example demonstrates the basic usage of the Ethernet driver and `esp_netif` in ESP-IDF. The Ethernet driver initialization is separated into a dedicated subcomponent, making it clear how to distinguish between driver and `esp_netif` initialization. The workflow is illustrated below:
8
+
9
+![](2025-08-09-13-00-18.png)
10
+
11
+### RMII Interface Definition
12
+
13
+The ESP32-P4 chip connects to the IP101GRI PHY chip via the RMII interface. The pin definitions are as follows:
14
+
15
+- **TXD[1:0]**: Transmit data lines, controlled by GPIO34 and GPIO35
16
+- **RXD[1:0]**: Receive data lines, controlled by GPIO30 and GPIO29
17
+- **TX_EN**: Transmit enable signal, controlled by GPIO49
18
+- **CRS_DV**: Carrier sense and data valid signal, controlled by GPIO28
19
+- **REF_CLK**: Reference clock, controlled by GPIO50 (50MHz generated from a 25MHz external crystal via the PHY)
20
+- **MDIO and MDC**: Management data interface for Ethernet (PHY control/configuration), controlled by GPIO52 and GPIO31
21
+- **RESET**: Resets the IP101GRI PHY, controlled by GPIO51
22
+
23
+### Project Setup and Configuration
24
+
25
+Open the `ethernetbasic` project, select the correct COM port and chip model, and click the ⚙️ (settings) icon. This opens the SDK Configuration Editor (menuconfig). Search for "ETH" in the search bar; you will see the relevant parameters. Match them to the diagram below:
26
+
27
+![](2025-08-09-13-01-03.png)
28
+
29
+### Build, Flash, and Monitor
30
+
31
+Click the 🔥 (build/flash/monitor) button to compile, flash, and monitor the project. In the terminal, you will see the program start. When you plug in the Ethernet cable, the device will obtain an IP address; unplugging the cable will disconnect the network, as shown:
32
+
33
+![](2025-08-09-13-01-26.png)
34
+
35
+You can check your router to see a device named "espressif" connected. At this point, your ESP32-P4-NANO is successfully online.
36
+
37
+![](2025-08-09-13-01-55.png)
38
+
39
+
40
+## ref
41
+
42
+- [[interface-SDK-dat]]
43
+
44
+- [[ESP-IDF-dat]]
... ...
\ No newline at end of file
SDK-dat/interface-SDK-dat/interface-SDK-dat.md
... ...
@@ -3,47 +3,24 @@
3 3
4 4
- [[interface-dat]]
5 5
6
-## python on RPI
7
-
8
-- [[RPI-sdk-dat]] - [[python-dat]] - [[python-env-dat]]
6
+- [[I2C-dat]] - [[I2C-SDK-dat]]
9 7
10
-### I2C scan
8
+- [[ethernet-dat]] - [[ethernet-SDK-dat]]
11 9
12
-- [[py-rpi-i2c-scan-dat]] - [[LM75-dat]]
13 10
14
-output
15 11
16
- root@raspberrypi:~# python py-rpi-i2c-scan.py
17
- ============================================================
18
- Raspberry Pi I2C Address Scanner
19
- ============================================================
20
- I2C Scanner initialized on bus 1
21
- Scanning I2C bus for devices...
22
- 0 1 2 3 4 5 6 7 8 9 a b c d e f
23
- 00: -- -- -- -- -- -- -- -- -- -- -- -- --
24
- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
25
- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
26
- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
27
- 40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
28
- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
29
- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30
- 70: -- -- -- -- -- -- -- --
31 12
32
- Found 1 device(s):
33
- ------------------------------------------------------------
34
- Address: 0x48 ( 72) - ADS1115/ADS1015 ADC or TMP102 Temperature Sensor
35 13
36
- Scan complete!
37 14
38
- Note: Make sure I2C is enabled in raspi-config
39
- Install required library:
40
-
41
- pip install smbus2
15
+## python on RPI
42 16
17
+- [[RPI-sdk-dat]] - [[python-dat]] - [[python-env-dat]]
43 18
44 19
45 20
46 21
47 22
## ref
48 23
49
-- [[SDK-dat]]
... ...
\ No newline at end of file
0
+- [[SDK-dat]]
1
+
2
+- [[ESP-IDF-dat]]
... ...
\ No newline at end of file
Tech-dat/Interface-dat/I2C-dat/I2C-dat.md
... ...
@@ -1,6 +1,7 @@
1 1
2 2
# I2C Dat
3 3
4
+- [[I2C-SDK-dat]] - [[interface-SDK-dat]]
4 5
5 6
## common I2C devices address
6 7
Tech-dat/Network-dat/ethernet-dat/2025-08-09-12-57-04.png
... ...
Binary files /dev/null and b/Tech-dat/Network-dat/ethernet-dat/2025-08-09-12-57-04.png differ
Tech-dat/Network-dat/ethernet-dat/ethernet-dat.md
... ...
@@ -5,6 +5,34 @@
5 5
6 6
- [[PHY-dat]]
7 7
8
+- [[ethernet-SDK-dat]]
9
+
10
+
11
+## info
12
+
13
+
14
+### Basic Ethernet Concepts
15
+
16
+Ethernet is an asynchronous, carrier-sense multiple access with collision detection (CSMA/CD) protocol/interface. While Ethernet is generally not ideal for low-power applications, it is widely used due to its broad deployment, efficient network connectivity, high data rates, and unlimited scalability. Nearly all wired communications can be achieved via Ethernet.
17
+
18
+Ethernet is categorized by speed:
19
+- Standard Ethernet (10 Mbit/s)
20
+- Fast Ethernet (100 Mbit/s)
21
+- Gigabit Ethernet (1000 Mbit/s)
22
+- 10-Gigabit Ethernet (10 Gbit/s) and higher
23
+
24
+Ethernet interface types include RJ45 (the most common for computers and the ESP32-P4 board), and RJ11 (telephone line interface). - [[RJ45-dat]] - [[RJ11-dat]]
25
+
26
+The ESP32-P4 network model can be explained as follows:
27
+
28
+![](2025-08-09-12-57-04.png)
29
+
30
+- **Network Interface Layer**: ESP32-P4 connects to the IP101GRI PHY via RMII interface, and the network transformer leads to the RJ45 port. The MAC layer is integrated in the ESP32-P4 chip, handling frame encapsulation, checksums, and MAC addresses.
31
+- **Network and Transport Layers**: Managed by ESP32-P4 driving the IP101GRI PHY.
32
+- **Application Layer**: Once network connection is established, ESP32-P4 can perform HTTP requests, use MQTT, and other server communications.
33
+
34
+
35
+
8 36
9 37
10 38
## chip