LibDriver DS18B20
Loading...
Searching...
No Matches
driver_ds18b20_search.c
Go to the documentation of this file.
1
37
39
40static ds18b20_handle_t gs_handle;
41
50{
51 uint8_t res;
52
53 /* link interface function */
64
65 /* ds18b20 init */
66 res = ds18b20_init(&gs_handle);
67 if (res != 0)
68 {
69 ds18b20_interface_debug_print("ds18b20: init failed.\n");
70
71 return 1;
72 }
73
74 return 0;
75}
76
86uint8_t ds18b20_search(uint8_t (*rom)[8], uint8_t *num)
87{
88 /* search rom*/
89 if (ds18b20_search_rom(&gs_handle, rom, num) != 0)
90 {
91 return 1;
92 }
93 else
94 {
95 return 0;
96 }
97}
98
107{
108 /* ds18b20 close */
109 if (ds18b20_deinit(&gs_handle) != 0)
110 {
111 return 1;
112 }
113 else
114 {
115 return 0;
116 }
117}
driver ds18b20 search header file
uint8_t ds18b20_search_rom(ds18b20_handle_t *handle, uint8_t(*rom)[8], uint8_t *num)
search the ds18b20 rom
uint8_t ds18b20_init(ds18b20_handle_t *handle)
initialize the chip
struct ds18b20_handle_s ds18b20_handle_t
ds18b20 handle structure definition
uint8_t ds18b20_deinit(ds18b20_handle_t *handle)
close the chip
uint8_t ds18b20_search(uint8_t(*rom)[8], uint8_t *num)
search example find
uint8_t ds18b20_search_deinit(void)
search example deinit
uint8_t ds18b20_search_init(void)
search example init
uint8_t ds18b20_interface_deinit(void)
interface bus deinit
void ds18b20_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t ds18b20_interface_write(uint8_t value)
interface bus write
uint8_t ds18b20_interface_init(void)
interface bus init
uint8_t ds18b20_interface_read(uint8_t *value)
interface bus read
void ds18b20_interface_debug_print(const char *const fmt,...)
interface print format data
void ds18b20_interface_disable_irq(void)
interface disable the interrupt
void ds18b20_interface_enable_irq(void)
interface enable the interrupt
void ds18b20_interface_delay_us(uint32_t us)
interface delay us