onewire_master.h
Go to the documentation of this file.
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#define ONEWIRE_MASTER_PORT C
#define ONEWIRE_MASTER_PIN 9
void onewire_master_setup(void);
void onewire_master_release(void);
bool onewire_master_reset(void);
uint8_t onewire_master_crc(uint8_t* data, uint32_t length);
uint64_t onewire_master_rom_read(void);
bool onewire_master_rom_search(uint64_t* code, bool alarm);
bool onewire_master_rom_skip(void);
bool onewire_master_rom_match(uint64_t code);
bool onewire_master_read_byte(uint8_t* data);
bool onewire_master_write_byte(uint8_t data);
bool onewire_master_function_read(uint8_t function, uint8_t* data, uint32_t bits);
bool onewire_master_function_write(uint8_t function, uint8_t* data, uint32_t bits);
onewire_master_write_byte
bool onewire_master_write_byte(uint8_t data)
write data byte
Definition: onewire_master.c:232
onewire_master_rom_read
uint64_t onewire_master_rom_read(void)
send READ ROM command and read ROM code response
Definition: onewire_master.c:286
onewire_master_reset
bool onewire_master_reset(void)
send reset pulse
Definition: onewire_master.c:106
onewire_master_rom_search
bool onewire_master_rom_search(uint64_t *code, bool alarm)
send SEARCH ROM command
Definition: onewire_master.c:305
onewire_master_function_read
bool onewire_master_function_read(uint8_t function, uint8_t *data, uint32_t bits)
issue function and read data
Definition: onewire_master.c:243
onewire_master_read_byte
bool onewire_master_read_byte(uint8_t *data)
read data byte
Definition: onewire_master.c:217
onewire_master_rom_skip
bool onewire_master_rom_skip(void)
send SKIP ROM command (all slaves on the bus will be selected)
Definition: onewire_master.c:372
onewire_master_release
void onewire_master_release(void)
release 1-wire peripheral
Definition: onewire_master.c:95
onewire_master_crc
uint8_t onewire_master_crc(uint8_t *data, uint32_t length)
compute CRC for 1-Wire
Definition: onewire_master.c:197
onewire_master_rom_match
bool onewire_master_rom_match(uint64_t code)
send MATCH ROM command to select a specific slave
Definition: onewire_master.c:380
onewire_master_function_write
bool onewire_master_function_write(uint8_t function, uint8_t *data, uint32_t bits)
issue function and write data
Definition: onewire_master.c:264