COSA
An Object-Oriented Platform for Arduino Programming
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Fai.hh
Go to the documentation of this file.
1
21
#ifndef COSA_FAI_HH
22
#define COSA_FAI_HH
23
24
#include "
Cosa/Types.h
"
25
#include "
Cosa/Pin.hh
"
26
#include "
Cosa/AnalogPin.hh
"
27
#include "
Cosa/Event.hh
"
28
29
#include <
Ciao.h
>
30
34
class
Fai
:
public
Ciao
{
35
public
:
39
class
Descriptor
{
40
public
:
41
enum
{
42
ANALOG_PIN_ID
=
Ciao::Descriptor::COSA_FAI_ID
,
43
DIGITAL_PIN_ID
,
44
DIGITAL_PINS_ID
,
45
EVENT_ID
,
46
SAMPLE_REQUEST_ID
,
47
SET_MODE_ID
48
};
49
static
const
Ciao::Descriptor::user_t
analog_pin_t
PROGMEM;
50
static
const
Ciao::Descriptor::user_t
digital_pin_t
PROGMEM;
51
static
const
Ciao::Descriptor::user_t
digital_pins_t
PROGMEM;
52
static
const
Ciao::Descriptor::user_t
event_t
PROGMEM;
53
static
const
Ciao::Descriptor::user_t
sample_request_t
PROGMEM;
54
static
const
Ciao::Descriptor::user_t
set_mode_t
PROGMEM;
55
};
56
60
struct
analog_pin_t
{
61
uint8_t
pin
;
62
uint16_t
value
;
63
};
64
68
struct
digital_pin_t
{
69
uint8_t
pin
;
70
uint8_t
value
;
71
};
72
76
struct
digital_pins_t
{
77
uint32_t
values
;
78
};
79
83
struct
sample_request_t
{
84
uint32_t
pins
;
85
uint16_t
period
;
86
};
87
91
struct
set_mode_t
{
92
uint8_t
pin
;
93
uint8_t
mode
;
94
};
95
100
Fai
(
IOStream::Device
* dev =
NULL
) :
Ciao
(dev) {}
101
105
void
begin
();
106
111
void
write
(uint32_t mask);
112
117
void
write
(
Pin
* pin);
118
123
void
write
(
AnalogPin
* pin);
124
129
void
write
(
Event
* event)
130
{
131
Ciao::write
(&
Descriptor::event_t
, event, 1);
132
}
133
};
134
135
#endif
Fai::analog_pin_t
Definition:
Fai.hh:60
Fai::analog_pin_t::pin
uint8_t pin
Definition:
Fai.hh:61
Fai::Descriptor::ANALOG_PIN_ID
Definition:
Fai.hh:42
Fai::Descriptor::DIGITAL_PIN_ID
Definition:
Fai.hh:43
Event.hh
Types.h
Fai::begin
void begin()
Definition:
Fai.cpp:28
Pin
Definition:
Pin.hh:35
Fai::set_mode_t::pin
uint8_t pin
Definition:
Fai.hh:92
Fai::set_mode_t::mode
uint8_t mode
Definition:
Fai.hh:93
Ciao::write
void write(char *s)
Definition:
Ciao.cpp:87
Pin.hh
Ciao
Definition:
Ciao.hh:47
Ciao.h
NULL
#define NULL
Definition:
Types.h:101
Fai::digital_pin_t::pin
uint8_t pin
Definition:
Fai.hh:69
Fai::write
void write(uint32_t mask)
Definition:
Fai.cpp:61
Fai::analog_pin_t::value
uint16_t value
Definition:
Fai.hh:62
Fai::digital_pins_t::values
uint32_t values
Definition:
Fai.hh:77
Fai::Descriptor::EVENT_ID
Definition:
Fai.hh:45
Fai::digital_pin_t
Definition:
Fai.hh:68
Fai::digital_pins_t
Definition:
Fai.hh:76
Ciao::Descriptor::user_t
Definition:
Ciao.hh:109
Fai::Descriptor::event_t
static const Ciao::Descriptor::user_t event_t
Definition:
Fai.hh:52
Fai::sample_request_t::pins
uint32_t pins
Definition:
Fai.hh:84
Ciao::Descriptor::COSA_FAI_ID
Cosa Fai descriptors (8-bit, 16-).
Definition:
Ciao.hh:100
Fai::sample_request_t::period
uint16_t period
Definition:
Fai.hh:85
Fai::write
void write(Event *event)
Definition:
Fai.hh:129
AnalogPin
Definition:
AnalogPin.hh:32
Fai::digital_pin_t::value
uint8_t value
Definition:
Fai.hh:70
Fai::Descriptor::SAMPLE_REQUEST_ID
Definition:
Fai.hh:46
Fai::Fai
Fai(IOStream::Device *dev=NULL)
Definition:
Fai.hh:100
Fai::Descriptor::DIGITAL_PINS_ID
Definition:
Fai.hh:44
Event
Definition:
Event.hh:39
Fai::sample_request_t
Definition:
Fai.hh:83
IOStream::Device
Definition:
IOStream.hh:63
Fai::Descriptor::SET_MODE_ID
Definition:
Fai.hh:47
Fai::set_mode_t
Definition:
Fai.hh:91
Fai::Descriptor
Definition:
Fai.hh:39
Fai
Definition:
Fai.hh:34
AnalogPin.hh
libraries
Fai
Fai.hh
Generated on Thu Aug 31 2017 17:02:03 for COSA by
1.8.11