sketchbook
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
ds2423.c File Reference
#include <avr/io.h>
#include <avr/interrupt.h>
#include <string.h>
#include "onewire.h"
#include "features.h"
#include "crc.h"
#include "debug.h"

Macros

#define NCOUNTERS   2
 
#define C_WRITE_SCRATCHPAD   0x0F
 
#define C_READ_SCRATCHPAD   0xAA
 
#define C_COPY_SCRATCHPAD   0x55
 
#define C_READ_MEM   0xF0
 
#define C_READ_MEM_COUNTER   0xA5
 
#define NO_ADLAR
 
#define SEND(_x)
 

Functions

void do_mem_counter (void)
 
void do_command (uint8_t cmd)
 
void update_idle (uint8_t bits)
 
void init_state (void)
 
void mainloop (void)
 

Macro Definition Documentation

#define C_COPY_SCRATCHPAD   0x55
#define C_READ_MEM   0xF0
#define C_READ_MEM_COUNTER   0xA5
#define C_READ_SCRATCHPAD   0xAA
#define C_WRITE_SCRATCHPAD   0x0F
#define NCOUNTERS   2
#define NO_ADLAR
#define SEND (   _x)
Value:
do { \
uint32_t x; \
cli(); \
x = (_x); \
sei(); \
b = x ; xmit_byte(b); crc = crc16(crc,b); \
b = x>> 8; xmit_byte(b); crc = crc16(crc,b); \
b = x>>16; xmit_byte(b); crc = crc16(crc,b); \
b = x>>24; xmit_byte(b); crc = crc16(crc,b); \
} while(0)
tuple x
Definition: ser-log.py:26
int32_t int16_t b
Definition: IMU.cpp:172
uint16_t crc16(uint16_t r, uint8_t x)
Definition: crc.c:24
void xmit_byte(uint8_t val)
Definition: onewire.c:155

Function Documentation

void do_command ( uint8_t  cmd)
void do_mem_counter ( void  )
void init_state ( void  )
void mainloop ( void  )
void update_idle ( uint8_t  bits)