COSA
An Object-Oriented Platform for Arduino Programming
|
#include <HCI.hh>
Public Types | |
enum | InterruptMode { ON_LOW_LEVEL_MODE = 0, ON_CHANGE_MODE = _BV(ISC00), ON_FALLING_MODE = _BV(ISC01), ON_RISING_MODE = (_BV(ISC01) | _BV(ISC00)) } |
enum | Mode { OUTPUT_MODE = 0, INPUT_MODE = 1 } |
enum | Direction { MSB_FIRST = 0, LSB_FIRST = 1 } |
Public Member Functions | |
IRQPin (Board::ExternalInterruptPin pin, HCI *hci) | |
virtual void | on_interrupt (uint16_t arg) |
virtual void | enable () |
virtual void | disable () |
virtual void | clear () |
void | clear () const |
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 | 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 | 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 | |
volatile uint8_t *const | m_sfr |
const uint8_t | m_mask |
const uint8_t | m_pin |
Friends | |
class | HCI |
Handler for interrupt pin. Service interrupt on incoming HCI messages (DATA/EVNT).
|
inherited |
|
inherited |
Enumerator | |
---|---|
ON_LOW_LEVEL_MODE | |
ON_CHANGE_MODE | |
ON_FALLING_MODE | |
ON_RISING_MODE |
Definition at line 35 of file ExternalInterrupt.hh.
|
inherited |
|
inline |
|
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.
|
virtualinherited |
Clear external interrupt flag.
Reimplemented from Interrupt::Handler.
Definition at line 205 of file ExternalInterrupt.cpp.
|
inlineinherited |
|
inlinestaticinherited |
|
inlineprotectedinherited |
|
virtualinherited |
Disable external interrupt handler.
Reimplemented from Interrupt::Handler.
Definition at line 199 of file ExternalInterrupt.cpp.
|
virtualinherited |
Enable external interrupt handler.
Reimplemented from Interrupt::Handler.
Definition at line 190 of file ExternalInterrupt.cpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inlineinherited |
|
inlinestaticinherited |
Set output pin to mode.
[in] | pin | number. |
[in] | initial | value. |
Definition at line 56 of file OutputPin.hh.
|
inlineinherited |
|
inlinestaticinherited |
|
inlinestaticinherited |
|
inlineinherited |
|
inlineinherited |
|
inlinevirtual |
Signal that a packet has is ready and may be read.
[in] | arg | (not used). |
Reimplemented from ExternalInterrupt.
|
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 |