3 #include <util/delay.h>
5 /* Check port settings for clock and data line */
6 #if !(defined(XT_CLOCK_PORT) && \
7 defined(XT_CLOCK_PIN) && \
8 defined(XT_CLOCK_DDR) && \
10 # error "XT clock port setting is required in config.h"
13 #if !(defined(XT_DATA_PORT) && \
14 defined(XT_DATA_PIN) && \
15 defined(XT_DATA_DDR) && \
17 # error "XT data port setting is required in config.h"
22 XT_CLOCK_DDR &= ~(1<<XT_CLOCK_BIT);
23 XT_CLOCK_PORT |= (1<<XT_CLOCK_BIT);
25 return XT_CLOCK_PIN&(1<<XT_CLOCK_BIT);
30 XT_DATA_DDR &= ~(1<<XT_DATA_BIT);
31 XT_DATA_PORT |= (1<<XT_DATA_BIT);
33 return XT_DATA_PIN&(1<<XT_DATA_BIT);