Demo HCI Implementation for WiMOD-LR Devices  V1.3.1
FreqCalc.c File Reference

Helper Utility to calc frequency to transceiver register and vice versa. More...

#include "FreqCalc.h"
Include dependency graph for FreqCalc.c:

Functions

void FreqCalc_calcFreqToRegister (uint32_t freq, uint8_t *msb, uint8_t *mid, uint8_t *lsb)
 Translates a given frequency to the according register values of the TRX. More...
 
uint32_t FreqCalc_calcRegisterToFreq (uint8_t msb, uint8_t mid, uint8_t lsb)
 Translates given register values to a carrier frequency. More...
 

Detailed Description

Helper Utility to calc frequency to transceiver register and vice versa.

Version
0.1

Implementation of frequency calculator

Author
(FB), IMST
Version
0.1

Declarations for frequency calculator

Author
(FB), IMST

Function Documentation

void FreqCalc_calcFreqToRegister ( uint32_t  freq,
uint8_t *  msb,
uint8_t *  mid,
uint8_t *  lsb 
)

Translates a given frequency to the according register values of the TRX.

Note: This is not 100% exact. (see formula in TRX datasheet)

Parameters
freqRF mid frequency in Hz
msbpointer where to store the MSB register value
midpointer where to store the MID register value
msbpointer where to store the LSB register value
uint32_t FreqCalc_calcRegisterToFreq ( uint8_t  msb,
uint8_t  mid,
uint8_t  lsb 
)

Translates given register values to a carrier frequency.

: This is not 100% exact. (see formula in TRX datasheet) *

Parameters
msbthe MSB register value
midthe MID register value
msbthe LSB register value
Return values
thecorresponding frequency in Hz