forked from Elektron2016/key_copy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dallas.h
48 lines (30 loc) · 819 Bytes
/
dallas.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* dallas.h
*
* Created: 20.01.2016 ??2:01:57
* Author: Elektron
*/
#pragma once
#define DS_READ_ROM_OK 0
#define DS_READ_ROM_NO_PRES 1
#define DS_READ_ROM_CRC_ERR 2
#define DS_PORT PORTC
#define DS_DDR DDRC
#define DS_PIN PINC
#define DS_LINE 0
//const uint8_t ds_crc_table[256];
void ds_init();
//void ds_out(uint8_t data_byte);
//uint8_t ds_in(void);
//void ds_write_bit(uint8_t value);
//uint8_t ds_read_bit(void);
uint8_t ds_crc(uint8_t crc, uint8_t data);
void ds_write_byte(uint8_t data);
uint8_t ds_read_byte(void);
uint8_t ds_reset(void);
uint8_t ds_crc_check();
uint8_t ds_read_rom();
void ds_program_byte(uint8_t data);
uint8_t ds_timeslot(void);
uint8_t ds_program_tm08v2(uint8_t* p);
uint8_t ds_program_tm2004(uint8_t* p);