COSA
An Object-Oriented Platform for Arduino Programming
|
#include <Keypad.hh>
Public Member Functions | |
Key (Board::AnalogPin pin, Keypad *keypad, const uint16_t *map) | |
void | reference (Board::Reference ref) |
Board::Reference | reference () const |
Board::AnalogPin | pin () const |
uint16_t | value () const |
uint16_t | sample () |
AnalogPin & | operator>> (uint16_t &var) |
operator uint16_t () | |
bool | sample_request (uint8_t event=Event::NULL_TYPE) |
uint16_t | sample_await () |
virtual void | on_interrupt (uint16_t arg) |
virtual void | enable () |
virtual void | disable () |
virtual void | clear () |
Static Public Member Functions | |
static void | prescale (uint8_t factor) |
static uint16_t | sample (Board::AnalogPin pin, Board::Reference ref=Board::AVCC_REFERENCE) |
static uint16_t | bandgap (uint16_t vref=1100) |
static void | powerup () |
static void | powerdown () |
Protected Member Functions | |
bool | sample_request (Board::AnalogPin pin, uint8_t ref) |
virtual void | on_event (uint8_t type, uint16_t value) |
Protected Attributes | |
const Board::AnalogPin | m_pin |
Analog channel number. More... | |
Board::Reference | m_reference |
ADC reference voltage type. More... | |
uint16_t | m_value |
Latest sample value. More... | |
uint8_t | m_event |
Event to push on completion. More... | |
Static Protected Attributes | |
static AnalogPin * | sampling_pin = NULL |
Current sampling pin if any. More... | |
Internal analog pin sampler to detect key down. Samples are maps to key code.
|
inline |
|
staticinherited |
Get power supply voltage in milli-volt. May be used for low battery detection. Uses the internal 1V1 bandgap reference.
[in] | vref | reference voltage in milli-volt (default is 1100 mv). |
Definition at line 33 of file AnalogPin_static.cpp.
|
inlinevirtualinherited |
Clear interrupt.
Reimplemented in InputCapture, and ExternalInterrupt.
Definition at line 59 of file Interrupt.hh.
|
inlinevirtualinherited |
Disable interrupt handler.
Reimplemented in InputCapture, AnalogComparator, PinChangeInterrupt, and ExternalInterrupt.
Definition at line 53 of file Interrupt.hh.
|
inlinevirtualinherited |
Enable interrupt handler.
Reimplemented in InputCapture, PinChangeInterrupt, ExternalInterrupt, and AnalogComparator.
Definition at line 47 of file Interrupt.hh.
|
protectedvirtualinherited |
Handle analog pin periodic sampling and sample completed event. Will call virtual method on_change() if the pin value has changed since latest sample.
[in] | type | the type of event. |
[in] | value | the event value. |
Reimplemented from Event::Handler.
Reimplemented in AnalogPins.
Definition at line 51 of file AnalogPin.cpp.
|
virtualinherited |
Interrupt service on conversion completion.
[in] | arg | sample value. |
Reimplemented from Interrupt::Handler.
Reimplemented in AnalogPins.
Definition at line 65 of file AnalogPin.cpp.
|
inlineinherited |
Sample analog pin. Wait for conversion to complete before returning with sample value.
Definition at line 159 of file AnalogPin.hh.
|
inlineinherited |
Sample analog pin. Wait for conversion to complete before returning with sample value.
[out] | var | variable to receive the value. |
Definition at line 147 of file AnalogPin.hh.
|
inlineinherited |
|
inlinestaticinherited |
Disable analog conversion.
Definition at line 123 of file AnalogPin.hh.
|
inlinestaticinherited |
Enable analog conversion.
Definition at line 113 of file AnalogPin.hh.
|
staticinherited |
Set analog conversion clock prescale (2..128, step power 2).
[in] | factor | prescale. |
Definition at line 26 of file AnalogPin_static.cpp.
|
inlineinherited |
Set reference voltage for conversion.
[in] | ref | reference voltage. |
Definition at line 51 of file AnalogPin.hh.
|
inlineinherited |
Get reference voltage for conversion.
Definition at line 60 of file AnalogPin.hh.
|
staticinherited |
Sample analog pin. Wait for conversion to complete before returning with sample value.
[in] | pin | number. |
[in] | ref | reference voltage. |
Definition at line 50 of file AnalogPin_static.cpp.
|
inlineinherited |
Sample analog pin. Wait for conversion to complete before returning with sample value.
Definition at line 135 of file AnalogPin.hh.
|
inherited |
Await conversion to complete. Returns sample value
Definition at line 38 of file AnalogPin.cpp.
|
inlineinherited |
Request sample of analog pin. Pushes given event on completion. Default event is null/no event pushed for sample_await().
[in] | event | to push on completion. |
Definition at line 171 of file AnalogPin.hh.
|
protectedinherited |
Internal request sample of analog pin. Set up sampling of given pin with given reference voltage.
[in] | pin | number. |
[in] | ref | reference voltage. |
Definition at line 24 of file AnalogPin.cpp.
|
inlineinherited |
|
protectedinherited |
Event to push on completion.
Definition at line 205 of file AnalogPin.hh.
|
protectedinherited |
Analog channel number.
Definition at line 202 of file AnalogPin.hh.
|
protectedinherited |
ADC reference voltage type.
Definition at line 203 of file AnalogPin.hh.
|
protectedinherited |
Latest sample value.
Definition at line 204 of file AnalogPin.hh.
Current sampling pin if any.
Definition at line 201 of file AnalogPin.hh.