ccNOos  v0.0.0
Build Portable Microcontroller Applications!
TPMmodule.c
Go to the documentation of this file.
1 /** \file TPMmodule.c
2 * \brief <a href="https://www.inmechasol.org/" target="_blank">IMS</a>:
3  <a href="https://github.com/InMechaSol/ccNOos" target="_blank">ccNOos</a>,
4  Implementation for straight C
5 
6  Copyright 2021 <a href="https://www.inmechasol.org/" target="_blank">InMechaSol, Inc</a>
7 
8  Licensed under the Apache License, Version 2.0(the "License");
9  you may not use this file except in compliance with the License.
10  You may obtain a copy of the License at
11 
12  http://www.apache.org/licenses/LICENSE-2.0
13 
14  Unless required by applicable law or agreed to in writing, software
15  distributed under the License is distributed on an "AS IS" BASIS,
16  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  See the License for the specific language governing permissions and
18  limitations under the License.
19 
20 Notes:
21  (.c includes .h) - for straight C or
22  (.cpp includes .c which includes .h) - for C++ wrapped straight C
23  *Always compiled to a single compilation unit, either C or CPP, not both
24 
25 */
26 
27 #include "TPMmodule.h"
28 
29 
31 {
32  struct freqConvStruct outStruct;
33  outStruct.data = CreateADRF6650Data();
34  outStruct.newFreqConvData = ui8FALSE;
35  return outStruct;
36 }
38 {
39  struct powerMeterStruct outStruct;
40  outStruct.data.BandwidthMHz = 0;
41  outStruct.newPowerMeterValue = ui8FALSE;
42  outStruct.data.PowerMeasuredinBanddB = 0;
43  outStruct.data.current_value = 0;
44  outStruct.data.value_good = ui8FALSE;
45  return outStruct;
46 }
48 {
49  struct tpmStruct outStruct;
50  outStruct.freqConverter = createfreqConvStruct();
51  outStruct.powerMeter = createPowerMeterStruct();
52  return outStruct;
53 }
54 
55 void tryReadTPMData(struct tpmStruct* tpmStructPtrIn)
56 {
57  readFreqConv(&tpmStructPtrIn->freqConverter);
58  readPowerMeter(&tpmStructPtrIn->powerMeter);
59 }
60 
61 void tryWriteTPMData(struct tpmStruct* tpmStructPtrIn)
62 {
63  writeFreqConv(&tpmStructPtrIn->freqConverter);
64  writePowerMeter(&tpmStructPtrIn->powerMeter);
65 }
LTC2360DataStruct::BandwidthMHz
float BandwidthMHz
Definition: LTC2360.h:35
freqConvStruct::newFreqConvData
UI_8 newFreqConvData
Definition: TPMmodule.h:39
createtpmStruct
struct tpmStruct createtpmStruct()
Definition: TPMmodule.c:47
tryWriteTPMData
void tryWriteTPMData(struct tpmStruct *tpmStructPtrIn)
Definition: TPMmodule.c:61
readFreqConv
void readFreqConv(struct freqConvStruct *freqConvStructPtrIn)
Definition: Application_Platform_Main.c:75
writeFreqConv
void writeFreqConv(struct freqConvStruct *freqConvStructPtrIn)
Definition: Application_Platform_Main.c:76
TPMmodule.h
IMS: ccNOos, Declarations for straight C and C++
createPowerMeterStruct
struct powerMeterStruct createPowerMeterStruct()
Definition: TPMmodule.c:37
writePowerMeter
void writePowerMeter(struct powerMeterStruct *powerMeterStructPtrIn)
Definition: Application_Platform_Main.c:78
ui8FALSE
#define ui8FALSE
Definition: version_config.h:190
tryReadTPMData
void tryReadTPMData(struct tpmStruct *tpmStructPtrIn)
Definition: TPMmodule.c:55
CreateADRF6650Data
struct ADRF6650DataStruct CreateADRF6650Data()
Definition: ADRF6650.c:29
createfreqConvStruct
struct freqConvStruct createfreqConvStruct()
Definition: TPMmodule.c:30
powerMeterStruct
Definition: TPMmodule.h:46
tpmStruct
Definition: TPMmodule.h:56
tpmStruct::freqConverter
struct freqConvStruct freqConverter
Definition: TPMmodule.h:57
readPowerMeter
void readPowerMeter(struct powerMeterStruct *powerMeterStructPtrIn)
Definition: Application_Platform_Main.c:77
freqConvStruct
Definition: TPMmodule.h:36
tpmStruct::powerMeter
struct powerMeterStruct powerMeter
Definition: TPMmodule.h:58
powerMeterStruct::data
struct LTC2360DataStruct data
Definition: TPMmodule.h:48
freqConvStruct::data
struct ADRF6650DataStruct data
Definition: TPMmodule.h:38