Tasmota/lib/libesp32/Berry/default/be_onewire_lib.c

58 lines
1.5 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/********************************************************************
* Tasmota lib
*
* To use: `import wire`
*
* 2 wire communication - I2C
*******************************************************************/
#include "be_constobj.h"
#if defined(USE_ONEWIRE) || defined(USE_DS18x20)
extern int b_onewire_init(bvm *vm);
extern int b_onewire_deinit(bvm *vm);
extern int b_onewire_reset(bvm *vm);
extern int b_onewire_select(bvm *vm);
extern int b_onewire_skip(bvm *vm);
extern int b_onewire_depower(bvm *vm);
extern int b_onewire_write(bvm *vm);
extern int b_onewire_read(bvm *vm);
extern int b_onewire_reset_search(bvm *vm);
extern int b_onewire_target_search(bvm *vm);
extern int b_onewire_search(bvm *vm);
#include "../generate/be_fixed_be_class_tasmota_onewire.h"
void be_load_onewirelib(bvm *vm) {
be_pushntvclass(vm, &be_class_tasmota_onewire);
be_setglobal(vm, "OneWire");
be_pop(vm, 1);
}
/* @const_object_info_begin
class be_class_tasmota_onewire (scope: global, name: OneWire) {
.p, var
init, func(b_onewire_init)
deinit, func(b_onewire_deinit)
reset, func(b_onewire_reset)
select, func(b_onewire_select)
skip, func(b_onewire_skip)
depower, func(b_onewire_depower)
write, func(b_onewire_write)
read, func(b_onewire_read)
reset_search, func(b_onewire_reset_search)
target_search, func(b_onewire_target_search)
search, func(b_onewire_search)
}
@const_object_info_end */
#endif // defined(USE_ONEWIRE) || defined(USE_DS18x20)