COSA
An Object-Oriented Platform for Arduino Programming
|
#include <UART.hh>
Public Types | |
enum | InterruptMode { ON_FALLING_MODE = 0, ON_RISING_MODE = 1, ON_CHANGE_MODE = 2 } |
enum | Mode { OUTPUT_MODE = 0, INPUT_MODE = 1 } |
enum | Direction { MSB_FIRST = 0, LSB_FIRST = 1 } |
Public Member Functions | |
RXPinChangeInterrupt (Board::InterruptPin pin, UART *uart) | |
virtual void | on_interrupt (uint16_t arg=0) |
virtual void | enable () |
virtual void | disable () |
void | mode (Mode mode) |
Mode | mode () const |
void | _set () const |
void | _set (int value) const |
void | set () const |
void | set (int value) const |
void | high () const |
void | on () const |
void | _clear () const |
void | clear () const |
virtual void | clear () |
void | low () const |
void | off () const |
void | _toggle () const |
void | toggle () const |
void | _write (int value) const |
void | write (int value) const |
void | write (uint8_t value, OutputPin &clk, Direction order=MSB_FIRST) const |
void | write (uint16_t value, uint8_t bits, uint16_t us) const |
OutputPin & | operator<< (int value) |
void | pulse (uint16_t us) const |
uint8_t | pin () const |
bool | is_set () const |
bool | is_high () const |
bool | is_on () const |
bool | is_clear () const |
bool | is_low () const |
bool | is_off () const |
bool | read () const |
uint8_t | read (OutputPin &clk, Direction order=MSB_FIRST) const |
operator bool () const | |
Pin & | operator>> (uint8_t &var) |
Static Public Member Functions | |
static void | begin () |
static void | end () |
static void | mode (Board::DigitalPin pin, Mode mode) |
static Mode | mode (Board::DigitalPin pin) |
static void | mode (Board::DigitalPin pin, uint8_t initial=0) |
static void | toggle (Board::DigitalPin pin) |
static void | _write (Board::DigitalPin pin, uint8_t value) |
static void | write (Board::DigitalPin pin, int value) |
static uint8_t | MASK (uint8_t pin) |
static volatile uint8_t * | PIN (uint8_t pin) |
static volatile uint8_t * | DDR (uint8_t pin) |
static volatile uint8_t * | PORT (uint8_t pin) |
static bool | read (Board::DigitalPin pin) |
Protected Member Functions | |
volatile uint8_t * | PIN () const |
volatile uint8_t * | DDR () const |
volatile uint8_t * | PORT () const |
volatile uint8_t * | PCIMR () const |
Protected Attributes | |
UART * | m_uart |
volatile uint8_t *const | m_sfr |
const uint8_t | m_mask |
const uint8_t | m_pin |
|
inherited |
|
inherited |
Interrupt modes.
Enumerator | |
---|---|
ON_FALLING_MODE | |
ON_RISING_MODE | |
ON_CHANGE_MODE |
Definition at line 46 of file PinChangeInterrupt.hh.
|
inherited |
UART::RXPinChangeInterrupt::RXPinChangeInterrupt | ( | Board::InterruptPin | pin, |
UART * | uart | ||
) |
Definition at line 41 of file SOFT_UART.cpp.
|
inlineinherited |
Clear the output pin. Unprotected version.
Definition at line 114 of file OutputPin.hh.
|
inlineinherited |
Set the output pin. Unprotected version.
Definition at line 75 of file OutputPin.hh.
|
inlineinherited |
Set the output pin with the given value. Zero(0) to clear and non-zero to set. Unprotected version.
[in] | value | to set. |
Definition at line 184 of file OutputPin.hh.
|
inlineinherited |
Toggle the output pin. Unprotected version.
Definition at line 153 of file OutputPin.hh.
|
inlineinherited |
Set the output pin with the given value. Zero(0) to clear and non-zero to set. Unprotected version.
[in] | value | to set. |
Definition at line 219 of file OutputPin.hh.
|
inlinestaticinherited |
Set the given output pin with the given value. Zero(0) to clear and non-zero to set. Unprotected version when pin and value are constants.
[in] | pin | number (must be constant). |
[in] | value | to write (must be constant). |
Definition at line 345 of file OutputPin.hh.
|
staticinherited |
Start handling of pin change interrupt handling.
Definition at line 65 of file PinChangeInterrupt.cpp.
|
inlinevirtualinherited |
Clear interrupt.
Reimplemented in InputCapture, and ExternalInterrupt.
Definition at line 59 of file Interrupt.hh.
|
inlineinherited |
|
inlinestaticinherited |
|
inlineprotectedinherited |
|
virtualinherited |
Disable interrupt pin change detection.
Reimplemented from Interrupt::Handler.
Definition at line 59 of file PinChangeInterrupt.cpp.
|
virtualinherited |
Enable interrupt pin change detection and interrupt handler.
Reimplemented from Interrupt::Handler.
Definition at line 44 of file PinChangeInterrupt.cpp.
|
staticinherited |
End handling of pin change interrupt handling.
Definition at line 103 of file PinChangeInterrupt.cpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inlinestaticinherited |
Set output pin to mode.
[in] | pin | number. |
[in] | initial | value. |
Definition at line 56 of file OutputPin.hh.
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inlinestaticinherited |
|
inlineinherited |
|
inlineinherited |
|
virtual |
Default interrupt service on pin change interrupt.
[in] | arg | argument from interrupt service routine. |
Implements PinChangeInterrupt.
Definition at line 49 of file SOFT_UART.cpp.
|
inlineinherited |
|
inlineinherited |
Set the output pin with the given value. Zero(0) to clear and non-zero to set. Output operator syntax.
[in] | value | to write. |
Definition at line 364 of file OutputPin.hh.
|
inlineinherited |
|
inlineprotectedinherited |
|
inlinestaticinherited |
|
inlineinherited |
|
inlineprotectedinherited |
|
inlinestaticinherited |
|
inlineprotectedinherited |
|
inlineinherited |
Toggle the output pin to form a pulse with given width in micro-seconds.
[in] | us | pulse width in micro seconds |
Definition at line 378 of file OutputPin.hh.
|
inlineinherited |
|
inlinestaticinherited |
|
inlineinherited |
|
inlineinherited |
Set the output pin with the given value. Zero(0) to clear and non-zero to set.
[in] | value | to set. |
Definition at line 201 of file OutputPin.hh.
|
inlineinherited |
|
inlinestaticinherited |
Toggle the output pin. Atomic per definition
[in] | pin | number. |
Definition at line 173 of file OutputPin.hh.
|
inlineinherited |
Set the output pin with the given value. Zero(0) to clear and non-zero to set.
[in] | value | to write. |
Definition at line 236 of file OutputPin.hh.
|
inherited |
Shift out given byte to the output pin using the given clock output pin. Shift out according to given direction. Data (bits) are transfered on clock transition. Interrupts are allowed during the shift out.
[in] | value | to write. |
[in] | clk | output pin. |
[in] | order | bit first. |
Definition at line 24 of file OutputPin.cpp.
|
inherited |
Shift out given value and number of bits to the output pin using the given pulse length in micro-seconds. Shift out from LSB(0) to MSB(bits-1). This operation is synchronized and will turn off interrupt handling during the transmission period.
[in] | value | to write. |
[in] | bits | to write. |
[in] | us | micro-second bit period. |
Definition at line 46 of file OutputPin.cpp.
|
inlinestaticinherited |
Set the given output pin with the given value. Zero(0) to clear and non-zero to set.
[in] | pin | number. |
[in] | value | to write. |
Definition at line 306 of file OutputPin.hh.
|
protectedinherited |
|
protectedinherited |