Giter Club home page Giter Club logo

si5351's Introduction

Si5351 with Go on the Raspberry Pi

This is a library to use the Si5351 on the Raspberry Pi. It comes with a command line tool to control the Si5351 from the command line.

Disclaimer

I develop this software for myself and just for fun in my free time. If you find it useful, I'm happy to hear about that. If you have trouble using it, you have all the source code to fix the problem yourself (although pull requests are welcome).

Hint: This software is currently work in progress. It is good enough for my experiments with the Si5351, but does not support all features of the device yet. Please be patient - pull requests are welcome.

Usage

// define the crystal used with your device
crystal := si5351.Crystal{BaseFrequency: toCrystalFrequency(rootFlags.crystalFreq), Load: toCrystalLoad(rootFlags.crystalLoad), CorrectionPPM: rootFlags.ppm}

// open the I2C connection
bus, err := i2c.Open(rootFlags.address, rootFlags.bus)
if err != nil {
    log.Fatal(err)
}
defer bus.Close()
i2c.Debug = rootFlags.debugI2C

// create the device
device := si5351.New(crystal, bus)

// run the startup procedure
device.StartSetup()

// setup the PLL
device.SetupPLL(si5351.PLLA, 900*si5351.MHz)

// setup the output
device.PrepareOutputs(si5351.PLLA, false, si5351.ClockInputMultisynth, si5351.OutputDrive2mA, si5351.Clk1)
device.SetOutputFrequency(si5351.Clk1, frequency)

// finish the startup procedure
device.FinishSetup()

Build

To build for the Raspberry Pi:

GOARCH=arm GOARM=7 GOOS=linux go build

License

This software is published under the MIT License.

Copyright Florian Thienel

si5351's People

Contributors

ftl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.