Skip to content

Commit

Permalink
Merge pull request #174 from mcci-catena/issue135
Browse files Browse the repository at this point in the history
Fix #135: Added the Platform support for Catena 4630/4617/4618
  • Loading branch information
terrillmoore authored Jul 4, 2019
2 parents 8f3995d + c67d31a commit 1c5cf37
Show file tree
Hide file tree
Showing 18 changed files with 1,028 additions and 146 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ script:
- _notstm32l0 || arduino --verify $(_stm32l0opts mcci_catena_4611) $THISLIB/examples/catena_hello/catena_hello_lora.ino
- _notstm32l0 || arduino --verify $(_stm32l0opts mcci_catena_4612) $THISLIB/examples/catena_hello/catena_hello.ino
- _notstm32l0 || arduino --verify $(_stm32l0opts mcci_catena_4612) $THISLIB/examples/catena_hello/catena_hello_lora.ino
- _notstm32l0 || arduino --verify $(_stm32l0opts mcci_catena_4617) $THISLIB/examples/catena_hello/catena_hello.ino
- _notstm32l0 || arduino --verify $(_stm32l0opts mcci_catena_4617) $THISLIB/examples/catena_hello/catena_hello_lora.ino
- _notstm32l0 || arduino --verify $(_stm32l0opts mcci_catena_4618) $THISLIB/examples/catena_hello/catena_hello.ino
- _notstm32l0 || arduino --verify $(_stm32l0opts mcci_catena_4618) $THISLIB/examples/catena_hello/catena_hello_lora.ino
- _notstm32l0 || arduino --verify $(_stm32l0opts mcci_catena_4630) $THISLIB/examples/catena_hello/catena_hello.ino
- _notstm32l0 || arduino --verify $(_stm32l0opts mcci_catena_4630) $THISLIB/examples/catena_hello/catena_hello_lora.ino
- _notstm32l0 || arduino --verify $(_stm32l0opts mcci_catena_4801) $THISLIB/examples/catena_hello/catena_hello.ino
- _notstm32l0 || arduino --verify $(_stm32l0opts mcci_catena_4801) $THISLIB/examples/catena_hello/catena_hello_lora.ino

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ Class | Header File | Description
`Catena4610` | `Catena4610.h` | MCCI Catena 4610 second-generation Murata-based board with LiPo charging
`Catena4611` | `Catena4611.h` | MCCI Catena 4611 second-generation Murata-based board with fixed Vdd, no charging
`Catena4612` | `Catena4612.h` | MCCI Catena 4612 second-generation Murata-based board with variable Vdd, no charging.
`Catena4617` | `Catena4617.h` | MCCI Catena 4617 second-generation Murata-based board with variable Vdd, no charging
`Catena4618` | `Catena4618.h` | MCCI Catena 4618 second-generation Murata-based board with variable Vdd, no charging.
`Catena4630` | `Catena4630.h` | MCCI Catena 4630 Murata-based board with Air Quality Sensor.
`Catena4801` | `Catena4801.h` | MCCI Catena 4801 Murata-based board with Modbus.

### Class derivation
Expand Down
42 changes: 12 additions & 30 deletions src/Catena.h
Original file line number Diff line number Diff line change
@@ -1,43 +1,16 @@
/* Catena.h Thu Nov 15 2018 15:06:41 chwon */

/*
Module: Catena.h
Function:
class Catena: virtual CatenaBase derivative representing
class Catena: virtual CatenaBase derivative representing
the target Catena for this build.
Version:
V0.11.0 Thu Nov 15 2018 15:06:42 chwon Edit level 4
Copyright notice:
This file copyright (C) 2017-2018 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.
See accompanying LICENSE file.
Author:
ChaeHee Won, MCCI Corporation October 2017
Revision history:
0.6.0 Fri Oct 13 2017 15:19:30 chwon
Module created.
0.7.0 Wed Dec 13 2017 17:29:35 tmm
Refactor.
0.9.0 Sat Mar 31 2018 19:28:30 tmm
Add Catena 4460 support, use BSP symbols.
0.11.0 Thu Nov 15 2018 15:06:42 chwon
Add Catena 461x support.
ChaeHee Won, MCCI Corporation October 2017
*/

Expand Down Expand Up @@ -76,6 +49,15 @@ 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_4630)
# include "Catena4630.h"
# define CATENA_H_SUPER_ McciCatena::Catena4630
#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
Expand Down
66 changes: 66 additions & 0 deletions src/Catena4617.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
Module: Catena4617.h
Function:
class Catena4617: CatenaBase Platform to represent a Catena 4617
Copyright notice:
See accompanying LICENSE file.
Author:
Lakshmi Priya Natarajan, MCCI Corporation June 2019
Revision history:
See https://github.com/mcci-catena/Catena-Arduino-Platform
*/

#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_ */
66 changes: 66 additions & 0 deletions src/Catena4618.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
Module: Catena4618.h
Function:
class Catena4618: CatenaBase Platform to represent a Catena 4618
Copyright notice:
See accompanying LICENSE file.
Author:
Lakshmi Priya Natarajan, MCCI Corporation June 2019
Revision history:
See https://github.com/mcci-catena/Catena-Arduino-Platform
*/

#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_ */
63 changes: 63 additions & 0 deletions src/Catena4630.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
Module: Catena4630.h
Function:
class Catena4630: CatenaBase Platform to represent a Catena 4630.
Copyright notice:
See accompanying LICENSE file.
Author:
Dhinesh Kumar Pitchai, MCCI Corporation April 2019
*/

#ifndef _Catena4630_H_ /* prevent multiple includes */
#define _Catena4630_H_

#pragma once

#ifndef _CATENA463X_H_
# include "Catena463x.h"
#endif

namespace McciCatena {

class Catena4630 : public Catena463x
{
public:
using Super = Catena463x;

// no specific constructor.
Catena4630() {};

// uses default destructor

// neither copyable nor movable
Catena4630(const Catena4630&) = delete;
Catena4630& operator=(const Catena4630&) = delete;
Catena4630(const Catena4630&&) = delete;
Catena4630& operator=(const Catena4630&&) = delete;

virtual const char *CatenaName() const override { return "Catena 4630"; };
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 Catena4630.h ****/
#endif /* _Catena4630_H_ */
106 changes: 106 additions & 0 deletions src/Catena463x.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
Module: Catena463x.h
Function:
class Catena463x: CatenaBase Platform to represent a Catena 463x
(such as the 4630).
Copyright notice:
See accompanying LICENSE file.
Author:
Dhinesh Kumar Pitchai, MCCI Corporation April 2019
*/

#ifndef _CATENA463X_H_ /* prevent multiple includes */
#define _CATENA463X_H_

#pragma once

#ifndef _CATENASTM32L0_H_
# include "CatenaStm32L0.h"
#endif

namespace McciCatena {

class Catena463x : public CatenaStm32L0
{
public:
using Super = CatenaStm32L0;

// no specific constructor.
Catena463x() {};

// uses default destructor

// neither copyable nor movable
Catena463x(const Catena463x&) = delete;
Catena463x& operator=(const Catena463x&) = delete;
Catena463x(const Catena463x&&) = delete;
Catena463x& operator=(const Catena463x&&) = delete;

// LoRaWAN binding
class LoRaWAN /* forward */;

enum ANALOG_PINS
{
APIN_VBAT_SENSE = A1,
APIN_VBUS_SENSE = A2,
};

enum ANALOG_CHANNELS
{
ANALOG_CHANNEL_A0 = 0,
ANALOG_CHANNEL_A1 = 5,
ANALOG_CHANNEL_A2 = 4,
ANALOG_CHANNEL_A3 = 3,
ANALOG_CHANNEL_A4 = 2,
ANALOG_CHANNEL_VBAT = ANALOG_CHANNEL_A1,
ANALOG_CHANNEL_VBUS = ANALOG_CHANNEL_A2,
ANALOG_CHANNEL_VREF = 17,
};

enum DIGITAL_PINS
{
PIN_STATUS_LED = D13,
PIN_SPI2_FLASH_SS = D19,
PIN_SPI2_MOSI = D23,
PIN_SPI2_MISO = D22,
PIN_SPI2_SCK = D24,
};

// methods
virtual bool begin() override;

protected:

private:
};

/*
|| The LoRaWAN class for the Catena 455x. Assumes The Things Network
*/
class Catena463x::LoRaWAN : public CatenaStm32L0::LoRaWAN
{
public:
using Super = CatenaStm32L0::LoRaWAN;

/*
|| the constructor. We don't do anything at this level, the
|| Super constructor does most of the work.
*/
LoRaWAN() {};

bool begin(Catena463x *pParent);

protected:

private:
};

} // namespace McciCatena

/**** end of Catena463x.h ****/
#endif /* _CATENA463X_H_ */
Loading

0 comments on commit 1c5cf37

Please sign in to comment.