From 0fa20d417f2f45985d8ccbb435f634186984a91c Mon Sep 17 00:00:00 2001 From: Lakshmipriya23 Date: Thu, 20 Jun 2019 11:55:43 +0530 Subject: [PATCH] fix#173 --- src/Catena.h | 15 ++- src/Catena4617.h | 81 ++++++++++++ src/Catena4618.h | 81 ++++++++++++ src/CatenaBase.h | 19 ++- src/Catena_Platforms.h | 11 +- src/lib/Catena_FramStorage.cpp | 14 +-- .../catena461x/Catena4617_ReadVoltage.cpp | 116 ++++++++++++++++++ .../Catena4617_getPlatformTable.cpp | 103 ++++++++++++++++ .../catena461x/Catena4618_ReadVoltage.cpp | 116 ++++++++++++++++++ .../Catena4618_getPlatformTable.cpp | 103 ++++++++++++++++ 10 files changed, 640 insertions(+), 19 deletions(-) create mode 100644 src/Catena4617.h create mode 100644 src/Catena4618.h create mode 100644 src/lib/stm32/catena461x/Catena4617_ReadVoltage.cpp create mode 100644 src/lib/stm32/catena461x/Catena4617_getPlatformTable.cpp create mode 100644 src/lib/stm32/catena461x/Catena4618_ReadVoltage.cpp create mode 100644 src/lib/stm32/catena461x/Catena4618_getPlatformTable.cpp diff --git a/src/Catena.h b/src/Catena.h index 4c2bcaf..0e06b36 100644 --- a/src/Catena.h +++ b/src/Catena.h @@ -1,4 +1,4 @@ -/* Catena.h Thu Nov 15 2018 15:06:41 chwon */ +/* Catena.h Tue Jun 18 2019 15:26:41 lakshmipriyan */ /* @@ -9,10 +9,10 @@ Module: Catena.h the target Catena for this build. Version: - V0.11.0 Thu Nov 15 2018 15:06:42 chwon Edit level 4 + V0.12.0 Tue Jun 18 2019 15:26:41 lakshmipriyan Edit level 5 Copyright notice: - This file copyright (C) 2017-2018 by + This file copyright (C) 2017-2019 by MCCI Corporation 3520 Krums Corners Road @@ -39,6 +39,9 @@ Revision history: 0.11.0 Thu Nov 15 2018 15:06:42 chwon Add Catena 461x support. + 0.12.0 Tue Jun 18 2019 15:26:41 lakshmipriyan + Add Catena 4617 & 4618 support. + */ #ifndef _CATENA_H_ /* prevent multiple includes */ @@ -76,6 +79,12 @@ Revision history: #elif defined(ARDUINO_MCCI_CATENA_4612) || defined(ARDUINO_CATENA_4612) # include "Catena4612.h" # define CATENA_H_SUPER_ McciCatena::Catena4612 +#elif defined(ARDUINO_MCCI_CATENA_4617) +# include "Catena4617.h" +# define CATENA_H_SUPER_ McciCatena::Catena4617 +#elif defined(ARDUINO_MCCI_CATENA_4618) +# include "Catena4618.h" +# define CATENA_H_SUPER_ McciCatena::Catena4618 #elif defined(ARDUINO_MCCI_CATENA_4801) || defined(ARDUINO_CATENA_4801) # include "Catena4801.h" # define CATENA_H_SUPER_ McciCatena::Catena4801 diff --git a/src/Catena4617.h b/src/Catena4617.h new file mode 100644 index 0000000..d971031 --- /dev/null +++ b/src/Catena4617.h @@ -0,0 +1,81 @@ +/* Catena4617.h Tue Jun 18 2019 13:58:19 lakshmipriyan */ + +/* + +Module: Catena4617.h + +Function: + class Catena4617: CatenaBase Platform to represent a Catena 4617 + +Version: + V0.11.0 Tue Jun 18 2019 13:58:19 lakshmipriyan Edit level 1 + +Copyright notice: + This file copyright (C) 2019 by + + MCCI Corporation + 3520 Krums Corners Road + Ithaca, NY 14850 + + An unpublished work. All rights reserved. + + This file is proprietary information, and may not be disclosed or + copied without the prior permission of MCCI Corporation + +Author: + Lakshmi priya Natarajan, MCCI Corporation June 2019 + +Revision history: + 0.11.0 Tue Jun 18 2019 13:58:19 lakshmipriyan + Module created. + +*/ + +#ifndef _Catena4617_H_ /* prevent multiple includes */ +#define _Catena4617_H_ + +#pragma once + +#ifndef _CATENA461X_H_ +# include "Catena461x.h" +#endif + +namespace McciCatena { + +class Catena4617 : public Catena461x + { +public: + using Super = Catena461x; + + // no specific constructor. + Catena4617() {}; + + // uses default destructor + + // neither copyable nor movable + Catena4617(const Catena4617&) = delete; + Catena4617& operator=(const Catena4617&) = delete; + Catena4617(const Catena4617&&) = delete; + Catena4617& operator=(const Catena4617&&) = delete; + + virtual const char *CatenaName() const override { return "Catena 4617"; }; + virtual float ReadVbat(void) const override; + virtual float ReadVbus(void) const override; + +protected: + // we are required to provide a table of platforms + virtual void getPlatformTable( + const CATENA_PLATFORM * const * &vPlatforms, + size_t &nvPlatforms + ) override; + +private: + // the known platforms + static const CATENA_PLATFORM(* const vPlatforms[]); + static const size_t nvPlatforms; + }; + +} // namespace McciCatena + +/**** end of Catena4617.h ****/ +#endif /* _Catena4617_H_ */ diff --git a/src/Catena4618.h b/src/Catena4618.h new file mode 100644 index 0000000..27cda43 --- /dev/null +++ b/src/Catena4618.h @@ -0,0 +1,81 @@ +/* Catena4618.h Tue Jun 18 2019 15:28:10 lakshmipriyan */ + +/* + +Module: Catena4618.h + +Function: + class Catena4618: CatenaBase Platform to represent a Catena 4618 + +Version: + V0.11.0 Tue Jun 18 2019 15:28:10 lakshmipriyan Edit level 1 + +Copyright notice: + This file copyright (C) 2019 by + + MCCI Corporation + 3520 Krums Corners Road + Ithaca, NY 14850 + + An unpublished work. All rights reserved. + + This file is proprietary information, and may not be disclosed or + copied without the prior permission of MCCI Corporation + +Author: + Lakshmi priya Natarajan, MCCI Corporation June 2019 + +Revision history: + 0.11.0 Tue Jun 18 2019 15:28:10 lakshmipriyan + Module created. + +*/ + +#ifndef _Catena4618_H_ /* prevent multiple includes */ +#define _Catena4618_H_ + +#pragma once + +#ifndef _CATENA461X_H_ +# include "Catena461x.h" +#endif + +namespace McciCatena { + +class Catena4618 : public Catena461x + { +public: + using Super = Catena461x; + + // no specific constructor. + Catena4618() {}; + + // uses default destructor + + // neither copyable nor movable + Catena4618(const Catena4618&) = delete; + Catena4618& operator=(const Catena4618&) = delete; + Catena4618(const Catena4618&&) = delete; + Catena4618& operator=(const Catena4618&&) = delete; + + virtual const char *CatenaName() const override { return "Catena 4618"; }; + virtual float ReadVbat(void) const override; + virtual float ReadVbus(void) const override; + +protected: + // we are required to provide a table of platforms + virtual void getPlatformTable( + const CATENA_PLATFORM * const * &vPlatforms, + size_t &nvPlatforms + ) override; + +private: + // the known platforms + static const CATENA_PLATFORM(* const vPlatforms[]); + static const size_t nvPlatforms; + }; + +} // namespace McciCatena + +/**** end of Catena4618.h ****/ +#endif /* _Catena4618_H_ */ diff --git a/src/CatenaBase.h b/src/CatenaBase.h index bfedeff..43b0316 100644 --- a/src/CatenaBase.h +++ b/src/CatenaBase.h @@ -1,4 +1,4 @@ -/* CatenaBase.h Wed Dec 05 2018 14:01:28 chwon */ +/* CatenaBase.h Tue Jun 18 2019 12:05:25 lakshmipriyan */ /* @@ -8,17 +8,17 @@ Module: CatenaBase.h class CatenaBase interfaces. Version: - V0.12.0 Wed Dec 05 2018 14:01:28 chwon Edit level 6 + V0.12.0 Tue Jun 18 2019 12:05:25 lakshmipriyan Edit level 7 Copyright notice: - This file copyright (C) 2016-2018 by + This file copyright (C) 2016-2019 by MCCI Corporation 3520 Krums Corners Road Ithaca, NY 14850 An unpublished work. All rights reserved. - + This file is released under terms of the accompanying LICENSE file. Author: @@ -47,6 +47,9 @@ Revision history: Add getFram() method and FRAM access methods. Move CPUID_PLATFORM_MAP structure and related methods. + 0.13.0 Tue Jun 18 2019 12:05:25 lakshmipriyan + Add support for fHasHS001 & fHasSHT3x. + */ #ifndef _CATENABASE_H_ /* prevent multiple includes */ @@ -91,7 +94,7 @@ Revision history: #define CATENA_ARDUINO_PLATFORM_VERSION_CALC(major, minor, patch, local) \ (((major) << 24u) | ((minor) << 16u) | ((patch) << 8u) | (local)) -#define CATENA_ARDUINO_PLATFORM_VERSION CATENA_ARDUINO_PLATFORM_VERSION_CALC(0, 14, 0, 70) /* v0.14.0.70 */ +#define CATENA_ARDUINO_PLATFORM_VERSION CATENA_ARDUINO_PLATFORM_VERSION_CALC(0, 14, 0, 63) /* v0.14.0.63 */ #define CATENA_ARDUINO_PLATFORM_VERSION_GET_MAJOR(v) \ (((v) >> 24u) & 0xFFu) @@ -188,11 +191,15 @@ class CatenaBase fHasLuxSi1113 = fHasLuxSi1133, // platform has BME680 fHasBme680 = 1 << 15, - // platform has RS485 on Serial1, with A3 + // platform has RS485 on Serial1, with A3 // controlling power and A4 controlling TXE fHasRS485 = 1 << 16, // platform uses A2 to control VOUT1 (on terminals) fHasVout1 = 1 << 17, + //platform has IDT HS001 + fHasHS001 = 1 << 18, + //platform has SHT3x sensirion + fHasSHT3x = 1 << 19, // special wiring variants all are offsets from M100... // we support up to 127 variants, becuase we have 7 diff --git a/src/Catena_Platforms.h b/src/Catena_Platforms.h index 3a04c14..913ce17 100644 --- a/src/Catena_Platforms.h +++ b/src/Catena_Platforms.h @@ -1,4 +1,4 @@ -/* Catena_Platforms.h Thu Nov 15 2018 15:24:45 chwon */ +/* Catena_Platforms.h Tue Jun 18 2019 12:30:18 lakshmipriyan */ /* @@ -8,10 +8,10 @@ Module: Catena_Platforms.h The global platform definitions. Version: - V0.11.0 Thu Nov 15 2018 15:24:45 chwon Edit level 9 + V0.12.0 Tue Jun 18 2019 12:30:18 lakshmipriyan Edit level 9 Copyright notice: - This file copyright (C) 2016-2018 by + This file copyright (C) 2016-2019 by MCCI Corporation 3520 Krums Corners Road @@ -47,6 +47,9 @@ Revision history: 0.11.0 Thu Nov 15 2018 15:24:45 chwon Add Catena 461x support. + 0.12.0 Tue Jun 18 2019 12:30:18 lakshmipriyan + Add Catena 4617 & 4618 support. + */ #ifndef _CATENA_PLATFORMS_H_ /* prevent multiple includes */ @@ -104,6 +107,8 @@ extern const CATENA_PLATFORM gkPlatformCatena4612_m101; extern const CATENA_PLATFORM gkPlatformCatena4612_m102; extern const CATENA_PLATFORM gkPlatformCatena4612_m103; extern const CATENA_PLATFORM gkPlatformCatena4612_m104; +extern const CATENA_PLATFORM gkPlatformCatena4617; +extern const CATENA_PLATFORM gkPlatformCatena4618; extern const CATENA_PLATFORM gkPlatformCatena4801; diff --git a/src/lib/Catena_FramStorage.cpp b/src/lib/Catena_FramStorage.cpp index 4b63be5..42625eb 100644 --- a/src/lib/Catena_FramStorage.cpp +++ b/src/lib/Catena_FramStorage.cpp @@ -18,10 +18,10 @@ Copyright notice: Ithaca, NY 14850 An unpublished work. All rights reserved. - + This file is proprietary information, and may not be disclosed or copied without the prior permission of MCCI Corporation. - + Author: Terry Moore, MCCI Corporation March 2017 @@ -46,7 +46,7 @@ using namespace McciCatena; const MCCIADK_GUID_WIRE McciCatena::cFramStorage::skFramGuid = GUID_FRAM_CATENA_V1(WIRE); -const cFramStorage::StandardItem +const cFramStorage::StandardItem McciCatena::cFramStorage::vItemDefs[cFramStorage::kMAX] = { cFramStorage::StandardItem(kHeader, sizeof(uint32_t), /* number */ true), @@ -66,7 +66,7 @@ McciCatena::cFramStorage::vItemDefs[cFramStorage::kMAX] = cFramStorage::StandardItem(kBootCount, sizeof(uint32_t), /* number */ true), cFramStorage::StandardItem(kOperatingFlags, sizeof(uint32_t), /* number */ true), - /* the size field should match BSEC_MAX_STATE_BLOB_SIZE, whcich is 139 */ + /* the size field should match BSEC_MAX_STATE_BLOB_SIZE, whcich is 65 */ cFramStorage::StandardItem(kBme680Cal, 139, /* number */ false), }; @@ -162,13 +162,13 @@ Name: McciCatena::cFramStorage::Object::matchesGuid() Check whether this object is identified by given GUID. Definition: - public: bool + public: bool McciCatena::cFramStorage::Object::matchesGuid( const MCCIADK_GUID_WIRE &guid ) const; Description: - Simply compares the GUID to the one in the object. + Simply compares the GUID to the one in the object. Returns: true for equality. @@ -183,7 +183,7 @@ Name: McciCatena::cFramStorage::Object::matchesGuid() */ -bool +bool McciCatena::cFramStorage::Object::matchesGuid( const MCCIADK_GUID_WIRE &guid ) const diff --git a/src/lib/stm32/catena461x/Catena4617_ReadVoltage.cpp b/src/lib/stm32/catena461x/Catena4617_ReadVoltage.cpp new file mode 100644 index 0000000..0001886 --- /dev/null +++ b/src/lib/stm32/catena461x/Catena4617_ReadVoltage.cpp @@ -0,0 +1,116 @@ +/* Catena4617_ReadAnalog.cpp Tue Jun 18 2019 14:01:42 lakshmipriyan */ + +/* + +Module: Catena4617_ReadAnalog.cpp + +Function: + Catena4617::ReadVbat() and Catena4617::ReadVbus() + +Version: + V0.11.0 Tue Jun 18 2019 14:01:42 lakshmipriyan Edit level 1 + +Copyright notice: + This file copyright (C) 2019 by + + MCCI Corporation + 3520 Krums Corners Road + Ithaca, NY 14850 + + An unpublished work. All rights reserved. + + This file is proprietary information, and may not be disclosed or + copied without the prior permission of MCCI Corporation + +Author: + Lakshmi priya Natarajan, MCCI Corporation June 2019 + +Revision history: + 0.11.0 Tue Jun 18 2019 14:01:42 lakshmipriyan + Module created. + +*/ + +#ifdef ARDUINO_ARCH_STM32 + +#include "Catena4617.h" +#include "Catena_Log.h" + +#include +using namespace McciCatena; + +/****************************************************************************\ +| +| Manifest constants & typedefs. +| +| This is strictly for private types and constants which will not +| be exported. +| +\****************************************************************************/ + + + +/****************************************************************************\ +| +| Read-only data. +| +| If program is to be ROM-able, these must all be tagged read-only +| using the ROM storage class; they may be global. +| +\****************************************************************************/ + + + +/****************************************************************************\ +| +| VARIABLES: +| +| If program is to be ROM-able, these must be initialized +| using the BSS keyword. (This allows for compilers that require +| every variable to have an initializer.) Note that only those +| variables owned by this module should be declared here, using the BSS +| keyword; this allows for linkers that dislike multiple declarations +| of objects. +| +\****************************************************************************/ + +float +Catena4617::ReadVbat(void) const + { + float volt = this->ReadAnalog(Catena461x::ANALOG_CHANNEL_VBAT, 1, 1); + return volt / 1000; + } + +float +Catena4617::ReadVbus(void) const + { + // on the Catena 4617, the Vbus divider impedance is very high, + // so charge transfer from the previous channel causes problems. + // Therefore, let's read one extra time; the prvious ADC will + // have had some time to bleed off. + float volt = this->ReadAnalog(Catena461x::ANALOG_CHANNEL_VBUS, 6, 3); + return volt / 1000; + } + +#if defined(ARDUINO_MCCI_CATENA_4617) && defined(USBD_LL_ConnectionState_WEAK) + +extern "C" { + +uint32_t USBD_LL_ConnectionState(void) + { + uint32_t vBus; + bool fStatus; + + fStatus = CatenaStm32L0_ReadAnalog( + Catena461x::ANALOG_CHANNEL_VBUS, 6, 3, &vBus + ); + return (fStatus && vBus < 3000) ? 0 : 1; + } + +} + +#endif // ARDUINO_MCCI_CATENA_4617 + +#endif // ARDUINO_ARCH_STM32 + +/**** end of Catena4617_ReadAnalog.cpp ****/ diff --git a/src/lib/stm32/catena461x/Catena4617_getPlatformTable.cpp b/src/lib/stm32/catena461x/Catena4617_getPlatformTable.cpp new file mode 100644 index 0000000..e4fa2ea --- /dev/null +++ b/src/lib/stm32/catena461x/Catena4617_getPlatformTable.cpp @@ -0,0 +1,103 @@ +/* Catena4617_getPlatformTable.cpp Tue Jun 18 2019 17:27:02 lakshmipriyan */ + +/* + +Module: Catena4617_getPlatformTable.cpp + +Function: + Catena4617::getPlatformTable() + +Version: + V0.11.0 Tue Jun 18 2019 17:27:02 lakshmipriyan Edit level 1 + +Copyright notice: + This file copyright (C) 2019 by + + MCCI Corporation + 3520 Krums Corners Road + Ithaca, NY 14850 + + An unpublished work. All rights reserved. + + This file is proprietary information, and may not be disclosed or + copied without the prior permission of MCCI Corporation + +Author: + Lakshmi Priya Natarajan, MCCI Corporation June 2019 + +Revision history: + 0.11.0 Tue Jun 18 2019 17:27:02 lakshmipriyan + Module created. + +*/ + +#ifdef ARDUINO_ARCH_STM32 + +#include "Catena4617.h" + +#include "Catena_Log.h" +#include "Catena_Platforms.h" +#include "Catena_Guids.h" + +namespace McciCatena { + +const CATENA_PLATFORM gkPlatformCatena4617 = + { + Guid: GUID_HW_CATENA_4617_BASE(WIRE), + pParent: &gkPlatformCatena4617, + PlatformFlags: + CatenaBase::fHasLoRa | + CatenaBase::fHasTtnNycLoRa | + CatenaBase::fHasHS001 | + CatenaBase::fHasLuxSi1133 | + CatenaBase::fHasFRAM | + CatenaBase::fHasFlash + }; + +const CATENA_PLATFORM (* const Catena4617::vPlatforms[]) = + { + // entry 0 is the default + &gkPlatformCatena4617, + }; + +const size_t Catena4617::nvPlatforms = sizeof(Catena4617::vPlatforms) / sizeof(Catena4617::vPlatforms[0]); + +/* + +Name: Catena4617::getPlatformTable() + +Function: + Get the known platform table. + +Definition: + public: virtual + void Catena4617::getPlatformTable( + const CATENA_PLATFORM * const * &vPlatforms, + size_t &nvPlatforms + ) override; + +Description: + This override for getPlatformTable() returns the vector of platform + GUIDs for this Catena. + +Returns: + vPlatforms is set to the base of the array of pointers to platform + stuctures; and nvPlatforms is set to the number of entries in + the table. + +*/ + +/* public virtual override */ +void +Catena4617::getPlatformTable( + const CATENA_PLATFORM * const * &result_vPlatforms, + size_t &result_nvPlatforms + ) + { + result_vPlatforms = vPlatforms; + result_nvPlatforms = nvPlatforms; + } + +} /* namespace McciCatena */ + +#endif // ARDUINO_ARCH_STM32 diff --git a/src/lib/stm32/catena461x/Catena4618_ReadVoltage.cpp b/src/lib/stm32/catena461x/Catena4618_ReadVoltage.cpp new file mode 100644 index 0000000..0ba31f0 --- /dev/null +++ b/src/lib/stm32/catena461x/Catena4618_ReadVoltage.cpp @@ -0,0 +1,116 @@ +/* Catena4618_ReadAnalog.cpp Tue Jun 18 2019 14:01:42 lakshmipriyan */ + +/* + +Module: Catena4618_ReadAnalog.cpp + +Function: + Catena4618::ReadVbat() and Catena4618::ReadVbus() + +Version: + V0.13.0 Tue Jun 18 2019 14:01:42 lakshmipriyan Edit level 1 + +Copyright notice: + This file copyright (C) 2019 by + + MCCI Corporation + 3520 Krums Corners Road + Ithaca, NY 14850 + + An unpublished work. All rights reserved. + + This file is proprietary information, and may not be disclosed or + copied without the prior permission of MCCI Corporation + +Author: + Lakshmi priya Natarajan, MCCI Corporation June 2019 + +Revision history: + 0.13.0 Tue Jun 18 2019 14:01:42 lakshmipriyan + Module created. + +*/ + +#ifdef ARDUINO_ARCH_STM32 + +#include "Catena4618.h" +#include "Catena_Log.h" + +#include +using namespace McciCatena; + +/****************************************************************************\ +| +| Manifest constants & typedefs. +| +| This is strictly for private types and constants which will not +| be exported. +| +\****************************************************************************/ + + + +/****************************************************************************\ +| +| Read-only data. +| +| If program is to be ROM-able, these must all be tagged read-only +| using the ROM storage class; they may be global. +| +\****************************************************************************/ + + + +/****************************************************************************\ +| +| VARIABLES: +| +| If program is to be ROM-able, these must be initialized +| using the BSS keyword. (This allows for compilers that require +| every variable to have an initializer.) Note that only those +| variables owned by this module should be declared here, using the BSS +| keyword; this allows for linkers that dislike multiple declarations +| of objects. +| +\****************************************************************************/ + +float +Catena4618::ReadVbat(void) const + { + float volt = this->ReadAnalog(Catena461x::ANALOG_CHANNEL_VBAT, 1, 1); + return volt / 1000; + } + +float +Catena4618::ReadVbus(void) const + { + // on the Catena 4618, the Vbus divider impedance is very high, + // so charge transfer from the previous channel causes problems. + // Therefore, let's read one extra time; the prvious ADC will + // have had some time to bleed off. + float volt = this->ReadAnalog(Catena461x::ANALOG_CHANNEL_VBUS, 6, 3); + return volt / 1000; + } + +#if defined(ARDUINO_MCCI_CATENA_4618) && defined(USBD_LL_ConnectionState_WEAK) + +extern "C" { + +uint32_t USBD_LL_ConnectionState(void) + { + uint32_t vBus; + bool fStatus; + + fStatus = CatenaStm32L0_ReadAnalog( + Catena461x::ANALOG_CHANNEL_VBUS, 6, 3, &vBus + ); + return (fStatus && vBus < 3000) ? 0 : 1; + } + +} + +#endif // ARDUINO_MCCI_CATENA_4618 + +#endif // ARDUINO_ARCH_STM32 + +/**** end of Catena4618_ReadAnalog.cpp ****/ diff --git a/src/lib/stm32/catena461x/Catena4618_getPlatformTable.cpp b/src/lib/stm32/catena461x/Catena4618_getPlatformTable.cpp new file mode 100644 index 0000000..591858b --- /dev/null +++ b/src/lib/stm32/catena461x/Catena4618_getPlatformTable.cpp @@ -0,0 +1,103 @@ +/* Catena4618_getPlatformTable.cpp Tue Jun 18 2019 17:27:02 lakshmipriyan */ + +/* + +Module: Catena4618_getPlatformTable.cpp + +Function: + Catena4618::getPlatformTable() + +Version: + V0.11.0 Tue Jun 18 2019 17:27:02 lakshmipriyan Edit level 1 + +Copyright notice: + This file copyright (C) 2019 by + + MCCI Corporation + 3520 Krums Corners Road + Ithaca, NY 14850 + + An unpublished work. All rights reserved. + + This file is proprietary information, and may not be disclosed or + copied without the prior permission of MCCI Corporation + +Author: + Lakshmi Priya Natarajan, MCCI Corporation June 2019 + +Revision history: + 0.11.0 Tue Jun 18 2019 17:27:02 lakshmipriyan + Module created. + +*/ + +#ifdef ARDUINO_ARCH_STM32 + +#include "Catena4618.h" + +#include "Catena_Log.h" +#include "Catena_Platforms.h" +#include "Catena_Guids.h" + +namespace McciCatena { + +const CATENA_PLATFORM gkPlatformCatena4618 = + { + Guid: GUID_HW_CATENA_4618_BASE(WIRE), + pParent: &gkPlatformCatena4618, + PlatformFlags: + CatenaBase::fHasLoRa | + CatenaBase::fHasTtnNycLoRa | + CatenaBase::fHasSHT3x | + CatenaBase::fHasLuxSi1133 | + CatenaBase::fHasFRAM | + CatenaBase::fHasFlash + }; + +const CATENA_PLATFORM (* const Catena4618::vPlatforms[]) = + { + // entry 0 is the default + &gkPlatformCatena4618, + }; + +const size_t Catena4618::nvPlatforms = sizeof(Catena4618::vPlatforms) / sizeof(Catena4618::vPlatforms[0]); + +/* + +Name: Catena4618::getPlatformTable() + +Function: + Get the known platform table. + +Definition: + public: virtual + void Catena4618::getPlatformTable( + const CATENA_PLATFORM * const * &vPlatforms, + size_t &nvPlatforms + ) override; + +Description: + This override for getPlatformTable() returns the vector of platform + GUIDs for this Catena. + +Returns: + vPlatforms is set to the base of the array of pointers to platform + stuctures; and nvPlatforms is set to the number of entries in + the table. + +*/ + +/* public virtual override */ +void +Catena4618::getPlatformTable( + const CATENA_PLATFORM * const * &result_vPlatforms, + size_t &result_nvPlatforms + ) + { + result_vPlatforms = vPlatforms; + result_nvPlatforms = nvPlatforms; + } + +} /* namespace McciCatena */ + +#endif // ARDUINO_ARCH_STM32