COSA
An Object-Oriented Platform for Arduino Programming
Fai Class Reference

#include <Fai.hh>

Inheritance diagram for Fai:
Inheritance graph
Collaboration diagram for Fai:
Collaboration graph

Classes

struct  analog_pin_t
 
class  Descriptor
 
struct  digital_pin_t
 
struct  digital_pins_t
 
struct  sample_request_t
 
struct  set_mode_t
 

Public Types

enum  {
  MASK_ATTR = 0x0f, COUNT0_ATTR = 0x00, COUNT4_MASK = 0x07, COUNT8_ATTR = 0x08,
  COUNT16_ATTR = 0x09, END_SEQUENCE_ATTR = 0x0f
}
 
enum  {
  MASK_TYPE = 0xf0, UINT8_TYPE = 0x00, UINT16_TYPE = 0x10, UINT32_TYPE = 0x20,
  UINT64_TYPE = 0x30, USER8_DESC_START = 0x40, USER8_DESC_END = USER8_DESC_START | END_SEQUENCE_ATTR, USER16_DESC_START = 0x50,
  USER16_DESC_END = USER16_DESC_START | END_SEQUENCE_ATTR, USER8_TYPE = 0x60, USER16_TYPE = 0x70, INT8_TYPE = 0x80,
  INT16_TYPE = 0x90, INT32_TYPE = 0xa0, INT64_TYPE = 0xb0, FLOAT16_TYPE = 0xc0,
  FLOAT32_TYPE = 0xd0, FLOAT64_TYPE = 0xe0, FLOAT80_TYPE = 0xf0
}
 
enum  { LITTLE_ENDIAN = 0, BIG_ENDIAN = 1 }
 

Public Member Functions

 Fai (IOStream::Device *dev=NULL)
 
void begin ()
 
void write (uint32_t mask)
 
void write (Pin *pin)
 
void write (AnalogPin *pin)
 
void write (Event *event)
 
void set (IOStream::Device *dev)
 
void write (char *s)
 
void write (str_P s)
 
void write (uint8_t value)
 
void write (uint8_t *buf, uint16_t count)
 
void write (uint16_t value)
 
void write (uint16_t *buf, uint16_t count)
 
void write (uint32_t *buf, uint16_t count)
 
void write (uint64_t value)
 
void write (uint64_t *buf, uint16_t count)
 
void write (int8_t value)
 
void write (int8_t *buf, uint16_t count)
 
void write (int16_t value)
 
void write (int16_t *buf, uint16_t count)
 
void write (int32_t value)
 
void write (int32_t *buf, uint16_t count)
 
void write (int64_t value)
 
void write (int64_t *buf, uint16_t count)
 
void write (float value)
 
void write (float *buf, uint16_t count)
 
void write (const Descriptor::user_t *desc)
 
void write (const Descriptor::user_t *desc, void *buf, uint16_t count)
 

Protected Member Functions

void write (uint8_t type, uint16_t count)
 

Protected Attributes

IOStream::Devicem_dev
 

Detailed Description

The Cosa Ciao data stream of Arduino status and commands (Cosa fai).

Definition at line 34 of file Fai.hh.

Member Enumeration Documentation

anonymous enum
inherited

Tag attribute: Number for data values in sequence[count]. User defined data type name as value or end of used defined data type sequence.

Enumerator
MASK_ATTR 
COUNT0_ATTR 
COUNT4_MASK 
COUNT8_ATTR 
COUNT16_ATTR 
END_SEQUENCE_ATTR 

Definition at line 54 of file Ciao.hh.

anonymous enum
inherited

Data type tag: Predefined data types and tags for extension. NB: Arduino/AVR does not implement FLOAT16/64/80.

Enumerator
MASK_TYPE 
UINT8_TYPE 
UINT16_TYPE 
UINT32_TYPE 
UINT64_TYPE 
USER8_DESC_START 
USER8_DESC_END 
USER16_DESC_START 
USER16_DESC_END 
USER8_TYPE 
USER16_TYPE 
INT8_TYPE 
INT16_TYPE 
INT32_TYPE 
INT64_TYPE 
FLOAT16_TYPE 
FLOAT32_TYPE 
FLOAT64_TYPE 
FLOAT80_TYPE 

Definition at line 67 of file Ciao.hh.

anonymous enum
inherited
Enumerator
LITTLE_ENDIAN 
BIG_ENDIAN 

Definition at line 128 of file Ciao.hh.

Constructor & Destructor Documentation

Fai::Fai ( IOStream::Device dev = NULL)
inline

Construct data streaming for given device.

Parameters
[in]devoutput device.

Definition at line 100 of file Fai.hh.

Member Function Documentation

void Fai::begin ( )

Start the data stream with a version string and endian information.

Definition at line 28 of file Fai.cpp.

void Ciao::set ( IOStream::Device dev)
inlineinherited

Set io-stream device.

Parameters
[in]devstream device.

Definition at line 144 of file Ciao.hh.

void Fai::write ( uint32_t  mask)

Write digital pins value to data stream.

Parameters
[in]maskdigital pins to write to data stream.

Definition at line 61 of file Fai.cpp.

void Fai::write ( Pin pin)

Write digital pin value to data stream.

Parameters
[in]pinto write to data stream.

Definition at line 71 of file Fai.cpp.

void Fai::write ( AnalogPin pin)

Write analog pin value to data stream.

Parameters
[in]pinto write to data stream.

Definition at line 80 of file Fai.cpp.

void Fai::write ( Event event)
inline

Write event to data stream.

Parameters
[in]eventto write to data stream.

Definition at line 129 of file Fai.hh.

void Ciao::write ( char *  s)
inherited

Write given string to data stream.

Parameters
[in]sstring to write

Definition at line 87 of file Ciao.cpp.

void Ciao::write ( str_P  s)
inherited

Write given string from program memory to data stream.

Parameters
[in]sprogram memory string to write

Definition at line 95 of file Ciao.cpp.

void Ciao::write ( uint8_t  value)
inherited

Write given unsigned 8-bit integer to data stream.

Parameters
[in]valueto write to data stream.

Definition at line 103 of file Ciao.cpp.

void Ciao::write ( uint8_t *  buf,
uint16_t  count 
)
inherited

Write given unsigned 8-bit integer vector to data stream.

Parameters
[in]bufpointer to integer vector.
[in]countsize of vector.

Definition at line 110 of file Ciao.cpp.

void Ciao::write ( uint16_t  value)
inherited

Write given unsigned 16-bit integer to data stream.

Parameters
[in]valueto write to data stream.

Definition at line 117 of file Ciao.cpp.

void Ciao::write ( uint16_t *  buf,
uint16_t  count 
)
inherited

Write given unsigned 16-bit integer vector to data stream.

Parameters
[in]bufpointer to integer vector.
[in]countsize of vector.

Definition at line 124 of file Ciao.cpp.

void Ciao::write ( uint32_t *  buf,
uint16_t  count 
)
inherited

Write given unsigned 32-bit integer vector to data stream.

Parameters
[in]bufpointer to integer vector.
[in]countsize of vector.

Definition at line 138 of file Ciao.cpp.

void Ciao::write ( uint64_t  value)
inherited

Write given unsigned 64-bit integer to data stream.

Parameters
[in]valueto write to data stream.

Definition at line 145 of file Ciao.cpp.

void Ciao::write ( uint64_t *  buf,
uint16_t  count 
)
inherited

Write given unsigned 64-bit integer vector to data stream.

Parameters
[in]bufpointer to integer vector.
[in]countsize of vector.

Definition at line 152 of file Ciao.cpp.

void Ciao::write ( int8_t  value)
inherited

Write given signed 8-bit integer to data stream.

Parameters
[in]valueto write to data stream.

Definition at line 159 of file Ciao.cpp.

void Ciao::write ( int8_t *  buf,
uint16_t  count 
)
inherited

Write given signed 8-bit integer vector to data stream.

Parameters
[in]bufpointer to integer vector.
[in]countsize of vector.

Definition at line 166 of file Ciao.cpp.

void Ciao::write ( int16_t  value)
inherited

Write given signed 16-bit integer to data stream.

Parameters
[in]valueto write to data stream.

Definition at line 173 of file Ciao.cpp.

void Ciao::write ( int16_t *  buf,
uint16_t  count 
)
inherited

Write given signed 16-bit integer vector to data stream.

Parameters
[in]bufpointer to integer vector.
[in]countsize of vector.

Definition at line 179 of file Ciao.cpp.

void Ciao::write ( int32_t  value)
inherited

Write given signed 32-bit integer to data stream.

Parameters
[in]valueto write to data stream.

Definition at line 186 of file Ciao.cpp.

void Ciao::write ( int32_t *  buf,
uint16_t  count 
)
inherited

Write given signed 32-bit integer vector to data stream.

Parameters
[in]bufpointer to integer vector.
[in]countsize of vector.

Definition at line 193 of file Ciao.cpp.

void Ciao::write ( int64_t  value)
inherited

Write given signed 64-bit integer to data stream.

Parameters
[in]valueto write to data stream.

Definition at line 200 of file Ciao.cpp.

void Ciao::write ( int64_t *  buf,
uint16_t  count 
)
inherited

Write given signed 64-bit integer vector to data stream.

Parameters
[in]bufpointer to integer vector.
[in]countsize of vector.

Definition at line 207 of file Ciao.cpp.

void Ciao::write ( float  value)
inherited

Write given 32-bit floating point to data stream.

Parameters
[in]valueto write to data stream.

Definition at line 214 of file Ciao.cpp.

void Ciao::write ( float *  buf,
uint16_t  count 
)
inherited

Write given 32-bit floating vector to data stream.

Parameters
[in]bufpointer to integer vector.
[in]countsize of vector.

Definition at line 221 of file Ciao.cpp.

void Ciao::write ( const Descriptor::user_t desc)
inherited

Write given user defined data type descriptor to data stream.

Parameters
[in]descdescriptor structure to write (progam memory).

Definition at line 250 of file Ciao.cpp.

void Ciao::write ( const Descriptor::user_t desc,
void *  buf,
uint16_t  count 
)
inherited

Write given user defined data type value to data stream.

Parameters
[in]descuser defined data type (program memory).
[in]bufpointer to value(s) to write.
[in]countsize of sequence to write.

Definition at line 304 of file Ciao.cpp.

void Ciao::write ( uint8_t  type,
uint16_t  count 
)
protectedinherited

Write data tag to given stream.

Parameters
[in]typedata type tag.
[in]countnumber of elements in sequence.

Definition at line 228 of file Ciao.cpp.

Member Data Documentation

IOStream::Device* Ciao::m_dev
protectedinherited

Definition at line 307 of file Ciao.hh.


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