akc695x

package module
v0.0.0-...-945547c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

README

tinygo-akc695x

AKC695X tuner driver for tinygo.

Documentation

Index

Constants

View Source
const Address = 0x10

Address is I2C address of AKC695X

Variables

This section is empty.

Functions

This section is empty.

Types

type AKC695X

type AKC695X struct {
	// contains filtered or unexported fields
}

AKC695X is instance of Chip.

func New

func New(bus drivers.I2C) AKC695X

New defined I2C Bus.

func (*AKC695X) Configure

func (r *AKC695X) Configure(config Config) (err error)

Configure is initialize function for AKC695X.

func (AKC695X) GetCNR

func (r AKC695X) GetCNR() (CNR uint8)

GetCNR returns C/N Ratio (dB).

func (AKC695X) GetFreq

func (r AKC695X) GetFreq() (kHz uint32)

GetFreq returns the frequency of receiving.

func (AKC695X) GetFreqString

func (r AKC695X) GetFreqString() (freq string)

GetFreqString returns the string of GetFreq.

func (AKC695X) GetFrequencyDeviation

func (r AKC695X) GetFrequencyDeviation() int8

GetFrequencyDeviation returns Status of frequncy deviation. The number 1 is scaled to 1KHz for FM and scaled to 100Hz for AM.

func (AKC695X) GetRSSIdBuV

func (r AKC695X) GetRSSIdBuV() (dBu int8)

GetRSSIdBuV returns Pin(dBuV)

func (AKC695X) GetStereoDemodulate

func (r AKC695X) GetStereoDemodulate() bool

GetStereoDemodulate returns that the stereo signal is more than 30% percent.

func (AKC695X) GetVCCMilliVolt

func (r AKC695X) GetVCCMilliVolt() uint16

GetVCCMilliVolt returns VCC Voltage

func (AKC695X) GetVolume

func (r AKC695X) GetVolume() (vol uint8)

GetVolume get the value of volume.

func (AKC695X) IsFM

func (r AKC695X) IsFM() bool

IsFM return the Band is FM or not.

func (AKC695X) IsPowerOn

func (r AKC695X) IsPowerOn() bool

IsPowerOn returns wheather PowerOn or not.

func (AKC695X) IsSeekComplete

func (r AKC695X) IsSeekComplete() bool

IsSeekComplete returns whether Seek or Tune is complete or not.

func (AKC695X) IsStereo

func (r AKC695X) IsStereo() bool

IsStereo returns whether current operation mode is Stereo or not.

func (AKC695X) IsTuned

func (r AKC695X) IsTuned() bool

IsTuned returns whether receiving signal or not.

func (AKC695X) PowerOff

func (r AKC695X) PowerOff() (err error)

PowerOff turns off tuner

func (AKC695X) PowerOn

func (r AKC695X) PowerOn(khz uint32, Volume uint8, VolumeControlI2C bool) (err error)

PowerOn turns on tuner

func (AKC695X) Seek

func (r AKC695X) Seek(seekup bool) (err error)

Seek seek the signal. if seekup is true, seek up. false, seek down.

func (AKC695X) SetAMCNRThreshold

func (r AKC695X) SetAMCNRThreshold(th uint8)

SetAMCNRThreshold . if th=0 -6dB, th=1 -10dB, th=2 -14dB, th=3 -18dB.

func (AKC695X) SetAutoStereo

func (r AKC695X) SetAutoStereo()

SetAutoStereo sets Auto stereo,*Stereo_rh

func (AKC695X) SetBandWidth

func (r AKC695X) SetBandWidth(bw uint8)

SetBandWidth . bw=0 means 150kHz, bw=1 means 200kHz, bw=2 means 50kHz, bw=3 means 100kHz.

func (AKC695X) SetBaseBoost

func (r AKC695X) SetBaseBoost(b bool)

SetBaseBoost sets Setting of base boost false: Inactive (default) true: Active

func (AKC695X) SetChannelADC

func (r AKC695X) SetChannelADC(b bool)

SetChannelADC set Setting of channel ADC true; ADC enable false: ADC disable

func (AKC695X) SetDeEmphasis

func (r AKC695X) SetDeEmphasis(b bool)

SetDeEmphasis ... true means 50us. false means 75us.

func (AKC695X) SetFMCNRThreshold

func (r AKC695X) SetFMCNRThreshold(th uint8)

SetFMCNRThreshold . if th=0 -2dB, th=1 -3dB, th=2 -4dB, th=3 -5dB.

func (AKC695X) SetFMStereoCNRThreshold

func (r AKC695X) SetFMStereoCNRThreshold(th uint8)

SetFMStereoCNRThreshold . if th=0 -4dB, th=1 -8dB, th=2 -12dB, th=3 -16dB.

func (AKC695X) SetFreq

func (r AKC695X) SetFreq(kHz uint32) (err error)

SetFreq sets the frequency.

func (AKC695X) SetFreqencyDiffThreshold

func (r AKC695X) SetFreqencyDiffThreshold(th uint8)

SetFreqencyDiffThreshold . see datasheet.

func (AKC695X) SetLine

func (r AKC695X) SetLine(b bool)

SetLine set the Operation mode. false: Radio mode (default) true: Line input mode (*In order to reduce the power consumption, Please set pd_rx & pd_adc to 1 when you use line input)

func (AKC695X) SetMono

func (r AKC695X) SetMono()

SetMono sets Monoral.

func (AKC695X) SetOscillatorSourceCrystal

func (r AKC695X) SetOscillatorSourceCrystal(b bool)

SetOscillatorSourceCrystal set Oscillator source selection. false External XO true: Crystal

func (AKC695X) SetPhaseInv

func (r AKC695X) SetPhaseInv(b bool)

SetPhaseInv set Setting of audio output signal phase. false: in-phase output,for dual speaker true: opposite phase, for single speaker (default)

func (AKC695X) SetRXEnable

func (r AKC695X) SetRXEnable(b bool)

SetRXEnable set Setting of RX true: analog & RF enable false: anlog & RF disable

func (AKC695X) SetStereo

func (r AKC695X) SetStereo()

SetStereo sets Stereo

func (AKC695X) SetVolume

func (r AKC695X) SetVolume(vol uint8) error

SetVolume set volume. vol from 0 to 63.

func (AKC695X) VolumeDown

func (r AKC695X) VolumeDown() (err error)

VolumeDown decrements volume.

func (AKC695X) VolumeUp

func (r AKC695X) VolumeUp() (err error)

VolumeUp increments volume.

type Config

type Config struct {
	I2CAddr        uint8
	MWBand, FMBand uint8
	FMLow, FMHigh  uint32
}

Config is config setting for AKC695X class.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL