12345678910111213141516171819202122232425262728293031323334 |
- #ifndef _1WIRE_H
- #define _1WIRE_H
- #define SEARCHROM
- #define INITST
- #ifdef INITST
- extern unsigned char initst;
- #endif
- #include <avr/io.h>
- #define _1WPORT PORTC
- #define _1WDDR DDRC
- #define _1WPIN PINC
- #define _1WL _BV(PC6)
- unsigned char _1WireInit(void);
- void _1WireWriteSlot(unsigned char bit, unsigned char pr);
- unsigned char _1WireReadSlot(void);
- void _1WireWriteByte(unsigned char dana);
- void _1WireWriteBytePR(unsigned char dana);
- unsigned char _1WireReadByte(void);
- void _1WirePoweroff(void);
- void _1WireSendRom(unsigned char *rom);
- unsigned char _1WireSearch(unsigned char rv, unsigned char *buf);
- #define _1WLOW() _1WDDR |= _1WL;
- #define _1WHIGH() _1WDDR &= ~_1WL;
- #define _1WISHIGH() (_1WPIN & _1WL)
- #define _1WirePoweroff() { _1WDDR &= ~_1WL; _1WPORT &= ~_1WL; }
- #endif
|