COSA
An Object-Oriented Platform for Arduino Programming
VWI.cpp File Reference
#include "VWI.hh"
Include dependency graph for VWI.cpp:

Go to the source code of this file.

Functions

static uint8_t timer_setting (uint16_t speed, uint8_t bits, uint16_t *nticks)
 
 ISR (TIMER1_COMPA_vect)
 

Variables

static const uint16_t prescale[] __PROGMEM
 

Detailed Description

Version
1.0

License

Copyright (C) 2008-2013, Mike McCauley (Author/VirtualWire rev. 1.19) Copyright (C) 2013-2015, Mikael Patel (Cosa C++ port and refactoring) Copyright (C) 2015, Mikael Patel (RF433 link quality indicator)

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

This file is part of the Arduino Che Cosa project.

Definition in file VWI.cpp.

Function Documentation

ISR ( TIMER1_COMPA_vect  )

Definition at line 153 of file VWI.cpp.

static uint8_t timer_setting ( uint16_t  speed,
uint8_t  bits,
uint16_t *  nticks 
)
static

Calculate timer setting, prescale and count value, given speed (bps), number of bits in timer. Returns zero(0) if fails otherwise prescale value/index, and timer top.

Parameters
[in]speedbits per second, transmitter/receiver.
[in]bitsnumber of bits in counter (8 or 16 bit timer).
[out]ntickstimer top value.
Returns
prescale or zero(0).

Definition at line 44 of file VWI.cpp.

Variable Documentation

const uint16_t prescale [] __PROGMEM
static
Initial value:
= {
0, 1, 8, 64, 256, 1024
}

Prescale table for Timer1. Index is prescale setting

Definition at line 26 of file VWI.cpp.