• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

app_trace/11-Mar-2024-10,3275,857

app_update/11-Mar-2024-3,0712,095

asio/11-Mar-2024-481233

bootloader/11-Mar-2024-40,10838,010

bootloader_support/11-Mar-2024-12,9119,009

bt/11-Mar-2024-394,985245,255

cbor/11-Mar-2024-3125

cmock/11-Mar-2024-126

coap/11-Mar-2024-296185

console/11-Mar-2024-8,0625,228

cxx/11-Mar-2024-1,155869

driver/11-Mar-2024-64,38343,283

efuse/11-Mar-2024-15,18811,265

esp-tls/11-Mar-2024-3,7732,627

esp32/11-Mar-2024-980821

esp32c3/11-Mar-2024-246211

esp32h2/11-Mar-2024-229191

esp32s2/11-Mar-2024-477404

esp32s3/11-Mar-2024-578469

esp_adc_cal/11-Mar-2024-1,242804

esp_common/11-Mar-2024-2,1371,523

esp_eth/11-Mar-2024-10,9828,038

esp_event/11-Mar-2024-5,4833,453

esp_gdbstub/11-Mar-2024-1,8951,214

esp_hid/11-Mar-2024-7,4135,799

esp_http_client/11-Mar-2024-3,2232,190

esp_http_server/11-Mar-2024-6,4703,294

esp_https_ota/11-Mar-2024-851557

esp_https_server/11-Mar-2024-460268

esp_hw_support/11-Mar-2024-36,93424,535

esp_ipc/11-Mar-2024-1,106660

esp_lcd/11-Mar-2024-5,6514,330

esp_local_ctrl/11-Mar-2024-3,5692,775

esp_netif/11-Mar-2024-6,9704,132

esp_phy/11-Mar-2024-2,8202,076

esp_pm/11-Mar-2024-2,4991,600

esp_ringbuf/11-Mar-2024-3,0501,822

esp_rom/11-Mar-2024-43,90021,803

esp_serial_slave_link/11-Mar-2024-2,1751,086

esp_system/11-Mar-2024-18,51112,139

esp_timer/11-Mar-2024-3,8952,618

esp_websocket_client/11-Mar-2024-1,279921

esp_wifi/11-Mar-2024-13,3497,483

espcoredump/11-Mar-2024-10,3317,791

esptool_py/11-Mar-2024-62,25751,933

expat/11-Mar-2024-290154

fatfs/11-Mar-2024-28,86825,261

freemodbus/11-Mar-2024-15,7309,517

freertos/11-Mar-2024-45,19821,748

hal/11-Mar-2024-94,75146,562

heap/11-Mar-2024-7,7934,555

idf_test/11-Mar-2024-300166

ieee802154/11-Mar-2024-505123

jsmn/11-Mar-2024-491324

json/11-Mar-2024-260196

libsodium/11-Mar-2024-783555

linux/11-Mar-2024-107

log/11-Mar-2024-1,7861,115

lwip/11-Mar-2024-9,4735,837

mbedtls/11-Mar-2024-24,77915,597

mdns/11-Mar-2024-11,8268,948

mqtt/11-Mar-2024-943642

newlib/11-Mar-2024-6,5304,533

nghttp/11-Mar-2024-3,0562,190

nvs_flash/11-Mar-2024-16,15611,165

openssl/11-Mar-2024-8,0213,912

openthread/11-Mar-2024-1,548669

partition_table/11-Mar-2024-2,5111,910

perfmon/11-Mar-2024-1,013671

protobuf-c/11-Mar-2024-179

protocomm/11-Mar-2024-8,4236,251

pthread/11-Mar-2024-3,0962,245

riscv/11-Mar-2024-1,173684

sdmmc/11-Mar-2024-3,7212,699

soc/11-Mar-2024-337,390218,615

spi_flash/11-Mar-2024-18,57012,385

spiffs/11-Mar-2024-3,5942,679

tcp_transport/11-Mar-2024-3,2992,021

tcpip_adapter/11-Mar-2024-818436

tinyusb/11-Mar-2024-2,5121,594

touch_element/11-Mar-2024-5,3683,982

ulp/11-Mar-2024-5,4823,295

unity/11-Mar-2024-912588

usb/11-Mar-2024-13,4208,217

vfs/11-Mar-2024-7,4375,463

wear_levelling/11-Mar-2024-2,9782,088

wifi_provisioning/11-Mar-2024-8,3456,263

wpa_supplicant/11-Mar-2024-94,52368,483

xtensa/11-Mar-2024-57,47249,302

README.mdD11-Mar-20246.3 KiB160100

README.md

1# Core Components
2
3## Overview
4
5This document contains details about what the core components are, what they contain, and how they are organized.
6
7## Organization
8
9The core components are organized into two groups.
10
11The first group (referred to as `G0` from now on) contains `hal`, `xtensa` and `riscv` (referred to as `arch` components from now on), `esp_rom`, `esp_common`, and `soc`. This
12group contain information about and low-level access to underlying hardware; or in the case of `esp_common`, hardware-agnostic code and utilities.
13These components can depend on each other, but as much as possible have no dependencies outside the group. The reason for this is that, due to the
14nature of what these components contain, the likelihood is high that a lot of other components will require these. Ideally, then, the dependency
15relationship only goes one way. This makes it easier for these components, as a group, to be usable in another project. One can conceivably implement
16a competing SDK to ESP-IDF on top of these components.
17
18The second group (referred to as `G1` from now on) sits at a higher level than the first group. This group contains the components `esp_hw_support`, `esp_system`, `newlib`, `spi_flash`,
19`freertos`, `log`, and `heap`. Like the first group, circular dependencies within the group are allowed; and being at a higher level, dependency on the first group
20is allowed. These components represent software mechanisms essential to building other components.
21
22## Descriptions
23
24The following is a short description of the components mentioned above.
25
26### `G0` Components
27
28#### `hal`
29
30Contains the hardware abstraction layer and low-level operation implementations for the various peripherals. The low-level functions assign meaningful names to register-level manipulations; the hardware abstraction provide operations one level above this, grouping these low-level functions
31into routines that achieve a meaningful action or state of the peripheral.
32
33Example:
34
35- `spi_flash_ll_set_address` is a low-level function part of the hardware abstraction `spi_flash_hal_read_block`
36
37#### `arch`
38
39Contains low-level architecture operations and definitions, including those for customizations (can be thought of on the same level as the low-level functions of `hal`).
40This can also contain files provided by the architecture vendor.
41
42Example:
43
44- `xt_set_exception_handler`
45- `riscv_global_interrupts_enable`
46- `ERI_PERFMON_MAX`
47
48#### `esp_common`
49
50Contains hardware-agnostic definitions, constants, macros, utilities, 'pure' and/or algorithmic functions that is useable by all other components (that is, barring there being a more appropriate component to put them in).
51
52Example:
53
54- `BIT(nr)` and other bit manipulation utilities in the future
55- `IDF_DEPRECATED(REASON)`
56- `ESP_IDF_VERSION_MAJOR`
57
58#### `soc`
59
60Contains description of the underlying hardware: register structure, addresses, pins, capabilities, etc.
61
62Example:
63
64- `DR_REG_DPORT_BASE`
65- `SOC_MCPWM_SUPPORTED`
66- `uart_dev_s`
67
68#### `esp_rom`
69
70Contains headers, linker scripts, abstraction layer, patches, and other related files to ROM functions.
71
72Example:
73
74- `esp32.rom.eco3.ld`
75- `rom/aes.h`
76
77### `G1` Components
78
79#### `spi_flash`
80
81SPI flash device access implementation.
82
83#### `freertos`
84
85FreeRTOS port to targets supported by ESP-IDF.
86
87#### `log`
88
89Logging library.
90
91#### `heap`
92
93Heap implementation.
94
95#### `newlib`
96
97Some functions n the standard library are implemented here, especially those needing other `G1` components.
98
99Example:
100
101- `malloc` is implemented in terms of the component `heap`'s functions
102- `gettimeofday` is implemented in terms of system time in `esp_system`
103
104#### `esp_system`
105
106Contains implementation of system services and controls system behavior. The implementations
107here may take hardware resources and/or decide on a hardware state needed for support of a system service/feature/mechanism.
108Currently, this encompasses the following, but not limited to:
109
110- Startup and initialization
111- Panic and debug
112- Reset and reset reason
113- Task and interrupt watchdogs
114
115#### `esp_hw_support`
116
117Contains implementations that provide hardware operations, arbitration, or resource sharing, especially those that
118is used in the system. Unlike `esp_system`, implementations here do not decide on a hardware state or takes hardware resource, acting
119merely as facilitator to hardware access. Currently, this encompasses the following, but not limited to:
120
121- Interrupt allocation
122- Sleep functions
123- Memory functions (external SPIRAM, async memory, etc.)
124- Clock and clock control
125- Random generation
126- CPU utilities
127- MAC settings
128
129### `esp_hw_support` vs `esp_system`
130
131This section details list some implementations and the reason for placing it in either `esp_hw_support` or `esp_system`.
132
133#### `task_wdt.c` (`esp_system`) vs  `intr_alloc.c` (`esp_hw_support`)
134
135The task watchdog fits the definition of taking and configuring hardware resources (wdt, interrupt) for implementation of a system service/mechanism.
136
137This is in contrast with interrupt allocation that merely facilitates access to the underlying hardware for other implementations -
138drivers, user code, and even the task watchdog mentioned previously!
139
140#### `crosscore_int.c` (`esp_system`)
141
142The current implementation of crosscore interrupts is tightly coupled with a number of interrupt reasons
143associated with system services/mechanisms: REASON_YIELD (scheduler), REASON_FREQ_SWITCH (power management)
144REASON_PRINT_BACKTRACE (panic and debug).
145
146However, if an implementation exists that makes it possible to register an arbitrary interrupt reason - a
147lower level inter-processor call if you will, then this implementation is a good candidate for `esp_hw_support`.
148The current implementation in `esp_system` can then just register the interrupt reasons mentioned above.
149
150#### `esp_mac.h`, `esp_chip_info.h`, `esp_random.h` (`esp_hw_support`)
151
152The functions in these headers used to be in `esp_system.h`, but have been split-off.
153However, to maintain backward compatibility, `esp_system.h` includes these headers.
154
155The remaining functions in `esp_system.h` are those that deal with system behavior, such
156as `esp_register_shutdown_handler`, or are proxy for other system components's APIs such as
157`esp_get_free_heap_size`.
158
159The functions split-off from `esp_system.h` are much more hardware manipulation oriented such as:
160`esp_read_mac`, `esp_random` and `esp_chip_info`.