Documentation
¶
Index ¶
- Constants
- func GainInNumber(g Gainsel) float64
- type AD7705
- func (p *AD7705) BusReset() error
- func (p *AD7705) ReadData(chSelection Chsel) (uint16, error)
- func (p *AD7705) SelfCal(chSelection Chsel, setup ChSetup, mode Opmode) error
- func (p *AD7705) Set(ch Chsel, setup ChSetup) error
- func (p *AD7705) WaitDataReady(chSelection Chsel) error
- func (p *AD7705) WriteRegister(chSelection Chsel, register RegSel, data byte) (byte, error)
- func (p *AD7705) WriteRegister24(chSelection Chsel, register RegSel, data uint32) (uint32, error)
- type ChSetup
- type Chsel
- type Gainsel
- type ODR
- type Opmode
- type RegSel
Constants ¶
View Source
const ( REG_COMMUNICATION = 0 REG_SETUP = 1 REG_CLOCK = 2 REG_DATA = 3 REG_TEST = 4 REG_NOP = 5 REG_OFFSET = 6 REG_GAIN = 7 )
View Source
const ( CH_AIN1 = 0 CH_AIN2 = 1 CH_AIN1_COMMON = 2 CH_AIN2_COMMON = 3 )
View Source
const ( OPMODE_NORMAL = 0 OPMODE_SELFCAL = 1 OPMODE_ZEROCAL = 2 OPMODE_FULLCAL = 3 )
View Source
const ( GAINSEL_1 = 0 GAINSEL_2 = 1 GAINSEL_4 = 2 GAINSEL_8 = 3 GAINSEL_16 = 4 GAINSEL_32 = 5 GAINSEL_64 = 6 GAINSEL_128 = 7 )
View Source
const ( ODRXTAL_20 = 0 ODRXTAL_25 = 1 ODRXTAL_100 = 2 ODRXTAL_200 = 3 ODROSC_50 = 0 ODROSC_60 = 1 ODROSC_250 = 2 ODROSC_500 = 3 )
Variables ¶
This section is empty.
Functions ¶
func GainInNumber ¶
Types ¶
type AD7705 ¶
type AD7705 struct {
// contains filtered or unexported fields
}
func InitAD7705 ¶
func InitAD7705(spidevice string, readypin int, xtal bool, clkdiv bool, setup ChSetup) (AD7705, error)
Clockdiv and xtal settings depend on pcb.. not adjustable during run
func (*AD7705) WaitDataReady ¶
func (*AD7705) WriteRegister ¶
type ChSetup ¶
type ChSetup struct {
//For setup register
Gain Gainsel `json:"gain"`
Unipolar bool `json:"unipolar"`
Buffered bool `json:"buffered"`
Filtsync bool `json:"filtsync"`
//For clock register Clk and clkdiv are set on setup... only filter is adjusted
Odr ODR `json:"odr"`
}
func (*ChSetup) ParseSetup ¶
Click to show internal directories.
Click to hide internal directories.