úÎRšKžŠ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰(c) Marc Fontaine 2017BSD3Marc.Fontaine@gmx.de experimentalGHC-onlySafe!"OT]-Synth a is the monad for Si PPL synthesizers.7Run an IO action with an I2C device and an I2C address.,Lift an IO action on an I2C device to Synth.3Dump the content of the IC registers. (For testing)(c) Marc Fontaine 2017BSD3Marc.Fontaine@gmx.de experimentalGHC-onlySafe{Compute the pvalues for a rational divider. Any denominator is pemissible here. The function uses the best approximation. *Approximate the a,b,c values of a divider. 6Compute a list of approximations of a rational number. continued fraction stuff. continued fraction stuff.    (c) Marc Fontaine 2017BSD3Marc.Fontaine@gmx.de experimentalGHC-onlySafe!"OT] &Get address of the fractional divider.PA DividerConf is basically the bytestring that configures a fractional divider.$Bits in the clock control registers.%)An IC has up to 8 clocks. (CLK_0..CLK_7)..An IC has PLL_A and PLL_B.:6The defaultConfig if no environment variables are set.;ÿlCheck that defaultConfigEnv matches your hardware before you use it. Do not run any SiPLL code on a wrong i2c-bus, i.e. an internal I2C bus of your PC. (it might confuse and or wreck) your hardware. You can overwrite config values with the following ENV variables: SI_CLOCK_I2C_DEVICE SI_CLOCK_I2C_ADDRESS SI_CLOCK_XTAL_FREQUENCY SI_CLOCK_MAX_PLL_FREQUENCY<8Quick test for the I2C connection (with default config).=ORun the Synth monad with the config from defaultConfigEnv. | .i.e. reading Env>0Run the Synth monad with a custom configuration.AReset (both?) PLLsBTurn on CLK_0 output.CTurn off CLK_0 output.D+Set PLL and Clock dividers for a frequency.EQCompute a pair of good default pll and clk dividers. (clk divider is an integer)FSet a PLL fractional dividerGShort for setPLLDivider PLL_AHShort for setPLLDivider PLL_BIbSetup a Clock divider. The rfield is passed as a plain Word8. (ToDo high level API for rfields).M‰Mangle a Divider and a rval into a DividerConf. This can be used to pre-compute all the math and to get the bits that define a divider.NzSetup some fractional divider with a pre-computed config. Using a pre-computed config might be faster or more convenient.Y&Generic Address of fractional divider.ZAddress of a Clock divider.[Address of a PLL divider.O  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[Q  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXO98234567:;<1=>?@./0%&'()*+,-ABC!"#$DEFGHI JKLMN [ZYOPQRSTUVWX,  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[(c) Marc Fontaine 2017BSD3Marc.Fontaine@gmx.de experimentalGHC-onlySafeOTj3A message in Baudot code. One start and 2 Stop bitsk45 Baud speed.l%RTTY is basically Baudot code + fsk2.ijklmnijklmnijklmnijklmn(c) Marc Fontaine 2017BSD3Marc.Fontaine@gmx.de experimentalGHC-onlySafeOTooSend a JT65 'hello world' on a given frequency. The transmission starts at beginning of the next full minute. pIThe list of symbols of the 'hello world' message. (acutally not needed.)qCThe list of pre computed frequencies for the 'hello world' message.r/Symbol start times relative to the full minute.opqropqropqropqr(c) Marc Fontaine 2017BSD3Marc.Fontaine@gmx.de experimentalGHC-onlySafeOTs Quick test.tSome Message in Morse Code.u%Some frequency for testing (10m Band)vMain time unit in mico-seconds.wSend a message.x'Send a symbol. (either '.', '-' or ' '){ Hard key on.| Hard key off. stuvwxyz{| stuvwxyz{| stuvwxyz{| stuvwxyz{|(c) Marc Fontaine 2017BSD3Marc.Fontaine@gmx.de experimentalGHC-onlySafeOT }2Set Clk_0 to frequency f and turn on clock output.~Turn off CLK_0.Read the chip registers.jOne example for frequency hopping. Here the PLL stays at one frequency and the clock divider is modified.‚ Send a JT65 hello world message.ƒ Send some message in morse code.„Send some RTTY message…5Switching the PLL causes some loud clicks (unwanted).†"No clicks here. I don't know why ? }~€‚ƒ„…† }~€‚ƒ„…† }~€‚ƒ„…† }~€‚ƒ„…†Safe‡0Sample an interval from start to end with steps.ˆDSet the SI_CLOCK_I2C_DEVICE environment variable. Useful with ghci.‰HSet the SI_CLOCK_XTAL_FREQUENCY environment variable. Useful with ghci.‡ˆ‰‡ˆ‰‡ˆ‰‡ˆ‰Š  !"#$%&'()*+,--./0123456789:;<==>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡sˆ‰Š‹ŒŽ‘’“%si-clock-0.1.1-FD4uEzEgxbiIND5v8mutKhHardware.SiClock.UtilsHardware.SiClock.I2CHardware.SiClock.DividerHardware.SiClockHardware.SiClock.FSKHardware.SiClock.JT65TestHardware.SiClock.MorseKeyerHardware.SiClock.ExamplesbaseSystem.EnvironmentsetEnv"hsI2C-0.1.2-5APgKrh3Zba7K907d3EN5SSystem.Hardware.LinuxDevI2CDeviceSynthT runI2CWithdeviceIO dumpRegisters writeByteDatawriteI2CBlockData dividerToPVal dividerToABCapproximationstoContinuedFractionfromContinuedFraction DividerAddr toDividerAddr DividerConf unDividerConfCLK_Control_bitsCLK_onCLK_offCLK_fractional CLK_integer CLK_multiPLLA CLK_multiPLLB CLK_invertedCLK_XTAL CLK_CLKin CLK_multiCLK_DRV2CLK_DRV4CLK_DRV6CLK_DRV8 DividerPair _pllDivider _clkDividerCLKCLK_0CLK_1CLK_2CLK_3CLK_4CLK_5CLK_6CLK_7PLLPLL_APLL_BSynthConfig _I2CDevice _I2CAddress_XtalFrequency_maxPLLFrequencyDivider Frequency defaultConfigdefaultConfigEnvtestIOrunSynth runSynthWithaskXtalFrequencyaskMaxPLLFrequencypllResetclk0_Onclk0_Off setDividersdefaultDividers setPLLDividersetPLLDivider_AsetPLLDivider_B setCLKDivider setCLKControlsetCLKControlRawcontrolBitsToWord8 toDividerConf setDividerRaw_SI_CLK0_CONTROL_SI_CLK1_CONTROL_SI_CLK2_CONTROL_SI_SYNTH_PLL_A_SI_SYNTH_PLL_B _SI_PLL_RESET_SI_CLOCK_I2C_DEVICE_SI_CLOCK_I2C_ADDRESS_SI_CLOCK_XTAL_FREQUENCY_SI_CLOCK_MAX_PLL_FREQUENCY$fDividerAddrWord8$fDividerAddrCLK$fDividerAddrPLL $fShowConfig $fEqConfig $fShowPLL$fEqPLL $fShowCLK$fEqCLK$fOrdCLK $fEnumCLK$fShowDividerPair$fShowCLK_Control_bits$fEqCLK_Control_bits$fShowDividerConf$fEqDividerConfclkOff someMsgBaudot symbolTime45rttytimedFrequencyHopping waitUntiljt65SendHelloWorldhello_world_symbolshello_world_frequenciesjt65SymbolStartTimestestsomeMsgsomeFreqditLensendMsgsendSymditDelaydaDelayrfOnrfOff testSynthtestI2CReadingsomeHopFrequencies testHoppingtestJT65 testMorsetestRTTY testClicks1 noClicks2 fromToStepssetEnvI2CDevicesetEnvXtalFrequency