Skip to content

Commit

Permalink
Fix #323: migrate Catena4618.h to new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
terrillmoore committed Jun 13, 2022
1 parent a73dbd3 commit cae8dde
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions src/Catena4618.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,85 @@ class Catena4618 : public Catena461x
virtual float ReadVbat(void) const override;
virtual float ReadVbus(void) const override;

virtual const char *get_screwTerminalLabel(uint8_t iTerminal) const override
{
static const char jp4[] = "JP4";
static const char jp5[] = "JP5";
return iTerminal == 0 ? jp4 : iTerminal == 1 ? jp5 : nullptr;
}

virtual uint8_t get_screwTerminalPin2(uint8_t iTerminal) const override
{
return iTerminal == 0 ? D5 : iTerminal == 1 ? A1 : 0;
}
virtual uint8_t get_screwTerminalPin3(uint8_t iTerminal) const override
{
return iTerminal == 0 ? D12 : iTerminal == 1 ? A2 : 0;
}

// virtual bool has_BME280() const override;
// virtual bool has_BME680() const override;
// virtual bool has_HS3001() const override;
virtual bool has_SHT3x() const override
{ return true; }
// virtual uint32_t enable_SHT3x(bool fStatus) override;
// virtual bool get_SHT3xRequest() const override;
// virtual bool has_SHT3xPowerControl() const override;
// virtual bool has_SGPC3() const override;
// virtual uint32_t enable_SGPC3(bool) override;
// virtual bool get_SGPC3Request() const override;
// virtual bool has_SGPC3PowerControl() const override;
// virtual bool has_PMS7003() const override;
// virtual uint32_t enable_PMS7003(bool fStatus) override;
// virtual bool get_PMS7003Request() const override;
// virtual bool has_PMS7003Control() const override;
virtual bool has_Si1133() const override
{ return true; }
// virtual bool has_BH1750() const override;
// virtual bool get_PMS7003Request() const override;
virtual uint32_t enable_tcxo(bool fStatus) override
{ return this->m_tcxo.enable(fStatus); }
virtual bool get_tcxoRequest() const override
{ return this->m_tcxo.getRequest(); }
virtual bool has_tcxoControl() const override
{ return this->m_tcxo.hasControl(); }
virtual bool has_usbPort() const override
{
return true;
}
virtual bool get_consoleIsUsb() const override
{
#ifdef USBCON
return true;
#else
return false;
#endif
}
virtual bool has_usbVbusMeasurementStandard() const override
{ return true; }
virtual uint8_t get_usbVbusMeasurementPin() const override
{ return APIN_VBUS_SENSE; }

protected:
/// on the Catena 4618, VOUT1 is controlled by D10
cPowerControlGPIO m_Vout1 = cPowerControlGPIO{ D10, 10 };
/// on the Catena 4618, VOUT2 is controlled by D11
cPowerControlGPIO m_Vout2 = cPowerControlGPIO{ D11, 10 };
/// on the Catena 4618, each screw terminal has its own VOUT
cPowerControlNested m_screwTerminal[2] = { cPowerControlNested{this->m_Vout1}, cPowerControlNested{this->m_Vout2} };
/// on the Catena 4618, the 3.3v regulator is enabled by D14
cPowerControlGPIO m_3v3 = cPowerControlGPIO{ D14, 10 };
/// on the Catena 4618, there's a TCXO controlled by D33
cPowerControlGPIO m_tcxo = cPowerControlGPIO{ D33, 2 };
/// on the Catena 4618, flash is always powered
cPowerControlDummy m_flashVdd;
/// on the Catena 4618, i2c is always powered
cPowerControlDummy m_i2cVdd;
/// on the Catena 4618, FRAM is always powered
cPowerControlDummy m_framVdd;
/// on the Catena 4618, there's no external I2C bridge
cPowerControlDummy m_externalI2cBridgeVdd;

protected:
// we are required to provide a table of platforms
virtual void getPlatformTable(
Expand Down

0 comments on commit cae8dde

Please sign in to comment.