COSA
An Object-Oriented Platform for Arduino Programming
AnalogPins.cpp
Go to the documentation of this file.
1 
21 #include "Cosa/AnalogPins.hh"
22 
23 bool
25 {
26  m_next = 0;
27  return (AnalogPin::sample_request(pin_at(m_next), m_reference));
28 }
29 
30 void
32 {
33  sampling_pin = 0;
34  m_buffer[m_next++] = value;
35  if (m_next != m_count) {
37  }
38  else {
40  }
41 }
virtual void on_interrupt(uint16_t arg)
Definition: AnalogPins.cpp:31
bool samples_request()
Definition: AnalogPins.cpp:24
static AnalogPin * sampling_pin
Current sampling pin if any.
Definition: AnalogPin.hh:201
Board::AnalogPin pin_at(uint8_t ix) const
Definition: AnalogPins.hh:66
static bool push(uint8_t type, Handler *target, uint16_t value=0)
Definition: Event.hh:180
Board::Reference m_reference
ADC reference voltage type.
Definition: AnalogPin.hh:203
bool sample_request(uint8_t event=Event::NULL_TYPE)
Definition: AnalogPin.hh:171
uint16_t value() const
Definition: AnalogPin.hh:79