Arduino-OWI
One-Wire Interface (OWI) library for Arduino
Arduino Class Reference

#include <Arduino.h>

Inheritance diagram for Arduino:
Inheritance graph
Collaboration diagram for Arduino:
Collaboration graph

Classes

struct  analog_read_res_t
 

Public Types

enum  {
  PIN_MODE = 0x11, DIGITAL_READ = 0x22, DIGITAL_WRITE = 0x33, ANALOG_READ = 0x44,
  ANALOG_WRITE = 0x55, SRAM_READ = 0x66, SRAM_WRITE = 0x77, EEPROM_READ = 0x88,
  EEPROM_WRITE = 0x99, DIGITAL_PINS = 0xaa, ANALOG_PINS = 0xbb
}
 

Public Member Functions

 Arduino (OWI &owi, uint8_t *rom=NULL)
 
uint8_t label ()
 
void label (uint8_t nr)
 
int pinMode (int pin, int mode)
 
int digitalRead (int pin)
 
int digitalWrite (int pin, int value)
 
int analogRead (int pin)
 
int analogWrite (int pin, int duty)
 
int num_digital_pins ()
 
int num_analog_inputs ()
 
int read_rom ()
 
int label_rom (uint8_t nr)
 
int print_rom (Print &out=Serial)
 
void rom (const uint8_t *rom)
 
uint8_t * rom ()
 
void rom_P (const uint8_t *rom)
 

Static Public Attributes

static const uint8_t FAMILY_CODE = 0x60
 

Protected Attributes

uint8_t m_label
 
OWIm_owi
 
uint8_t m_rom [ROM_MAX]
 

Detailed Description

One-Wire Interface (OWI) Remote Arduino Device Driver. Core functions are implemented as one-wire communication. See OWI/examples/Slave, Slave and Master sketches for examples.

Definition at line 35 of file Arduino.h.

Member Enumeration Documentation

anonymous enum

One-Wire Interface (OWI) Remote Arduino Device function codes.

Enumerator
PIN_MODE 

Set pin mode: 6b pin, 2b mode.

DIGITAL_READ 

Read digital pin: 6b pin, 1b return.

DIGITAL_WRITE 

Write digital pin: 6b pin, 1b value.

ANALOG_READ 

Read analog pin: 6b pin, 16b+8b return.

ANALOG_WRITE 

Write analog pin: 6b pin, 8b duty.

SRAM_READ 

SRAM read.

SRAM_WRITE 

SRAM write.

EEPROM_READ 

EEPROM read.

EEPROM_WRITE 

EEPROM write.

DIGITAL_PINS 

Get number of digital pins: 6b return.

ANALOG_PINS 

Get number of analog inputs: 6b return.

Definition at line 220 of file Arduino.h.

Constructor & Destructor Documentation

Arduino::Arduino ( OWI owi,
uint8_t *  rom = NULL 
)
inline

Construct One-Wire Interface (OWI) Remote Arduino with given bus and device address.

Parameters
[in]owibus manager.
[in]romcode (default NULL).

Definition at line 46 of file Arduino.h.

Member Function Documentation

int Arduino::analogRead ( int  pin)
inline

Read analog value from given pin. Return read value if successful, otherwise negative error code.

Parameters
[in]pinanalog pin number.
Returns
value read or negative error code.

Definition at line 120 of file Arduino.h.

int Arduino::analogWrite ( int  pin,
int  duty 
)
inline

Set given duty to given pulse width modulated (PWM) pin. Return zero(0) if successful, otherwise negative error code.

Parameters
[in]pindigital pin number.
[in]dutyof pulse width.
Returns
zero(0) or negative error code.

Definition at line 138 of file Arduino.h.

int Arduino::digitalRead ( int  pin)
inline

Read given pin and return current state or negative error code.

Parameters
[in]pindigital pin number.
Returns
pin state (LOW, HIGH) or negative error code.

Definition at line 90 of file Arduino.h.

int Arduino::digitalWrite ( int  pin,
int  value 
)
inline

Write given value to given pin. Return zero(0) if successful, otherwise negative error code.

Parameters
[in]pindigital pin number.
[in]valueto write pin.
Returns
zero(0) or negative error code.

Definition at line 105 of file Arduino.h.

uint8_t Arduino::label ( )
inline

Get device label.

Returns
short address.

Definition at line 56 of file Arduino.h.

void Arduino::label ( uint8_t  nr)
inline

Set device label.

Parameters
[in]labelshort address.

Definition at line 65 of file Arduino.h.

int Arduino::label_rom ( uint8_t  nr)
inline

Set rom label for current addressed device. Return zero(0) if successful, otherwise negative error code.

Parameters
[in]nrlabel number.
Returns
zero(0) or negative error code.

Definition at line 188 of file Arduino.h.

int Arduino::num_analog_inputs ( )
inline

Return number of analog inputs, if successful otherwise negative error code.

Returns
pins or negative error code.

Definition at line 164 of file Arduino.h.

int Arduino::num_digital_pins ( )
inline

Return number of digital pins, if successful otherwise negative error code.

Returns
pins or negative error code.

Definition at line 152 of file Arduino.h.

int Arduino::pinMode ( int  pin,
int  mode 
)
inline

Set given pin to given mode (OUTPUT, INPUT, INPUT_PULLUP).

Parameters
[in]pindigital pin number.
[in]modepin mode.
Returns
zero(0) or negative error code.

Definition at line 76 of file Arduino.h.

int Arduino::print_rom ( Print &  out = Serial)
inline

Print device rom idenity code to given output stream. Return zero(0) if successful, otherwise negative error code.

Parameters
[in]outoutput stream (default Serial).
Returns
zero(0) or negative error code.

Definition at line 202 of file Arduino.h.

int Arduino::read_rom ( )
inline

Read rom identity code for device. Return zero(0) if successful, otherwise negative error code.

Returns
zero(0) or negative error code.

Definition at line 176 of file Arduino.h.

void OWI::Device::rom ( const uint8_t *  rom)
inlineinherited

Set device rom code.

Parameters
[in]romcode.

Definition at line 303 of file OWI.h.

uint8_t* OWI::Device::rom ( )
inlineinherited

Get device rom code.

Returns
rom code.

Definition at line 333 of file OWI.h.

void OWI::Device::rom_P ( const uint8_t *  rom)
inlineinherited

Set device rom code.

Parameters
[in]romcode in program memory.

Definition at line 318 of file OWI.h.

Member Data Documentation

const uint8_t Arduino::FAMILY_CODE = 0x60
static

Family code.

Definition at line 38 of file Arduino.h.

uint8_t Arduino::m_label
protected

Short address.

Definition at line 236 of file Arduino.h.

OWI& OWI::Device::m_owi
protectedinherited

One-Wire Bus Manager.

Definition at line 340 of file OWI.h.

uint8_t OWI::Device::m_rom[ROM_MAX]
protectedinherited

Device rom idenity code.

Definition at line 343 of file OWI.h.


The documentation for this class was generated from the following file: