ccNOos  v0.0.0
Build Portable Microcontroller Applications!
Functions
APTmodule.c File Reference

IMS: ccNOos, Implementation for straight C More...

#include "APTmodule.h"
Include dependency graph for APTmodule.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct gpsStruct creategpsStruct ()
 
struct eCompStruct createeCompStruct ()
 
struct aptStruct createaptStruct ()
 
struct wmmStruct createwmmStruct ()
 
void tryReadAPTData (struct aptStruct *aptStructPtrIn)
 

Detailed Description

IMS: ccNOos, Implementation for straight C

Copyright 2021 InMechaSol, Inc

Licensed under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Notes: (.c includes .h) - for straight C or (.cpp includes .c which includes .h) - for C++ wrapped straight C Always compiled to a single compilation unit, either C or CPP, not both

Definition in file APTmodule.c.

Function Documentation

◆ createaptStruct()

struct aptStruct createaptStruct ( )

Definition at line 1 of file APTmodule.c.

50 {
51  struct aptStruct outStruct;
52  outStruct.eCompass = createeCompStruct();
53  outStruct.GPS = creategpsStruct();
54  return outStruct;
55 }

◆ createeCompStruct()

struct eCompStruct createeCompStruct ( )

Definition at line 1 of file APTmodule.c.

41 {
42  struct eCompStruct outStruct;
43  outStruct.devptr = nullptr;
44  outStruct.Connected = ui8FALSE;
45  outStruct.neweCompassData = ui8FALSE;
46  outStruct.data = createEcompDataStruct();
47  return outStruct;
48 }

◆ creategpsStruct()

struct gpsStruct creategpsStruct ( )

Definition at line 1 of file APTmodule.c.

32 {
33  struct gpsStruct outStruct;
34  outStruct.devptr = nullptr;
35  outStruct.data = createGPSDataStruct();
36  outStruct.Connected = ui8FALSE;
37  outStruct.newGPSData = ui8FALSE;
38  return outStruct;
39 }

◆ createwmmStruct()

struct wmmStruct createwmmStruct ( )

Definition at line 1 of file APTmodule.c.

57 {
58  struct wmmStruct outStruct;
59  outStruct.magdeclination = 0;
60  outStruct.lastGoodThreshold = 0;
61  outStruct.lastGoodMultiplier = 0;
62  outStruct.lastGoodmagdeclination = 0;
63  outStruct.lastGoodlongitude = 0;
64  outStruct.lastGoodlatitude = 0;
65  outStruct.lastGoodaltitude = 0;
66  return outStruct;
67 }

◆ tryReadAPTData()

void tryReadAPTData ( struct aptStruct aptStructPtrIn)

Definition at line 69 of file APTmodule.c.

70 {
71  // try read gps, if got string(s)
72  if (readGPS(&aptStructPtrIn->GPS))
73  {
74  // try parse strings
75  if (tryParseGPSData(&aptStructPtrIn->GPS.devptr->devdata.inbuff.charbuff[0], &aptStructPtrIn->GPS.data))
76  {
77  aptStructPtrIn->GPS.newGPSData = ui8TRUE; // this signals to state machine that new gps data is available from gps device
78  }
79  aptStructPtrIn->GPS.devptr->devdata.newDataReadIn = ui8FALSE;
80  }
81  // try read eCompass, if got string(s)
82  if (readEcompass(&aptStructPtrIn->eCompass))
83  {
84  // try parse strings
85  if (tryParseEcompData(&aptStructPtrIn->eCompass.devptr->devdata.inbuff.charbuff[0], &aptStructPtrIn->eCompass.data))
86  {
87  aptStructPtrIn->eCompass.neweCompassData = ui8TRUE; // this signals to state machine that new gps data is available from gps device
88  }
89  aptStructPtrIn->eCompass.devptr->devdata.newDataReadIn = ui8FALSE;
90  }
91 }
creategpsStruct
struct gpsStruct creategpsStruct()
Definition: APTmodule.c:31
tryParseEcompData
UI_8 tryParseEcompData(char *eCompStringin, struct eCompDataStruct *eCompDataPtr)
Definition: HMR3300.c:43
tryParseGPSData
UI_8 tryParseGPSData(char *gpsStringin, struct gpsData *gpsDataPtr)
Definition: NEO_LEA_M8T.c:227
eCompStruct::neweCompassData
UI_8 neweCompassData
Definition: APTmodule.h:50
wmmStruct::magdeclination
float magdeclination
Definition: APTmodule.h:67
gpsStruct::devptr
struct SerialDeviceStruct * devptr
Definition: APTmodule.h:38
readEcompass
UI_8 readEcompass(struct eCompStruct *eCompStructPtrIn)
Definition: Application_Platform_Main.c:74
devicedatastruct::inbuff
union devicebufferunion inbuff
Definition: io_device.h:63
ui8FALSE
#define ui8FALSE
Definition: version_config.h:190
devicebufferunion::charbuff
char charbuff[charBuffMax]
Definition: io_device.h:55
wmmStruct
Definition: APTmodule.h:66
createEcompDataStruct
struct eCompDataStruct createEcompDataStruct()
Definition: HMR3300.c:29
readGPS
UI_8 readGPS(struct gpsStruct *gpsStructPtrIn)
Definition: Application_Platform_Main.c:73
eCompStruct::data
struct eCompDataStruct data
Definition: APTmodule.h:49
ui8TRUE
#define ui8TRUE
Definition: version_config.h:191
aptStruct::GPS
struct gpsStruct GPS
Definition: APTmodule.h:58
gpsStruct::data
struct gpsData data
Definition: APTmodule.h:39
createGPSDataStruct
struct gpsData createGPSDataStruct()
Definition: NEO_LEA_M8T.c:29
aptStruct
Definition: APTmodule.h:57
eCompStruct::devptr
struct SerialDeviceStruct * devptr
Definition: APTmodule.h:48
gpsStruct
Definition: APTmodule.h:37
eCompStruct
Definition: APTmodule.h:47
gpsStruct::newGPSData
UI_8 newGPSData
Definition: APTmodule.h:40
createeCompStruct
struct eCompStruct createeCompStruct()
Definition: APTmodule.c:40
devicedatastruct::newDataReadIn
UI_8 newDataReadIn
Definition: io_device.h:66
SerialDeviceStruct::devdata
struct devicedatastruct devdata
Definition: io_device.h:122
aptStruct::eCompass
struct eCompStruct eCompass
Definition: APTmodule.h:59