Updated dev files for RadioLib 3.x
This commit is contained in:
parent
030ea09c17
commit
97136945a7
5 changed files with 25 additions and 25 deletions
|
@ -8,16 +8,17 @@ int16_t SIM800::begin(long speed) {
|
||||||
// set module properties
|
// set module properties
|
||||||
_mod->AtLineFeed = "\r\n";
|
_mod->AtLineFeed = "\r\n";
|
||||||
_mod->baudrate = speed;
|
_mod->baudrate = speed;
|
||||||
_mod->init(USE_UART, INT_0);
|
_mod->init(RADIOLIB_USE_UART);
|
||||||
|
Module::pinMode(_mod->getIrq(), INPUT);
|
||||||
|
|
||||||
// empty UART buffer (garbage data)
|
// empty UART buffer (garbage data)
|
||||||
_mod->ATemptyBuffer();
|
_mod->ATemptyBuffer();
|
||||||
|
|
||||||
// power on
|
// power on
|
||||||
pinMode(_mod->getInt0(), OUTPUT);
|
Module::pinMode(_mod->getIrq(), OUTPUT);
|
||||||
digitalWrite(_mod->getInt0(), LOW);
|
Module::digitalWrite(_mod->getIrq(), LOW);
|
||||||
delay(1000);
|
delay(1000);
|
||||||
pinMode(_mod->getInt0(), INPUT);
|
Module::pinMode(_mod->getIrq(), INPUT);
|
||||||
|
|
||||||
// test AT setup
|
// test AT setup
|
||||||
if(!_mod->ATsendCommand("AT")) {
|
if(!_mod->ATsendCommand("AT")) {
|
||||||
|
@ -34,10 +35,10 @@ int16_t SIM800::begin(long speed) {
|
||||||
|
|
||||||
void SIM800::shutdown() {
|
void SIM800::shutdown() {
|
||||||
// power off
|
// power off
|
||||||
pinMode(_mod->getInt0(), OUTPUT);
|
Module::pinMode(_mod->getIrq(), OUTPUT);
|
||||||
digitalWrite(_mod->getInt0(), LOW);
|
Module::digitalWrite(_mod->getIrq(), LOW);
|
||||||
delay(1500);
|
delay(1000);
|
||||||
pinMode(_mod->getInt0(), INPUT);
|
Module::pinMode(_mod->getIrq(), INPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t SIM800::sendSMS(const char* num, const char* msg) {
|
int16_t SIM800::sendSMS(const char* num, const char* msg) {
|
||||||
|
|
|
@ -43,8 +43,7 @@ int16_t PSKClient::begin(int pin, float carrier, float rate, uint16_t audioFreq)
|
||||||
_bitDuration = (uint32_t)(1000000.0/rate);
|
_bitDuration = (uint32_t)(1000000.0/rate);
|
||||||
|
|
||||||
// calculate 24-bit frequency
|
// calculate 24-bit frequency
|
||||||
uint32_t mult = 1;
|
_carrier = (carrier * 1000000.0) / _phy->getFreqStep();
|
||||||
_carrier = (carrier * (mult << _phy->getDivExponent())) / _phy->getCrystalFreq();
|
|
||||||
|
|
||||||
// set FSK frequency deviation to 0
|
// set FSK frequency deviation to 0
|
||||||
int16_t state = _phy->setFrequencyDeviation(0);
|
int16_t state = _phy->setFrequencyDeviation(0);
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#ifndef _KITELIB_PSK_H
|
#ifndef _KITELIB_PSK_H
|
||||||
#define _KITELIB_PSK_H
|
#define _KITELIB_PSK_H
|
||||||
|
|
||||||
#include "TypeDef.h"
|
#include "../../TypeDef.h"
|
||||||
#include "PhysicalLayer.h"
|
#include "../PhysicalLayer/PhysicalLayer.h"
|
||||||
|
|
||||||
// Varicode character table: - position in table corresponds to ASCII code
|
// Varicode character table: - position in table corresponds to ASCII code
|
||||||
// - value in table corresponds to Varicode code
|
// - value in table corresponds to Varicode code
|
||||||
|
|
|
@ -9,10 +9,10 @@ int16_t PagerClient::begin(float base, uint16_t speed) {
|
||||||
_bitDuration = (uint32_t)1000000/speed;
|
_bitDuration = (uint32_t)1000000/speed;
|
||||||
|
|
||||||
// calculate 24-bit frequency
|
// calculate 24-bit frequency
|
||||||
_base = (base * (uint32_t(1) << _phy->getDivExponent())) / _phy->getCrystalFreq();
|
_base = (base * 1000000.0) / _phy->getFreqStep();
|
||||||
|
|
||||||
// calculate module carrier frequency resolution
|
// calculate module carrier frequency resolution
|
||||||
uint16_t step = round((_phy->getCrystalFreq() * 1000000) / (uint32_t(1) << _phy->getDivExponent()));
|
uint16_t step = round(_phy->getFreqStep());
|
||||||
|
|
||||||
// calculate raw frequency shift
|
// calculate raw frequency shift
|
||||||
_shift = FREQ_SHIFT_HZ/step;
|
_shift = FREQ_SHIFT_HZ/step;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#ifndef _RADIOLIB_PAGER_H
|
#ifndef _RADIOLIB_PAGER_H
|
||||||
#define _RADIOLIB_PAGER_H
|
#define _RADIOLIB_PAGER_H
|
||||||
|
|
||||||
#include "TypeDef.h"
|
#include "../../TypeDef.h"
|
||||||
#include "PhysicalLayer.h"
|
#include "../PhysicalLayer/PhysicalLayer.h"
|
||||||
|
|
||||||
// supported encoding schemes
|
// supported encoding schemes
|
||||||
#define ASCII 0
|
#define ASCII 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue