Оновлення стану системи
This commit is contained in:
11
.vscode/sftp.json
vendored
Normal file
11
.vscode/sftp.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "My Server",
|
||||
"host": "localhost",
|
||||
"protocol": "sftp",
|
||||
"port": 22,
|
||||
"username": "username",
|
||||
"remotePath": "/",
|
||||
"uploadOnSave": false,
|
||||
"useTempFile": false,
|
||||
"openSsh": false
|
||||
}
|
||||
@@ -64,14 +64,14 @@ watch-watch — вбудована система на ESP32-S3 для нагл
|
||||
## UART взаємодія та heartbeat
|
||||
- Загальний UART (типово UART1, GPIO17/16) підключений до аналогового мультиплексора, лінії адреси `A0/A1/A2` (GPIO 9/10/11) вибирають одну з Raspberry Pi.
|
||||
- Модуль `uart_mux` серіалізує доступ до UART, надає API для `uart_mux_write/read` і періодично опитує UART на наявність heartbeat.
|
||||
- Після кожного вимірювання INA226 ESP32-S3 відправляє поточну телеметрію (`PWR <V> <I>`) до активної Raspberry Pi.
|
||||
- Після кожного вимірювання INA226 ESP32-S3 відправляє поточну телеметрію (`PWR <V>V <I>A`) до активної Raspberry Pi.
|
||||
- Якщо heartbeat від Pi не надходить протягом `CONFIG_WATCH_UART_HEARTBEAT_TIMEOUT_SEC` (за замовчуванням 60 с), відповідний канал живлення вимикається й знову вмикається для примусового перезапуску.
|
||||
- Команди CLI `uart send` / `uart read` дозволяють вручну надсилати/читати повідомлення, а в `app_main` можна реалізувати власні протоколи синхронізації.
|
||||
|
||||
## UART взаємодія з Raspberry Pi
|
||||
- Шина UART (типово UART1, TX=GPIO17, RX=GPIO16) підключена до аналогового мультиплексора з адресними лініями A0/A1/A2 (GPIO 9/10/11), що дозволяє вибирати одну з 5 Raspberry Pi.
|
||||
- Модуль `uart_mux` гарантує серійний доступ: перед операцією він виставляє двійковий код каналу на A0-A2 та блокує UART м’ютексом.
|
||||
- У `app_main` після вимірювань кожному Pi відправляється телеметрія (`CHx <V>V <I>mA`), а через CLI можна виконати `uart send <n> <msg>` або `uart read <n> [len]`.
|
||||
- У `app_main` після вимірювань кожному Pi відправляється телеметрія (`CHx <V>V <I>A`), а через CLI можна виконати `uart send <n> <msg>` або `uart read <n> [len]`.
|
||||
- Усі параметри (порт, швидкість, GPIO) доступні в `menuconfig → UART мультиплексор`.
|
||||
|
||||
## USB CDC CLI
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"ARCHIVE_NAME": "", "EXTRA_LAYERS": "", "ALL_ACTIVE_LAYERS": false, "EXTEND_EDGE_CUT": false, "ALTERNATIVE_EDGE_CUT": false, "AUTO TRANSLATE": true, "AUTO FILL": true, "EXCLUDE DNP": false, "OPEN BROWSER": true, "NO_BACKUP_OPT": false}
|
||||
104245
kicad/watch-watchkicad_pro/fp-info-cache
Normal file
104245
kicad/watch-watchkicad_pro/fp-info-cache
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
316
kicad/watch-watchkicad_pro/production/netlist.ipc
Normal file
316
kicad/watch-watchkicad_pro/production/netlist.ipc
Normal file
@@ -0,0 +1,316 @@
|
||||
P CODE 00
|
||||
P UNITS CUST 0
|
||||
P arrayDim N
|
||||
327NET-(R5-PAD1) U8 -1 A01X+047845Y-022000X0719Y0256R180S2
|
||||
327GND U8 -2 A01X+047845Y-021000X0719Y0256R180S2
|
||||
327EN4.1 U8 -3 A01X+044155Y-021000X0719Y0256R180S2
|
||||
327EN4.0 U8 -4 A01X+044155Y-022000X0719Y0256R180S2
|
||||
327NET-(R4-PAD1) U7 -1 A01X+047845Y-024614X0719Y0256R180S2
|
||||
327GND U7 -2 A01X+047845Y-023614X0719Y0256R180S2
|
||||
327EN3.1 U7 -3 A01X+044155Y-023614X0719Y0256R180S2
|
||||
327EN3.0 U7 -4 A01X+044155Y-024614X0719Y0256R180S2
|
||||
327NET-(R3-PAD1) U6 -1 A01X+047845Y-027228X0719Y0256R180S2
|
||||
327GND U6 -2 A01X+047845Y-026228X0719Y0256R180S2
|
||||
327EN2.1 U6 -3 A01X+044155Y-026228X0719Y0256R180S2
|
||||
327EN2.0 U6 -4 A01X+044155Y-027228X0719Y0256R180S2
|
||||
327NET-(R2-PAD1) U5 -1 A01X+047845Y-029843X0719Y0256R180S2
|
||||
327GND U5 -2 A01X+047845Y-028843X0719Y0256R180S2
|
||||
327EN1.1 U5 -3 A01X+044155Y-028843X0719Y0256R180S2
|
||||
327EN1.0 U5 -4 A01X+044155Y-029843X0719Y0256R180S2
|
||||
327NET-(R1-PAD1) U9 -1 A01X+047750Y-019000X0719Y0256R180S2
|
||||
327GND U9 -2 A01X+047750Y-018000X0719Y0256R180S2
|
||||
327EN0.1 U9 -3 A01X+044059Y-018000X0719Y0256R180S2
|
||||
327EN0.0 U9 -4 A01X+044059Y-019000X0719Y0256R180S2
|
||||
327ET-(U3-XTAL_N) Y1 -1 A01X+051061Y-033250X0453Y0394R000S2
|
||||
327GND Y1 -2 A01X+051750Y-033250X0453Y0394R000S2
|
||||
327GND Y1 -3 A01X+051750Y-032699X0453Y0394R000S2
|
||||
327ET-(U3-XTAL_P) Y1 -4 A01X+051061Y-032699X0453Y0394R000S2
|
||||
327TX4 U11 -1 A01X+065276Y-016750X0768Y0236R000S2
|
||||
327-(U11-A6-PAD2) U11 -2 A01X+065276Y-017250X0768Y0236R000S2
|
||||
327RX U11 -3 A01X+065276Y-017750X0768Y0236R000S2
|
||||
327-(U11-A7-PAD4) U11 -4 A01X+065276Y-018250X0768Y0236R000S2
|
||||
327-(U11-A5-PAD5) U11 -5 A01X+065276Y-018750X0768Y0236R000S2
|
||||
327GND U11 -6 A01X+065276Y-019250X0768Y0236R000S2
|
||||
327GND U11 -7 A01X+065276Y-019750X0768Y0236R000S2
|
||||
327GND U11 -8 A01X+065276Y-020250X0768Y0236R000S2
|
||||
327A2 U11 -9 A01X+067224Y-020250X0768Y0236R000S2
|
||||
327A1 U11 -10 A01X+067224Y-019750X0768Y0236R000S2
|
||||
327A0 U11 -11 A01X+067224Y-019250X0768Y0236R000S2
|
||||
327TX3 U11 -12 A01X+067224Y-018750X0768Y0236R000S2
|
||||
327TX0 U11 -13 A01X+067224Y-018250X0768Y0236R000S2
|
||||
327TX1 U11 -14 A01X+067224Y-017750X0768Y0236R000S2
|
||||
327TX2 U11 -15 A01X+067224Y-017250X0768Y0236R000S2
|
||||
327+3.3V U11 -16 A01X+067224Y-016750X0768Y0236R000S2
|
||||
327RX4 U10 -1 A01X+065801Y-021750X0768Y0236R000S2
|
||||
327-(U10-A6-PAD2) U10 -2 A01X+065801Y-022250X0768Y0236R000S2
|
||||
327TX U10 -3 A01X+065801Y-022750X0768Y0236R000S2
|
||||
327-(U10-A7-PAD4) U10 -4 A01X+065801Y-023250X0768Y0236R000S2
|
||||
327-(U10-A5-PAD5) U10 -5 A01X+065801Y-023750X0768Y0236R000S2
|
||||
327GND U10 -6 A01X+065801Y-024250X0768Y0236R000S2
|
||||
327GND U10 -7 A01X+065801Y-024750X0768Y0236R000S2
|
||||
327GND U10 -8 A01X+065801Y-025250X0768Y0236R000S2
|
||||
327A2 U10 -9 A01X+067750Y-025250X0768Y0236R000S2
|
||||
327A1 U10 -10 A01X+067750Y-024750X0768Y0236R000S2
|
||||
327A0 U10 -11 A01X+067750Y-024250X0768Y0236R000S2
|
||||
327RX3 U10 -12 A01X+067750Y-023750X0768Y0236R000S2
|
||||
327RX0 U10 -13 A01X+067750Y-023250X0768Y0236R000S2
|
||||
327RX1 U10 -14 A01X+067750Y-022750X0768Y0236R000S2
|
||||
327RX2 U10 -15 A01X+067750Y-022250X0768Y0236R000S2
|
||||
327+3.3V U10 -16 A01X+067750Y-021750X0768Y0236R000S2
|
||||
327ET-(U3-LNA_IN) U3 -1 A01X+046895Y-039207X0315Y0079R000S2
|
||||
327+3.3V U3 -2 A01X+046895Y-039364X0315Y0079R000S2
|
||||
327+3.3V U3 -3 A01X+046895Y-039522X0315Y0079R000S2
|
||||
327T-(U3-CHIP_PU) U3 -4 A01X+046895Y-039679X0315Y0079R000S2
|
||||
327NET-(U3-GPIO0) U3 -5 A01X+046895Y-039837X0315Y0079R000S2
|
||||
327EN0 U3 -6 A01X+046895Y-039994X0315Y0079R000S2
|
||||
327EN1 U3 -7 A01X+046895Y-040152X0315Y0079R000S2
|
||||
327EN2 U3 -8 A01X+046895Y-040309X0315Y0079R000S2
|
||||
327EN3 U3 -9 A01X+046895Y-040467X0315Y0079R000S2
|
||||
327EN4 U3 -10 A01X+046895Y-040624X0315Y0079R000S2
|
||||
327NET-(U3-GPIO6) U3 -11 A01X+046895Y-040781X0315Y0079R000S2
|
||||
327NET-(U3-GPIO7) U3 -12 A01X+046895Y-040939X0315Y0079R000S2
|
||||
327RGB U3 -13 A01X+046895Y-041096X0315Y0079R000S2
|
||||
327SDA U3 -14 A01X+046895Y-041254X0315Y0079R000S2
|
||||
327SCL U3 -15 A01X+047229Y-041589X0079Y0315R000S2
|
||||
327A0 U3 -16 A01X+047387Y-041589X0079Y0315R000S2
|
||||
327A1 U3 -17 A01X+047544Y-041589X0079Y0315R000S2
|
||||
327A2 U3 -18 A01X+047702Y-041589X0079Y0315R000S2
|
||||
327ET-(U3-GPIO14) U3 -19 A01X+047859Y-041589X0079Y0315R000S2
|
||||
327+3.3V U3 -20 A01X+048017Y-041589X0079Y0315R000S2
|
||||
327L_32K_P-PAD21) U3 -21 A01X+048174Y-041589X0079Y0315R000S2
|
||||
327L_32K_N-PAD22) U3 -22 A01X+048332Y-041589X0079Y0315R000S2
|
||||
327ET-(U3-GPIO17) U3 -23 A01X+048489Y-041589X0079Y0315R000S2
|
||||
327ET-(U3-GPIO18) U3 -24 A01X+048647Y-041589X0079Y0315R000S2
|
||||
327DM U3 -25 A01X+048804Y-041589X0079Y0315R000S2
|
||||
327DP U3 -26 A01X+048962Y-041589X0079Y0315R000S2
|
||||
327-GPIO21-PAD27) U3 -27 A01X+049119Y-041589X0079Y0315R000S2
|
||||
327-SPICS1-PAD28) U3 -28 A01X+049277Y-041589X0079Y0315R000S2
|
||||
327VDD_SPI-PAD29) U3 -29 A01X+049611Y-041254X0315Y0079R000S2
|
||||
3273-SPIHD-PAD30) U3 -30 A01X+049611Y-041096X0315Y0079R000S2
|
||||
3273-SPIWP-PAD31) U3 -31 A01X+049611Y-040939X0315Y0079R000S2
|
||||
327-SPICS0-PAD32) U3 -32 A01X+049611Y-040781X0315Y0079R000S2
|
||||
327-SPICLK-PAD33) U3 -33 A01X+049611Y-040624X0315Y0079R000S2
|
||||
327U3-SPIQ-PAD34) U3 -34 A01X+049611Y-040467X0315Y0079R000S2
|
||||
327U3-SPID-PAD35) U3 -35 A01X+049611Y-040309X0315Y0079R000S2
|
||||
327PICLK_N-PAD36) U3 -36 A01X+049611Y-040152X0315Y0079R000S2
|
||||
327PICLK_P-PAD37) U3 -37 A01X+049611Y-039994X0315Y0079R000S2
|
||||
327-GPIO33-PAD38) U3 -38 A01X+049611Y-039837X0315Y0079R000S2
|
||||
327-GPIO34-PAD39) U3 -39 A01X+049611Y-039679X0315Y0079R000S2
|
||||
327-GPIO35-PAD40) U3 -40 A01X+049611Y-039522X0315Y0079R000S2
|
||||
327-GPIO36-PAD41) U3 -41 A01X+049611Y-039364X0315Y0079R000S2
|
||||
327-GPIO37-PAD42) U3 -42 A01X+049611Y-039207X0315Y0079R000S2
|
||||
327-GPIO38-PAD43) U3 -43 A01X+049277Y-038872X0079Y0315R000S2
|
||||
327U3-MTCK-PAD44) U3 -44 A01X+049119Y-038872X0079Y0315R000S2
|
||||
327U3-MTDO-PAD45) U3 -45 A01X+048962Y-038872X0079Y0315R000S2
|
||||
327+3.3V U3 -46 A01X+048804Y-038872X0079Y0315R000S2
|
||||
327U3-MTDI-PAD47) U3 -47 A01X+048647Y-038872X0079Y0315R000S2
|
||||
327U3-MTMS-PAD48) U3 -48 A01X+048489Y-038872X0079Y0315R000S2
|
||||
327RX U3 -49 A01X+048332Y-038872X0079Y0315R000S2
|
||||
327TX U3 -50 A01X+048174Y-038872X0079Y0315R000S2
|
||||
327-GPIO45-PAD51) U3 -51 A01X+048017Y-038872X0079Y0315R000S2
|
||||
327-GPIO46-PAD52) U3 -52 A01X+047859Y-038872X0079Y0315R000S2
|
||||
327ET-(U3-XTAL_N) U3 -53 A01X+047702Y-038872X0079Y0315R000S2
|
||||
327ET-(U3-XTAL_P) U3 -54 A01X+047544Y-038872X0079Y0315R000S2
|
||||
327+3.3V U3 -55 A01X+047387Y-038872X0079Y0315R000S2
|
||||
327+3.3V U3 -56 A01X+047229Y-038872X0079Y0315R000S2
|
||||
317GND U3 -57 D0079PA00X+047564Y-039541X0197Y0000R000S3
|
||||
317GND U3 -57 D0079PA00X+047564Y-040230X0197Y0000R000S3
|
||||
317GND U3 -57 D0079PA00X+047564Y-040919X0197Y0000R000S3
|
||||
317GND U3 -57 D0079PA00X+048253Y-039541X0197Y0000R000S3
|
||||
317GND U3 -57 D0079PA00X+048253Y-040230X0197Y0000R000S3
|
||||
327GND U3 -57 A01X+048253Y-040230X1575Y1575R000S2
|
||||
327GND U3 -57 A02X+048253Y-040230X1575Y1575R000S3
|
||||
317GND U3 -57 D0079PA00X+048253Y-040919X0197Y0000R000S3
|
||||
317GND U3 -57 D0079PA00X+048942Y-039541X0197Y0000R000S3
|
||||
317GND U3 -57 D0079PA00X+048942Y-040230X0197Y0000R000S3
|
||||
317GND U3 -57 D0079PA00X+048942Y-040919X0197Y0000R000S3
|
||||
327D-(U2-A1-PAD1) U2 -1 A01X+046877Y-044220X0571Y0118R000S2
|
||||
327D-(U2-A0-PAD2) U2 -2 A01X+046877Y-044417X0571Y0118R000S2
|
||||
327~{ALERT}-PAD3) U2 -3 A01X+046877Y-044614X0571Y0118R000S2
|
||||
327SDA U2 -4 A01X+046877Y-044811X0571Y0118R000S2
|
||||
327SCL U2 -5 A01X+046877Y-045008X0571Y0118R000S2
|
||||
327+3.3V U2 -6 A01X+048609Y-045008X0571Y0118R000S2
|
||||
327GND U2 -7 A01X+048609Y-044811X0571Y0118R000S2
|
||||
327POWER_RAIL_IN U2 -8 A01X+048609Y-044614X0571Y0118R000S2
|
||||
327POWER_RAIL_OUT U2 -9 A01X+048609Y-044417X0571Y0118R000S2
|
||||
327POWER_RAIL_IN U2 -10 A01X+048609Y-044220X0571Y0118R000S2
|
||||
327GND U1 -1 A01X+046983Y-035882X0787Y0591R000S2
|
||||
327+3.3V U1 -2 A01X+046983Y-036787X0787Y0591R000S2
|
||||
327+3.3V U1 -2 A01X+049464Y-036787X0787Y1496R000S2
|
||||
327+5V U1 -3 A01X+046983Y-037693X0787Y0591R000S2
|
||||
327ET-(U3-GPIO18) TP10 -1 A01X+043500Y-041750X0787Y0000R000S2
|
||||
327ET-(U3-GPIO17) TP9 -1 A01X+043500Y-040156X0787Y0000R000S2
|
||||
327ET-(U3-GPIO14) TP8 -1 A01X+043500Y-038561X0787Y0000R000S2
|
||||
327NET-(U3-GPIO7) TP7 -1 A01X+043500Y-036967X0787Y0000R000S2
|
||||
327NET-(U3-GPIO6) TP6 -1 A01X+043500Y-035372X0787Y0000R000S2
|
||||
327RX TP5 -1 A01X+041906Y-041750X0787Y0000R000S2
|
||||
327TX TP4 -1 A01X+041906Y-040156X0787Y0000R000S2
|
||||
327+3.3V TP3 -1 A01X+041906Y-038561X0787Y0000R000S2
|
||||
327+5V TP2 -1 A01X+041906Y-036967X0787Y0000R000S2
|
||||
327ET-(U3-LNA_IN) TP1 -1 A01X+044250Y-033000X0787Y0000R000S2
|
||||
327GND SW1 -1 A01X+033675Y-037114X0630Y0551R180S2
|
||||
327GND SW1 -1 A01X+036825Y-037114X0630Y0551R180S2
|
||||
327NET-(U3-GPIO0) SW1 -2 A01X+033675Y-038886X0630Y0551R180S2
|
||||
327NET-(U3-GPIO0) SW1 -2 A01X+036825Y-038886X0630Y0551R180S2
|
||||
327T-(U3-CHIP_PU) R15 -1 A01X+066781Y-043250X0404Y0551R000S2
|
||||
327+3.3V R15 -2 A01X+067500Y-043250X0404Y0551R000S2
|
||||
327NET-(U3-GPIO0) R14 -1 A01X+066781Y-042089X0404Y0551R000S2
|
||||
327+3.3V R14 -2 A01X+067500Y-042089X0404Y0551R000S2
|
||||
327-(J1-D+-PADA6) R13 -1 A01X+066781Y-040927X0404Y0551R000S2
|
||||
327DP R13 -2 A01X+067500Y-040927X0404Y0551R000S2
|
||||
327-(J1-D--PADA7) R12 -1 A01X+066781Y-039766X0404Y0551R000S2
|
||||
327DM R12 -2 A01X+067500Y-039766X0404Y0551R000S2
|
||||
327NET-(J1-CC2) R11 -1 A01X+065045Y-044411X0404Y0551R000S2
|
||||
327GND R11 -2 A01X+065764Y-044411X0404Y0551R000S2
|
||||
327NET-(J1-CC1) R10 -1 A01X+065045Y-043250X0404Y0551R000S2
|
||||
327GND R10 -2 A01X+065764Y-043250X0404Y0551R000S2
|
||||
327POWER_RAIL_IN R9 -1 A01X+046833Y-042880X0482Y1043R000S2
|
||||
327POWER_RAIL_OUT R9 -2 A01X+048654Y-042880X0482Y1043R000S2
|
||||
327RX R8 -1 A01X+065045Y-042089X0404Y0551R000S2
|
||||
327+3.3V R8 -2 A01X+065764Y-042089X0404Y0551R000S2
|
||||
327TX R7 -1 A01X+065045Y-040927X0404Y0551R000S2
|
||||
327+3.3V R7 -2 A01X+065764Y-040927X0404Y0551R000S2
|
||||
327RGB R6 -1 A01X+065045Y-039766X0404Y0551R000S2
|
||||
327NET-(D1-DIN) R6 -2 A01X+065764Y-039766X0404Y0551R000S2
|
||||
327NET-(R5-PAD1) R5 -1 A01X+063309Y-044411X0404Y0551R000S2
|
||||
327EN4 R5 -2 A01X+064028Y-044411X0404Y0551R000S2
|
||||
327NET-(R4-PAD1) R4 -1 A01X+063309Y-043250X0404Y0551R000S2
|
||||
327EN3 R4 -2 A01X+064028Y-043250X0404Y0551R000S2
|
||||
327NET-(R3-PAD1) R3 -1 A01X+063309Y-042089X0404Y0551R000S2
|
||||
327EN2 R3 -2 A01X+064028Y-042089X0404Y0551R000S2
|
||||
327NET-(R2-PAD1) R2 -1 A01X+063309Y-040927X0404Y0551R000S2
|
||||
327EN1 R2 -2 A01X+064028Y-040927X0404Y0551R000S2
|
||||
327NET-(R1-PAD1) R1 -1 A01X+055000Y-021250X0404Y0551R000S2
|
||||
327EN0 R1 -2 A01X+055719Y-021250X0404Y0551R000S2
|
||||
317NET-(D6-A) J13 -1 D0394PA00X+047760Y-032008X0669Y0669R000S0
|
||||
317GND J13 -2 D0394PA00X+047760Y-033008X0669Y0000R000S0
|
||||
317POWER_RAIL_IN J12 -1 D0630PA00X+071000Y-038500X0787Y1024R270S0
|
||||
317GND J12 -2 D0630PA00X+071000Y-037122X0787Y1024R270S0
|
||||
317POWER_RAIL_OUT J12 -3 D0630PA00X+071000Y-035744X0787Y1024R270S0
|
||||
317EN4.0 J11 -1 D0394PA00X+042395Y-022106X0669Y0669R180S0
|
||||
317EN4.1 J11 -2 D0394PA00X+042395Y-021106X0669Y0000R180S0
|
||||
317EN3.0 J10 -1 D0394PA00X+042408Y-024711X0669Y0669R180S0
|
||||
317EN3.1 J10 -2 D0394PA00X+042408Y-023711X0669Y0000R180S0
|
||||
317EN2.0 J9 -1 D0394PA00X+042408Y-027211X0669Y0669R180S0
|
||||
317EN2.1 J9 -2 D0394PA00X+042408Y-026211X0669Y0000R180S0
|
||||
317EN1.0 J8 -1 D0394PA00X+042399Y-029703X0669Y0669R180S0
|
||||
317EN1.1 J8 -2 D0394PA00X+042399Y-028703X0669Y0000R180S0
|
||||
317EN0.0 J7 -1 D0394PA00X+042395Y-018992X0669Y0669R180S0
|
||||
317EN0.1 J7 -2 D0394PA00X+042395Y-017992X0669Y0000R180S0
|
||||
317GND J6 -1 D0394PA00X+070250Y-022750X0669Y0669R000S0
|
||||
317TX0 J6 -2 D0394PA00X+070250Y-023750X0669Y0000R000S0
|
||||
317RX0 J6 -3 D0394PA00X+070250Y-024750X0669Y0000R000S0
|
||||
317GND J5 -1 D0394PA00X+070250Y-027000X0669Y0669R000S0
|
||||
317TX1 J5 -2 D0394PA00X+070250Y-028000X0669Y0000R000S0
|
||||
317RX1 J5 -3 D0394PA00X+070250Y-029000X0669Y0000R000S0
|
||||
317GND J4 -1 D0394PA00X+072250Y-031250X0669Y0669R000S0
|
||||
317TX2 J4 -2 D0394PA00X+072250Y-032250X0669Y0000R000S0
|
||||
317RX2 J4 -3 D0394PA00X+072250Y-033250X0669Y0000R000S0
|
||||
317GND J3 -1 D0394PA00X+072250Y-027000X0669Y0669R000S0
|
||||
317TX3 J3 -2 D0394PA00X+072250Y-028000X0669Y0000R000S0
|
||||
317RX3 J3 -3 D0394PA00X+072250Y-029000X0669Y0000R000S0
|
||||
317GND J2 -1 D0394PA00X+072250Y-022750X0669Y0669R000S0
|
||||
317TX4 J2 -2 D0394PA00X+072250Y-023750X0669Y0000R000S0
|
||||
317RX4 J2 -3 D0394PA00X+072250Y-024750X0669Y0000R000S0
|
||||
367N/C J1 D0256UA00X+041724Y-045000X0256Y0000R000S0
|
||||
367N/C J1 D0256UA00X+044000Y-045000X0256Y0000R000S0
|
||||
327GND J1 -A1 A01X+041602Y-044577X0236Y0453R000S2
|
||||
327+5V J1 -A4 A01X+041917Y-044577X0236Y0453R000S2
|
||||
327NET-(J1-CC1) J1 -A5 A01X+042370Y-044577X0118Y0453R000S2
|
||||
327-(J1-D+-PADA6) J1 -A6 A01X+042764Y-044577X0118Y0453R000S2
|
||||
327-(J1-D--PADA7) J1 -A7 A01X+042961Y-044577X0118Y0453R000S2
|
||||
327J1-SBU1-PADA8) J1 -A8 A01X+043354Y-044577X0118Y0453R000S2
|
||||
327+5V J1 -A9 A01X+043807Y-044577X0236Y0453R000S2
|
||||
327GND J1 -A12 A01X+044122Y-044577X0236Y0453R000S2
|
||||
327GND J1 -B1 A01X+044122Y-044577X0236Y0453R000S2
|
||||
327+5V J1 -B4 A01X+043807Y-044577X0236Y0453R000S2
|
||||
327NET-(J1-CC2) J1 -B5 A01X+043551Y-044577X0118Y0453R000S2
|
||||
327-(J1-D+-PADA6) J1 -B6 A01X+043157Y-044577X0118Y0453R000S2
|
||||
327-(J1-D--PADA7) J1 -B7 A01X+042567Y-044577X0118Y0453R000S2
|
||||
327J1-SBU2-PADB8) J1 -B8 A01X+042173Y-044577X0118Y0453R000S2
|
||||
327+5V J1 -B9 A01X+041917Y-044577X0236Y0453R000S2
|
||||
327GND J1 -B12 A01X+041602Y-044577X0236Y0453R000S2
|
||||
327GND J1 -S1 A01X+040850Y-044803X0858Y0787R000S2
|
||||
327GND J1 -S1 A01X+040850Y-046350X0858Y0787R000S2
|
||||
327GND J1 -S1 A01X+044874Y-044803X0858Y0787R000S2
|
||||
327GND J1 -S1 A01X+044874Y-046350X0858Y0787R000S2
|
||||
317GND H4 -1 D1063PA00X+051897Y-044671X2126Y0000R000S0
|
||||
317GND H3 -1 D1063PA00X+051897Y-041935X2126Y0000R000S0
|
||||
317GND H2 -1 D1063PA00X+051897Y-039199X2126Y0000R000S0
|
||||
317GND H1 -1 D1063PA00X+051897Y-036463X2126Y0000R000S0
|
||||
327N/C FID3 A01X+075500Y-037250X0591Y0000R000S2
|
||||
327N/C FID2 A01X+042000Y-015500X0591Y0000R000S2
|
||||
327N/C FID1 A01X+071750Y-015500X0591Y0000R000S2
|
||||
327+5V D6 -1 A01X+051010Y-031518X0354Y0472R000S2
|
||||
327NET-(D6-A) D6 -2 A01X+052309Y-031518X0354Y0472R000S2
|
||||
327+3.3V D5 -1 A01X+033035Y-033620X0591Y0394R000S2
|
||||
327(D5-DOUT-PAD2) D5 -2 A01X+033035Y-034250X0591Y0394R000S2
|
||||
327GND D5 -3 A01X+033035Y-034880X0591Y0394R000S2
|
||||
327NET-(D4-DOUT) D5 -4 A01X+034965Y-034880X0591Y0394R000S2
|
||||
327N/C D5 -5 A01X+034965Y-034250X0591Y0394R000S2
|
||||
327N/C D5 -6 A01X+034965Y-033620X0591Y0394R000S2
|
||||
327+3.3V D4 -1 A01X+033035Y-029870X0591Y0394R000S2
|
||||
327NET-(D4-DOUT) D4 -2 A01X+033035Y-030500X0591Y0394R000S2
|
||||
327GND D4 -3 A01X+033035Y-031130X0591Y0394R000S2
|
||||
327NET-(D3-DOUT) D4 -4 A01X+034965Y-031130X0591Y0394R000S2
|
||||
327N/C D4 -5 A01X+034965Y-030500X0591Y0394R000S2
|
||||
327N/C D4 -6 A01X+034965Y-029870X0591Y0394R000S2
|
||||
327+3.3V D3 -1 A01X+033035Y-026370X0591Y0394R000S2
|
||||
327NET-(D3-DOUT) D3 -2 A01X+033035Y-027000X0591Y0394R000S2
|
||||
327GND D3 -3 A01X+033035Y-027630X0591Y0394R000S2
|
||||
327NET-(D2-DOUT) D3 -4 A01X+034965Y-027630X0591Y0394R000S2
|
||||
327N/C D3 -5 A01X+034965Y-027000X0591Y0394R000S2
|
||||
327N/C D3 -6 A01X+034965Y-026370X0591Y0394R000S2
|
||||
327+3.3V D2 -1 A01X+033000Y-022740X0591Y0394R000S2
|
||||
327NET-(D2-DOUT) D2 -2 A01X+033000Y-023370X0591Y0394R000S2
|
||||
327GND D2 -3 A01X+033000Y-024000X0591Y0394R000S2
|
||||
327NET-(D1-DOUT) D2 -4 A01X+034929Y-024000X0591Y0394R000S2
|
||||
327N/C D2 -5 A01X+034929Y-023370X0591Y0394R000S2
|
||||
327N/C D2 -6 A01X+034929Y-022740X0591Y0394R000S2
|
||||
327+3.3V D1 -1 A01X+033000Y-019000X0591Y0394R000S2
|
||||
327NET-(D1-DOUT) D1 -2 A01X+033000Y-019630X0591Y0394R000S2
|
||||
327GND D1 -3 A01X+033000Y-020260X0591Y0394R000S2
|
||||
327NET-(D1-DIN) D1 -4 A01X+034929Y-020260X0591Y0394R000S2
|
||||
327N/C D1 -5 A01X+034929Y-019630X0591Y0394R000S2
|
||||
327N/C D1 -6 A01X+034929Y-019000X0591Y0394R000S2
|
||||
327+5V C20 -1 A01X+054363Y-015502X0394Y0571R000S2
|
||||
327GND C20 -2 A01X+055111Y-015502X0394Y0571R000S2
|
||||
327+5V C19 -1 A01X+062672Y-032833X0394Y0571R000S2
|
||||
327GND C19 -2 A01X+063420Y-032833X0394Y0571R000S2
|
||||
327+3.3V C18 -1 A01X+062672Y-031648X0394Y0571R000S2
|
||||
327GND C18 -2 A01X+063420Y-031648X0394Y0571R000S2
|
||||
327+3.3V C17 -1 A01X+062672Y-030463X0394Y0571R000S2
|
||||
327GND C17 -2 A01X+063420Y-030463X0394Y0571R000S2
|
||||
327+3.3V C16 -1 A01X+062672Y-029278X0394Y0571R000S2
|
||||
327GND C16 -2 A01X+063420Y-029278X0394Y0571R000S2
|
||||
327+3.3V C15 -1 A01X+060920Y-034018X0394Y0571R000S2
|
||||
327GND C15 -2 A01X+061668Y-034018X0394Y0571R000S2
|
||||
327+3.3V C14 -1 A01X+060920Y-032833X0394Y0571R000S2
|
||||
327GND C14 -2 A01X+061668Y-032833X0394Y0571R000S2
|
||||
327+3.3V C13 -1 A01X+060920Y-031648X0394Y0571R000S2
|
||||
327GND C13 -2 A01X+061668Y-031648X0394Y0571R000S2
|
||||
327+3.3V C12 -1 A01X+060920Y-030463X0394Y0571R000S2
|
||||
327GND C12 -2 A01X+061668Y-030463X0394Y0571R000S2
|
||||
327ET-(U3-XTAL_N) C11 -1 A01X+060920Y-029278X0394Y0571R000S2
|
||||
327GND C11 -2 A01X+061668Y-029278X0394Y0571R000S2
|
||||
327ET-(U3-XTAL_P) C10 -1 A01X+059168Y-034018X0394Y0571R000S2
|
||||
327GND C10 -2 A01X+059916Y-034018X0394Y0571R000S2
|
||||
327+3.3V C9 -1 A01X+059168Y-032833X0394Y0571R000S2
|
||||
327GND C9 -2 A01X+059916Y-032833X0394Y0571R000S2
|
||||
327+3.3V C8 -1 A01X+059168Y-031648X0394Y0571R000S2
|
||||
327GND C8 -2 A01X+059916Y-031648X0394Y0571R000S2
|
||||
327+3.3V C7 -1 A01X+059168Y-030463X0394Y0571R000S2
|
||||
327GND C7 -2 A01X+059916Y-030463X0394Y0571R000S2
|
||||
327+3.3V C6 -1 A01X+059168Y-029278X0394Y0571R000S2
|
||||
327GND C6 -2 A01X+059916Y-029278X0394Y0571R000S2
|
||||
327+3.3V C5 -1 A01X+057416Y-034018X0394Y0571R000S2
|
||||
327GND C5 -2 A01X+058164Y-034018X0394Y0571R000S2
|
||||
327+3.3V C4 -1 A01X+054500Y-032250X0394Y0571R000S2
|
||||
327GND C4 -2 A01X+055248Y-032250X0394Y0571R000S2
|
||||
327+3.3V C3 -1 A01X+057416Y-031648X0394Y0571R000S2
|
||||
327GND C3 -2 A01X+058164Y-031648X0394Y0571R000S2
|
||||
327+3.3V C2 -1 A01X+057416Y-030463X0394Y0571R000S2
|
||||
327GND C2 -2 A01X+058164Y-030463X0394Y0571R000S2
|
||||
327+3.3V C1 -1 A01X+057416Y-029278X0394Y0571R000S2
|
||||
327GND C1 -2 A01X+058164Y-029278X0394Y0571R000S2
|
||||
999
|
||||
BIN
kicad/watch-watchkicad_pro/production/watch-watchkicad_pro.zip
Normal file
BIN
kicad/watch-watchkicad_pro/production/watch-watchkicad_pro.zip
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -2,12 +2,213 @@
|
||||
"board": {
|
||||
"3dviewports": [],
|
||||
"design_settings": {
|
||||
"defaults": {},
|
||||
"defaults": {
|
||||
"apply_defaults_to_fp_fields": false,
|
||||
"apply_defaults_to_fp_shapes": false,
|
||||
"apply_defaults_to_fp_text": false,
|
||||
"board_outline_line_width": 0.05,
|
||||
"copper_line_width": 0.2,
|
||||
"copper_text_italic": false,
|
||||
"copper_text_size_h": 1.5,
|
||||
"copper_text_size_v": 1.5,
|
||||
"copper_text_thickness": 0.3,
|
||||
"copper_text_upright": false,
|
||||
"courtyard_line_width": 0.05,
|
||||
"dimension_precision": 4,
|
||||
"dimension_units": 3,
|
||||
"dimensions": {
|
||||
"arrow_length": 1270000,
|
||||
"extension_offset": 500000,
|
||||
"keep_text_aligned": true,
|
||||
"suppress_zeroes": true,
|
||||
"text_position": 0,
|
||||
"units_format": 0
|
||||
},
|
||||
"fab_line_width": 0.1,
|
||||
"fab_text_italic": false,
|
||||
"fab_text_size_h": 1.0,
|
||||
"fab_text_size_v": 1.0,
|
||||
"fab_text_thickness": 0.15,
|
||||
"fab_text_upright": false,
|
||||
"other_line_width": 0.1,
|
||||
"other_text_italic": false,
|
||||
"other_text_size_h": 1.0,
|
||||
"other_text_size_v": 1.0,
|
||||
"other_text_thickness": 0.15,
|
||||
"other_text_upright": false,
|
||||
"pads": {
|
||||
"drill": 0.8,
|
||||
"height": 1.27,
|
||||
"width": 2.54
|
||||
},
|
||||
"silk_line_width": 0.1,
|
||||
"silk_text_italic": false,
|
||||
"silk_text_size_h": 1.0,
|
||||
"silk_text_size_v": 1.0,
|
||||
"silk_text_thickness": 0.1,
|
||||
"silk_text_upright": false,
|
||||
"zones": {
|
||||
"min_clearance": 0.5
|
||||
}
|
||||
},
|
||||
"diff_pair_dimensions": [],
|
||||
"drc_exclusions": [],
|
||||
"rules": {},
|
||||
"meta": {
|
||||
"version": 2
|
||||
},
|
||||
"rule_severities": {
|
||||
"annular_width": "error",
|
||||
"clearance": "error",
|
||||
"connection_width": "warning",
|
||||
"copper_edge_clearance": "error",
|
||||
"copper_sliver": "warning",
|
||||
"courtyards_overlap": "error",
|
||||
"creepage": "error",
|
||||
"diff_pair_gap_out_of_range": "error",
|
||||
"diff_pair_uncoupled_length_too_long": "error",
|
||||
"drill_out_of_range": "error",
|
||||
"duplicate_footprints": "warning",
|
||||
"extra_footprint": "warning",
|
||||
"footprint": "error",
|
||||
"footprint_filters_mismatch": "ignore",
|
||||
"footprint_symbol_mismatch": "warning",
|
||||
"footprint_type_mismatch": "ignore",
|
||||
"hole_clearance": "error",
|
||||
"hole_to_hole": "warning",
|
||||
"holes_co_located": "warning",
|
||||
"invalid_outline": "error",
|
||||
"isolated_copper": "warning",
|
||||
"item_on_disabled_layer": "error",
|
||||
"items_not_allowed": "error",
|
||||
"length_out_of_range": "error",
|
||||
"lib_footprint_issues": "warning",
|
||||
"lib_footprint_mismatch": "warning",
|
||||
"malformed_courtyard": "error",
|
||||
"microvia_drill_out_of_range": "error",
|
||||
"mirrored_text_on_front_layer": "warning",
|
||||
"missing_courtyard": "ignore",
|
||||
"missing_footprint": "warning",
|
||||
"net_conflict": "warning",
|
||||
"nonmirrored_text_on_back_layer": "warning",
|
||||
"npth_inside_courtyard": "ignore",
|
||||
"padstack": "warning",
|
||||
"pth_inside_courtyard": "ignore",
|
||||
"shorting_items": "error",
|
||||
"silk_edge_clearance": "warning",
|
||||
"silk_over_copper": "warning",
|
||||
"silk_overlap": "warning",
|
||||
"skew_out_of_range": "error",
|
||||
"solder_mask_bridge": "error",
|
||||
"starved_thermal": "error",
|
||||
"text_height": "warning",
|
||||
"text_on_edge_cuts": "error",
|
||||
"text_thickness": "warning",
|
||||
"through_hole_pad_without_hole": "error",
|
||||
"too_many_vias": "error",
|
||||
"track_angle": "error",
|
||||
"track_dangling": "warning",
|
||||
"track_segment_length": "error",
|
||||
"track_width": "error",
|
||||
"tracks_crossing": "error",
|
||||
"unconnected_items": "error",
|
||||
"unresolved_variable": "error",
|
||||
"via_dangling": "warning",
|
||||
"zones_intersect": "error"
|
||||
},
|
||||
"rules": {
|
||||
"max_error": 0.005,
|
||||
"min_clearance": 0.0,
|
||||
"min_connection": 0.0,
|
||||
"min_copper_edge_clearance": 0.5,
|
||||
"min_groove_width": 0.0,
|
||||
"min_hole_clearance": 0.25,
|
||||
"min_hole_to_hole": 0.25,
|
||||
"min_microvia_diameter": 0.2,
|
||||
"min_microvia_drill": 0.1,
|
||||
"min_resolved_spokes": 2,
|
||||
"min_silk_clearance": 0.0,
|
||||
"min_text_height": 0.8,
|
||||
"min_text_thickness": 0.08,
|
||||
"min_through_hole_diameter": 0.3,
|
||||
"min_track_width": 0.0,
|
||||
"min_via_annular_width": 0.1,
|
||||
"min_via_diameter": 0.5,
|
||||
"solder_mask_to_copper_clearance": 0.005,
|
||||
"use_height_for_length_calcs": true
|
||||
},
|
||||
"teardrop_options": [
|
||||
{
|
||||
"td_onpthpad": true,
|
||||
"td_onroundshapesonly": false,
|
||||
"td_onsmdpad": true,
|
||||
"td_ontrackend": false,
|
||||
"td_onvia": true
|
||||
}
|
||||
],
|
||||
"teardrop_parameters": [
|
||||
{
|
||||
"td_allow_use_two_tracks": true,
|
||||
"td_curve_segcount": 0,
|
||||
"td_height_ratio": 1.0,
|
||||
"td_length_ratio": 0.5,
|
||||
"td_maxheight": 2.0,
|
||||
"td_maxlen": 1.0,
|
||||
"td_on_pad_in_zone": false,
|
||||
"td_target_name": "td_round_shape",
|
||||
"td_width_to_size_filter_ratio": 0.9
|
||||
},
|
||||
{
|
||||
"td_allow_use_two_tracks": true,
|
||||
"td_curve_segcount": 0,
|
||||
"td_height_ratio": 1.0,
|
||||
"td_length_ratio": 0.5,
|
||||
"td_maxheight": 2.0,
|
||||
"td_maxlen": 1.0,
|
||||
"td_on_pad_in_zone": false,
|
||||
"td_target_name": "td_rect_shape",
|
||||
"td_width_to_size_filter_ratio": 0.9
|
||||
},
|
||||
{
|
||||
"td_allow_use_two_tracks": true,
|
||||
"td_curve_segcount": 0,
|
||||
"td_height_ratio": 1.0,
|
||||
"td_length_ratio": 0.5,
|
||||
"td_maxheight": 2.0,
|
||||
"td_maxlen": 1.0,
|
||||
"td_on_pad_in_zone": false,
|
||||
"td_target_name": "td_track_end",
|
||||
"td_width_to_size_filter_ratio": 0.9
|
||||
}
|
||||
],
|
||||
"track_widths": [],
|
||||
"via_dimensions": []
|
||||
"tuning_pattern_settings": {
|
||||
"diff_pair_defaults": {
|
||||
"corner_radius_percentage": 80,
|
||||
"corner_style": 1,
|
||||
"max_amplitude": 1.0,
|
||||
"min_amplitude": 0.2,
|
||||
"single_sided": false,
|
||||
"spacing": 1.0
|
||||
},
|
||||
"diff_pair_skew_defaults": {
|
||||
"corner_radius_percentage": 80,
|
||||
"corner_style": 1,
|
||||
"max_amplitude": 1.0,
|
||||
"min_amplitude": 0.2,
|
||||
"single_sided": false,
|
||||
"spacing": 0.6
|
||||
},
|
||||
"single_track_defaults": {
|
||||
"corner_radius_percentage": 80,
|
||||
"corner_style": 1,
|
||||
"max_amplitude": 1.0,
|
||||
"min_amplitude": 0.2,
|
||||
"single_sided": false,
|
||||
"spacing": 0.6
|
||||
}
|
||||
},
|
||||
"via_dimensions": [],
|
||||
"zones_allow_external_fillets": false
|
||||
},
|
||||
"ipc2581": {
|
||||
"dist": "",
|
||||
@@ -239,6 +440,7 @@
|
||||
"single_global_label": "ignore",
|
||||
"unannotated": "error",
|
||||
"unconnected_wire_endpoint": "warning",
|
||||
"undefined_netclass": "error",
|
||||
"unit_value_mismatch": "error",
|
||||
"unresolved_variable": "error",
|
||||
"wire_dangling": "error"
|
||||
@@ -358,14 +560,50 @@
|
||||
"label": "Datasheet",
|
||||
"name": "Datasheet",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": false,
|
||||
"label": "постачальник",
|
||||
"name": "постачальник",
|
||||
"show": false
|
||||
},
|
||||
{
|
||||
"group_by": false,
|
||||
"label": "Постачальник",
|
||||
"name": "Постачальник",
|
||||
"show": false
|
||||
},
|
||||
{
|
||||
"group_by": false,
|
||||
"label": "Опис",
|
||||
"name": "Description",
|
||||
"show": false
|
||||
},
|
||||
{
|
||||
"group_by": false,
|
||||
"label": "#",
|
||||
"name": "${ITEM_NUMBER}",
|
||||
"show": false
|
||||
},
|
||||
{
|
||||
"group_by": false,
|
||||
"label": "Sim.Pins",
|
||||
"name": "Sim.Pins",
|
||||
"show": false
|
||||
},
|
||||
{
|
||||
"group_by": false,
|
||||
"label": "Sim.Device",
|
||||
"name": "Sim.Device",
|
||||
"show": false
|
||||
}
|
||||
],
|
||||
"filter_string": "",
|
||||
"group_symbols": true,
|
||||
"include_excluded_from_bom": true,
|
||||
"name": "Default Editing",
|
||||
"name": "",
|
||||
"sort_asc": true,
|
||||
"sort_field": "Налаштування"
|
||||
"sort_field": "Reference"
|
||||
},
|
||||
"connection_grid_size": 50.0,
|
||||
"drawing": {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,10 +29,10 @@
|
||||
#define CONFIG_WATCH_INA226_I2C_FREQ_HZ 400000
|
||||
#endif
|
||||
#ifndef CONFIG_WATCH_INA226_CURRENT_LSB_uA
|
||||
#define CONFIG_WATCH_INA226_CURRENT_LSB_uA 100
|
||||
#define CONFIG_WATCH_INA226_CURRENT_LSB_uA 50
|
||||
#endif
|
||||
#ifndef CONFIG_WATCH_INA226_SHUNT_MILLIOHM
|
||||
#define CONFIG_WATCH_INA226_SHUNT_MILLIOHM 10
|
||||
#define CONFIG_WATCH_INA226_SHUNT_MILLIOHM 100
|
||||
#endif
|
||||
#ifndef CONFIG_WATCH_INA226_ADDR
|
||||
#define CONFIG_WATCH_INA226_ADDR 0x40
|
||||
@@ -51,7 +51,7 @@
|
||||
#if CONFIG_WATCH_INA226_ENABLED
|
||||
static const char *TAG = "ina226";
|
||||
static bool s_initialized;
|
||||
static float s_current_lsb_ma;
|
||||
static float s_current_lsb_a;
|
||||
static uint8_t s_address = CONFIG_WATCH_INA226_ADDR;
|
||||
static ina226_reading_t s_last_reading;
|
||||
#endif
|
||||
@@ -84,7 +84,7 @@ esp_err_t ina226_monitor_init(void)
|
||||
double calibration = 0.00512 / (current_lsb_a * shunt_ohms);
|
||||
if (calibration > 0xFFFF) calibration = 0xFFFF;
|
||||
uint16_t calibration_value = (uint16_t)calibration;
|
||||
s_current_lsb_ma = (float)current_lsb_a * 1000.0f;
|
||||
s_current_lsb_a = (float)current_lsb_a;
|
||||
|
||||
const uint16_t config_value = INA226_CONFIG_AVG_16 |
|
||||
INA226_CONFIG_VBUS_1100US |
|
||||
@@ -159,13 +159,13 @@ esp_err_t ina226_monitor_sample(ina226_reading_t *out_reading)
|
||||
ESP_RETURN_ON_ERROR(ina226_read_register(INA226_REG_CURRENT, ¤t_raw), TAG, "current read failed");
|
||||
|
||||
float voltage_v = (float)bus_raw * 1.25f / 1000.0f;
|
||||
float current_ma = (int16_t)current_raw * s_current_lsb_ma;
|
||||
float power_mw = voltage_v * current_ma;
|
||||
float current_a = (int16_t)current_raw * s_current_lsb_a;
|
||||
float power_w = voltage_v * current_a;
|
||||
|
||||
s_last_reading = (ina226_reading_t){
|
||||
.voltage_v = voltage_v,
|
||||
.current_ma = current_ma,
|
||||
.power_mw = power_mw,
|
||||
.current_a = current_a,
|
||||
.power_w = power_w,
|
||||
};
|
||||
if (out_reading) {
|
||||
*out_reading = s_last_reading;
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
typedef struct {
|
||||
float voltage_v;
|
||||
float current_ma;
|
||||
float power_mw;
|
||||
float current_a;
|
||||
float power_w;
|
||||
} ina226_reading_t;
|
||||
|
||||
// Ініціалізує INA226: конфігурує I2C та калібрує вимірювач.
|
||||
|
||||
@@ -140,8 +140,8 @@ void app_main(void)
|
||||
|
||||
ina226_reading_t reading = {0};
|
||||
if (ina226_monitor_ready() && ina226_monitor_sample(&reading) == ESP_OK) {
|
||||
ESP_LOGI(TAG, "Живлення: %.2f В, %.1f мА, %.1f мВт",
|
||||
reading.voltage_v, reading.current_ma, reading.power_mw);
|
||||
ESP_LOGI(TAG, "Живлення: %.2f В, %.2f А, %.2f Вт",
|
||||
reading.voltage_v, reading.current_a, reading.power_w);
|
||||
}
|
||||
|
||||
if (uart_mux_ready()) {
|
||||
|
||||
@@ -181,8 +181,8 @@ static void usb_cli_handle_switch(const char *cmd, char *args)
|
||||
|
||||
static void usb_cli_print_measurement(size_t channel, const ina226_reading_t *reading)
|
||||
{
|
||||
usb_cli_printf("\r\nCH%u: %.2f В, %.1f мА, %.1f мВт",
|
||||
(unsigned)channel, reading->voltage_v, reading->current_ma, reading->power_mw);
|
||||
usb_cli_printf("\r\nCH%u: %.2f В, %.3f А, %.3f Вт",
|
||||
(unsigned)channel, reading->voltage_v, reading->current_a, reading->power_w);
|
||||
}
|
||||
|
||||
static void usb_cli_handle_sense(char *args)
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#define WS2812_ALERT_GAP_PERIOD pdMS_TO_TICKS(2000)
|
||||
#define WS2812_VPN_ALERT_BLINKS 2
|
||||
#define WS2812_APP_ALERT_BLINKS 3
|
||||
#define WS2812_BRIGHTNESS_PERCENT 5
|
||||
|
||||
#define WS2812_VPN_SECTION_TICKS (WS2812_ALERT_BLINK_PERIOD * 2U * WS2812_VPN_ALERT_BLINKS)
|
||||
#define WS2812_APP_SECTION_TICKS (WS2812_ALERT_BLINK_PERIOD * 2U * WS2812_APP_ALERT_BLINKS)
|
||||
@@ -54,6 +55,7 @@ static void ws2812_status_compute_color(size_t index,
|
||||
uint8_t *g,
|
||||
uint8_t *b);
|
||||
static bool ws2812_recalculate_alert_counts(void);
|
||||
static uint8_t ws2812_apply_brightness(uint8_t component);
|
||||
|
||||
static void ws2812_animation_timer_cb(TimerHandle_t timer)
|
||||
{
|
||||
@@ -176,7 +178,11 @@ static esp_err_t ws2812_status_apply(void)
|
||||
for (size_t i = 0; i < WS2812_STATUS_LED_COUNT && err == ESP_OK; ++i) {
|
||||
uint8_t r = 0, g = 0, b = 0;
|
||||
ws2812_status_compute_color(i, now_ticks, &r, &g, &b);
|
||||
err = led_strip_set_pixel(s_strip, i, g, r, b);
|
||||
err = led_strip_set_pixel(s_strip,
|
||||
i,
|
||||
ws2812_apply_brightness(g),
|
||||
ws2812_apply_brightness(r),
|
||||
ws2812_apply_brightness(b));
|
||||
}
|
||||
if (err == ESP_OK) {
|
||||
err = led_strip_refresh(s_strip);
|
||||
@@ -352,3 +358,10 @@ static bool ws2812_recalculate_alert_counts(void)
|
||||
s_active_app_alerts = app;
|
||||
return changed;
|
||||
}
|
||||
|
||||
static uint8_t ws2812_apply_brightness(uint8_t component)
|
||||
{
|
||||
// Scale brightness down (component * 20%) with rounding to nearest.
|
||||
const uint16_t scaled = (component * WS2812_BRIGHTNESS_PERCENT + 50U) / 100U;
|
||||
return (uint8_t)scaled;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user