MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
MeOneWire.h
Go to the documentation of this file.
1
139#ifndef MeOneWire_H
140#define MeOneWire_H
141
142#include <stdint.h>
143#include <stdbool.h>
144#include <Arduino.h>
145#include "MeConfig.h"
146
152 class MeOneWire
153{
154 private:
155 MeIO_REG_TYPE bitmask;
156 volatile MeIO_REG_TYPE *baseReg;
157 /* global search state */
158 uint8_t ROM_NO[8];
159 uint8_t LastDiscrepancy;
160 uint8_t LastFamilyDiscrepancy;
161 uint8_t LastDeviceFlag;
162
163 public:
170 MeOneWire(void);
171
178 MeOneWire(uint8_t pin);
179
192 bool readIO(void);
193
208 void reset(uint8_t pin);
209
225 uint8_t reset(void);
226
241 void select(const uint8_t rom[8]);
242
255 void skip(void);
256
273 void write(uint8_t v, uint8_t power = 0);
274
293 void write_bytes(const uint8_t *buf, uint16_t count, bool power = 0);
294
307 uint8_t read(void);
308
325 void read_bytes(uint8_t *buf, uint16_t count);
326
342 void write_bit(uint8_t v);
343
357 uint8_t read_bit(void);
358
375 void depower(void);
376
390 void reset_search(void);
391
407 void target_search(uint8_t family_code);
408
431 uint8_t search(uint8_t *newAddr);
432};
433
434#endif
435
MeConfig.h
Configuration file of library.
MeOneWire
Driver for 1-wire protocol.
Definition MeOneWire.h:153
MeOneWire::write_bytes
void write_bytes(const uint8_t *buf, uint16_t count, bool power=0)
Definition MeOneWire.cpp:381
MeOneWire::search
uint8_t search(uint8_t *newAddr)
Definition MeOneWire.cpp:592
MeOneWire::write
void write(uint8_t v, uint8_t power=0)
Definition MeOneWire.cpp:346
MeOneWire::write_bit
void write_bit(uint8_t v)
Definition MeOneWire.cpp:272
MeOneWire::target_search
void target_search(uint8_t family_code)
Definition MeOneWire.cpp:557
MeOneWire::MeOneWire
MeOneWire(void)
Definition MeOneWire.cpp:146
MeOneWire::reset_search
void reset_search(void)
Definition MeOneWire.cpp:526
MeOneWire::readIO
bool readIO(void)
Definition MeOneWire.cpp:196
MeOneWire::read
uint8_t read(void)
Definition MeOneWire.cpp:408
MeOneWire::read_bit
uint8_t read_bit(void)
Definition MeOneWire.cpp:312
MeOneWire::read_bytes
void read_bytes(uint8_t *buf, uint16_t count)
Definition MeOneWire.cpp:439
MeOneWire::skip
void skip(void)
Definition MeOneWire.cpp:485
MeOneWire::depower
void depower(void)
Definition MeOneWire.cpp:506
MeOneWire::select
void select(const uint8_t rom[8])
Definition MeOneWire.cpp:461
MeOneWire::reset
uint8_t reset(void)
Definition MeOneWire.cpp:222