#include <ioavr.h>
#include <inavr.h>
#include "OWIIntFunctions.h"
#include "OWIInterruptDriven.h"
#include "ds2740.h"
#include "..\uart.h"
#include "..\globales.h"
Defines | |
#define | OWI_STATE_IDLE 0 |
#define | OWI_STATE_DETECT_PRESENCE 1 |
#define | OWI_STATE_READ_CURRENT 2 |
#define | OWI_STATE_READ_ACCUMULATED 3 |
#define | OWI_STATE_WRITE_REG 4 |
#define | OWI_STATE_RESULT 6 |
#define | OWI_STATE_NET_ADDRESS 7 |
#define | FALSE 0 |
#define | TRUE 1 |
#define | DS2740_READ_DATA 0x69 |
DS2740 read memory. | |
#define | DS2740_WRITE_DATA 0x6C |
DS2740 write memory. | |
#define | CURRENT_REG_ADDR 0X0E |
#define | ACCUMULATED_REG_ADDR 0X10 |
Functions | |
int | OWI_StateMachine (unsigned char sel_state) |
Máquina de estados que controla la comunicación con el bus 1-Wire. | |
int | ds2740 (unsigned char sel_func) |
Variables | |
OWIflags | OWIStatus |
unsigned char * | OWIDataBuffer |
unsigned char | espero |
unsigned char | timeout |
static unsigned char | buf [9] |
static unsigned char | buf2 [9] |
unsigned char | i |
unsigned char | j |
#define ACCUMULATED_REG_ADDR 0X10 |
#define CURRENT_REG_ADDR 0X0E |
#define DS2740_READ_DATA 0x69 |
DS2740 read memory.
#define DS2740_WRITE_DATA 0x6C |
DS2740 write memory.
#define FALSE 0 |
#define OWI_STATE_DETECT_PRESENCE 1 |
#define OWI_STATE_IDLE 0 |
#define OWI_STATE_NET_ADDRESS 7 |
#define OWI_STATE_READ_ACCUMULATED 3 |
#define OWI_STATE_READ_CURRENT 2 |
#define OWI_STATE_RESULT 6 |
#define OWI_STATE_WRITE_REG 4 |
#define TRUE 1 |
int ds2740 | ( | unsigned char | sel_func | ) |
int OWI_StateMachine | ( | unsigned char | sel_state | ) |
Máquina de estados que controla la comunicación con el bus 1-Wire.
Esta funcion se encarga de leer el valor correspondiente según los parámetros recibido al llamar la función 1-wire
unsigned char buf[9] [static] |
unsigned char buf2[9] [static] |
unsigned char espero |
unsigned char i |
unsigned char j |
unsigned char* OWIDataBuffer |
unsigned char timeout |