COSA
An Object-Oriented Platform for Arduino Programming
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
PCF8591.cpp
Go to the documentation of this file.
1
21
#include "
PCF8591.hh
"
22
23
bool
24
PCF8591::begin
(uint8_t cntl)
25
{
26
m_cntl = cntl;
27
twi
.
acquire
(
this
);
28
twi
.
write
(m_cntl);
29
sample
();
30
return
(
true
);
31
}
32
33
bool
34
PCF8591::convert
(uint8_t value)
35
{
36
twi
.
acquire
(
this
);
37
int
count =
twi
.
write
(m_cntl, &value, 1);
38
twi
.
release
();
39
return
(count == (
sizeof
(m_cntl) +
sizeof
(value)));
40
}
twi
TWI twi
Definition:
TWI.cpp:27
PCF8591::begin
bool begin(uint8_t cntl)
Definition:
PCF8591.cpp:24
PCF8591::convert
bool convert(uint8_t value)
Definition:
PCF8591.cpp:34
PCF8591.hh
TWI::release
void release()
Definition:
TWI.cpp:58
TWI::write
int write(void *buf, size_t size)
Definition:
TWI.hh:282
TWI::acquire
void acquire(TWI::Driver *dev)
Definition:
TWI.cpp:36
PCF8591::sample
uint8_t sample()
Definition:
PCF8591.hh:99
libraries
PCF8591
PCF8591.cpp
Generated on Thu Aug 31 2017 17:02:03 for COSA by
1.8.11