123456789101112131415161718192021222324252627 |
- #ifndef _1WIRE_H
- #define _1WIRE_H
- #include <avr/io.h>
- #define _1WPORT PORTB
- #define _1WDDR DDRB
- #define _1WPIN PINB
- #define _1WL _BV(PB3)
- 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 ZERO _1WDDR |= _1WL;
- #define JEDEN _1WDDR &= ~_1WL;
- #define WYS (_1WPIN & _1WL)
- #define _1WirePoweroff() { _1WDDR &= ~_1WL; _1WPORT &= ~_1WL; }
- #endif
|