#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
#include "dev_data.h"
#include "debug.h"
#include "uart.h"
#include "features.h"
#include "onewire.h"
#include "moat.h"
Go to the source code of this file.
|
| enum | mode_t {
OWM_SLEEP,
OWM_IN_RESET,
OWM_AFTER_RESET,
OWM_PRESENCE,
OWM_SEARCH_ZERO,
OWM_SEARCH_ONE,
OWM_SEARCH_READ,
OWM_IDLE,
OWM_READ,
OWM_WRITE
} |
| |
| enum | xmode_t { OWX_IDLE,
OWX_SELECT,
OWX_COMMAND,
OWX_RUNNING
} |
| |
| enum | wmode_t { OWW_WRITE_0,
OWW_WRITE_1,
OWW_NO_WRITE
} |
| |
| #define CLEAR_LOW |
( |
| ) |
do {ONEWIRE_DDR&=~ONEWIRE_PBIT;} while(0) |
| #define DIS_TIMER |
( |
| ) |
do {TIMSK0 &= ~(1<<TOIE0);} while(0) |
| #define EN_TIMER |
( |
| ) |
do {TIMSK0 |= (1<<TOIE0); TIFR0|=(1<<TOV0);}while(0) |
| #define OWT_LOWTIME (T_(40)-2) |
| #define OWT_MIN_RESET T_(410) |
| #define OWT_PRESENCE (T_(160)-1) |
| #define OWT_READLINE (T_(30)-2) |
| #define OWT_RESET_PRESENCE (T_(40)-1) |
| #define SET_LOW |
( |
| ) |
do { ONEWIRE_DDR|=ONEWIRE_PBIT;} while(0) |
| #define SET_TIMER |
( |
|
x | ) |
do { GTCCR = (1<<PSRSYNC); TCNT0=(uint8_t)~(x); } while(0) |
| #define START_READING |
( |
|
bits | ) |
|
Value:
} while(0)
volatile uint8_t cbuf
Definition: onewire.c:26
mode_t lmode
Definition: onewire.c:409
uint8_t lbitp
Definition: onewire.c:411
Definition: onewire_internal.h:146
| #define TIMER0_OVF_vect TIM0_OVF_vect |
| Enumerator |
|---|
| OWM_SLEEP |
|
| OWM_IN_RESET |
|
| OWM_AFTER_RESET |
|
| OWM_PRESENCE |
|
| OWM_SEARCH_ZERO |
|
| OWM_SEARCH_ONE |
|
| OWM_SEARCH_READ |
|
| OWM_IDLE |
|
| OWM_READ |
|
| OWM_WRITE |
|
| Enumerator |
|---|
| OWW_WRITE_0 |
|
| OWW_WRITE_1 |
|
| OWW_NO_WRITE |
|
| Enumerator |
|---|
| OWX_IDLE |
|
| OWX_SELECT |
|
| OWX_COMMAND |
|
| OWX_RUNNING |
|
| void _wait_complete |
( |
void |
| ) |
|
| uint16_t crc16 |
( |
uint16_t |
r, |
|
|
uint8_t |
x |
|
) |
| |
| void next_command |
( |
void |
| ) |
|
| void onewire_init |
( |
void |
| ) |
|
| void onewire_poll |
( |
void |
| ) |
|
| uint8_t recv_any_in |
( |
void |
| ) |
|
| uint16_t recv_bytes_crc |
( |
uint16_t |
crc, |
|
|
uint8_t * |
buf, |
|
|
uint8_t |
len |
|
) |
| |
| void xmit_byte |
( |
uint8_t |
val | ) |
|
| uint16_t xmit_byte_crc |
( |
uint16_t |
crc, |
|
|
uint8_t |
val |
|
) |
| |
| uint16_t xmit_bytes_crc |
( |
uint16_t |
crc, |
|
|
uint8_t * |
buf, |
|
|
uint8_t |
len |
|
) |
| |