Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/azholtikov/zh_onewire
ESP32 ESP-IDF and ESP8266 RTOS SDK component for 1-Wire interface.
https://github.com/azholtikov/zh_onewire
component esp-idf esp32 esp8266 onewire rtos-sdk
Last synced: about 23 hours ago
JSON representation
ESP32 ESP-IDF and ESP8266 RTOS SDK component for 1-Wire interface.
- Host: GitHub
- URL: https://github.com/azholtikov/zh_onewire
- Owner: aZholtikov
- License: apache-2.0
- Created: 2024-03-08T07:24:13.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-07-24T11:47:58.000Z (4 months ago)
- Last Synced: 2024-07-24T13:34:21.546Z (4 months ago)
- Topics: component, esp-idf, esp32, esp8266, onewire, rtos-sdk
- Language: C
- Homepage:
- Size: 9.77 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ESP32 ESP-IDF and ESP8266 RTOS SDK component for 1-Wire interface
## Tested on
1. ESP8266 RTOS_SDK v3.4
2. ESP32 ESP-IDF v5.2## Using
In an existing project, run the following command to install the component:
```text
cd ../your_project/components
git clone https://github.com/aZholtikov/zh_onewire.git
```In the application, add the component:
```c
#include "zh_onewire.h"
```## Example
Search 1-Wire devices on bus:
```c
#include "zh_onewire.h"void app_main(void)
{
esp_log_level_set("zh_onewire", ESP_LOG_NONE);
uint8_t *rom = NULL;
zh_onewire_init(GPIO_NUM_5);
if (zh_onewire_reset() != ESP_OK)
{
printf("There are no 1-Wire devices available on the bus.\n");
}
else
{
zh_onewire_search_rom_init();
for (;;)
{
rom = zh_onewire_search_rom_next();
if (rom == NULL)
{
break;
}
printf("Found device ROM: ");
for (uint8_t i = 0; i < 8; ++i)
{
printf("%X ", *(rom++));
}
rom -= 8;
printf("\n");
}
}
}
```Any [feedback](mailto:[email protected]) will be gladly accepted.