feat(ds18b20-ds2480): добавь драйвер датчиков через UART-мост

This commit is contained in:
2026-09-15 16:57:33 +03:00
parent 20dbc2c721
commit 96ce6f8759
9 changed files with 783 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
#include "ds18b20_ds2480.h"
/* board_port supplies the four callbacks documented in ds2480.h.
* Blocking example: includes bridge reset, scan and 750 ms conversion.
*/
ds2480_status ds18b20_example_read_first(const ds2480_port *board_port, int16_t *raw)
{
ds2480 bus;
ds2480_search search = {{0}, 0, 0};
ds2480_status status;
if (!raw) return DS2480_ARGUMENT;
status = ds2480_init(&bus, board_port, 20);
if (status != DS2480_OK) return status;
status = ds18b20_ds2480_next(&bus, &search);
if (status != DS2480_OK) return status;
status = ds18b20_ds2480_convert(&bus, search.rom);
if (status != DS2480_OK) return status;
return ds18b20_ds2480_temperature(&bus, search.rom, raw);
}