@johntalton/si5351
v1.0.1
Published
Clock Generator
Readme
si5351
Clock Generator
Example
import { I2CAddressedBus } from '@johntalton/and-other-delights'
import {
SI5351,
DEFAULT_ADDRESS,
MULTI_SYNTH_SOURCE_SELECT,
INPUT_SOURCE_SELECT,
STRENGTH
} from '@johntalton/si5351'
const bus = /* some I2CBus implementation */
const aBus = new I2CAddressedBus(bus, DEFAULT_ADDRESS)
const device = new SI5351(aBus)
// get status
const {
revisionId,
systemInitializing,
lossOfLockPLLB,
lossOfLockPLLA,
lossOfSignal
} = await device.getDeviceStatus()
// setup clock 2
await device.setClockControl(2, {
powerDown: true,
integerMode: true,
multiSynthSourceSelect: MULTI_SYNTH_SOURCE_SELECT.PLLA,
inverted: false,
inputSourceSelect: INPUT_SOURCE_SELECT.CRYSTAL,
strength: STRENGTH.DRIVE_4_MA
})
// set clock 2 enabled
await device.setOutputEnableControl({
// ... other clock values too
clock2: true
})
