rp2040-Si5351
Loading...
Searching...
No Matches
Si5351 Class Reference

#include <Si5351.hpp>

Public Member Functions

 Si5351 (i2c_inst *i2cPort=i2c0, uint8_t i2cAddr=0x60, const uint8_t cLoad=10)
 
void disableInterrupts ()
 Disables the interrupt pin.
 
void disableOEBPin ()
 Disables the OEB pin.
 
void resetPll (const char pll) const
 Resets PLLA or PLLB.
 
void resetPll () const
 Resets PLLA and PLLB.
 
void setClkControl (const uint8_t clkIndex, bool powerDown, bool intMode, uint8_t inputSource, bool invert, uint8_t outputSource, uint8_t strength)
 
void setMultisynth0to5parameters (const uint8_t multisynth, const uint32_t integer, const uint32_t num, const uint32_t denom, uint8_t outDiv=0) const
 Configures the multisynth divider 0, 1, 2, 3, 4 or 5.
 
void setOutputDisableState (uint8_t clkIndex, const uint8_t disState)
 Determins the state of a disabled output.
 
void setOutput (const uint8_t clkIndex, const bool enabled)
 Enables or disables a single output driver.
 
void setOutputsOff ()
 Disables all output drivers and powers them down.
 
void setPllInputSource (const uint8_t inputDivider, const uint8_t sourceB=0, const uint8_t sourceA=0)
 Sets the clock input divider.
 
void setPllParameters (const char pll, const uint32_t integer, const uint32_t numerator, const uint32_t denominator)
 Sets the PLL dividers.
 

Constructor & Destructor Documentation

◆ Si5351()

Si5351::Si5351 ( i2c_inst * i2cPort = i2c0,
uint8_t i2cAddr = 0x60,
const uint8_t cLoad = 10 )
Parameters
i2cPortis an I2C controller, for example i2c0. It must have been initialized.
i2cAddris the I2C address.
cLoadis the crystal cnternal load capacitance in pF and must bei 6, 8 or 10. Other values are treated as 10.

Member Function Documentation

◆ disableInterrupts()

void Si5351::disableInterrupts ( )

Disables the interrupt pin.

◆ disableOEBPin()

void Si5351::disableOEBPin ( )

Disables the OEB pin.

◆ resetPll() [1/2]

void Si5351::resetPll ( ) const

Resets PLLA and PLLB.

◆ resetPll() [2/2]

void Si5351::resetPll ( const char pll) const

Resets PLLA or PLLB.

Parameters
pllmust be 'a' or 'b'. Other values are ignored.

◆ setClkControl()

void Si5351::setClkControl ( const uint8_t clkIndex,
bool powerDown,
bool intMode,
uint8_t inputSource,
bool invert,
uint8_t outputSource,
uint8_t strength )
Parameters
clkIndexmust be between 0 and 7. Other values are treated like 0.
powerDownsets the mode of the output driver.
intModesets the multisynth int mode.
inputSourcemust be 0 (PLLA) or 1 (PLLB on Si5351A/C or VCXO on Si5351B). Other values are treated like 0.
invertinverts the output clock if set to true.
outputSourcemust be 0 (XTAL) or 3 (multisynth). Other values are treated like 3.
strengthmust be 2, 4, 6 or 8. Other values are treated like 2.

◆ setMultisynth0to5parameters()

void Si5351::setMultisynth0to5parameters ( const uint8_t multisynth,
const uint32_t integer,
const uint32_t num,
const uint32_t denom,
uint8_t outDiv = 0 ) const

Configures the multisynth divider 0, 1, 2, 3, 4 or 5.

Parameters
multisynthmust be 0, 1, 2, 3, 4 or 5. Other values are ignored.
integeris a in (a + b/c).
numis b in (a + b/c).
denomis c in (a + b/c).
outDivmust not be greater than 7. Higher Bits are ignored. The output divider is set to 2^´outDiv´.

◆ setOutput()

void Si5351::setOutput ( const uint8_t clkIndex,
const bool enabled )

Enables or disables a single output driver.

Parameters
clkIndexmust bei 0, 1, 2, 3, 4, 5, 6 or 7. Other Values are ignored.
enabledenables output clkIndex if true is given, otherwise disables it.

◆ setOutputDisableState()

void Si5351::setOutputDisableState ( uint8_t clkIndex,
const uint8_t disState )

Determins the state of a disabled output.

Parameters
clkIndexmust be between 0 and 7. Other values are treated like 0.
disStatemust be 0 (low), 1 (high), 2 (high Z) or 3 (never disabled). Higher bits are ignored.

◆ setOutputsOff()

void Si5351::setOutputsOff ( )

Disables all output drivers and powers them down.

◆ setPllInputSource()

void Si5351::setPllInputSource ( const uint8_t inputDivider,
const uint8_t sourceB = 0,
const uint8_t sourceA = 0 )

Sets the clock input divider.

Parameters
inputDividermust be 1, 2, 4 or 8. Other values are treated like 1.
sourceBis ignored becauseat the moment only the Si5351A ist fully supported.
sourceais ignored becauseat the moment only the Si5351A ist fully supported.

◆ setPllParameters()

void Si5351::setPllParameters ( const char pll,
const uint32_t integer,
const uint32_t numerator,
const uint32_t denominator )

Sets the PLL dividers.

Parameters
pllmust be 'a' (PLL A) or 'b' (PLL B). Other values are ignored.
integeris a in (a + b/c).
numeratoris b in (a + b/c).
denominatoris c in (a + b/c).

The documentation for this class was generated from the following files: