Started on DS18B20 and PMS5003
Didn't realise DS18B20 was 1-Wire Will probably just find a library for that one - can't be arsed doing more bit banging
This commit is contained in:
@@ -5,11 +5,11 @@ menu "DS18B20"
|
||||
|
||||
config DS18B20_GPIO_PIN
|
||||
int "GPIO Pin used for 1-Wire DS18B20"
|
||||
default 10
|
||||
default 15
|
||||
depends on DS18B20_ENABLED
|
||||
|
||||
config DS18B20_PERIOD_POLL
|
||||
int "Period to poll the DS18B20 in seconds"
|
||||
default 8000
|
||||
default 8
|
||||
depends on DS18B20_ENABLED
|
||||
endmenu
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
int test() {
|
||||
int i = 5;
|
||||
return i;
|
||||
#include "ds18b20.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#ifdef CONFIG_DS18B20_ENABLED
|
||||
|
||||
int ds18b20_read(void) {
|
||||
esp_err_t ret = gpio_set_pull_mode(CONFIG_DS18B20_GPIO_PIN, GPIO_PULLUP_ONLY);
|
||||
return DS18B20_OK;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_DS18B20_ENABLED */
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
int ds18b20_read(void);
|
||||
|
||||
typedef enum {
|
||||
DS18B20_OK,
|
||||
} ds18b20_error;
|
||||
|
||||
Reference in New Issue
Block a user