Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Emc2301Bus The i2c bus, the EMC2301 is connected to (cm4io.pdf: 2.9 Fan connector) Emc2301Bus = 10 // Emc2301Addr The address of the EMC2301 (cm4io.pdf: 2.9 Fan connector) Emc2301Addr = 0x2F // Emc2301ProductIdReg Register containing the EMC2301's product id (emc2301.pdf: TABLE 6-1) Emc2301ProductIdReg = 0xFD // Emc2301ProductIdVal The EMC2301's product id (emc2301.pdf: TABLE 6-1) Emc2301ProductIdVal = 0x37 // Emc2301ConfigReg The EMC2301's fan configuration register (emc2301.pdf: 4.1 Fan Control Modes of Operation, 6.14 Fan Configuration Registers) Emc2301ConfigReg = 0x32 // Emc2301DutyCycleReg The EMC2301's fan drive setting register (emc2301.pdf: 6.12 Fan Drive Setting Register) Emc2301DutyCycleReg = 0x30 // Emc2301TachHighReg Register containing the TACH measurement's HIGH byte (emc2301.pdf: 6.23 TACH Reading Registers) Emc2301TachHighReg = 0x3E // Emc2301TachLowReg Register containing the TACH measurement's LOW byte (emc2301.pdf: 6.23 TACH Reading Registers) Emc2301TachLowReg = 0x3F // Emc2301Tach2RPM RPM conversion constant (emc2301.pdf: EQUATION 4-3: SIMPLIFIED TACH CONVERSION) Emc2301Tach2RPM = 3932160 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EMC2301 ¶
type EMC2301 struct {
// contains filtered or unexported fields
}
func New ¶
New opens the connection to the EMC2301, verifies the product id, performs the initial configuration and returns the handle
func (*EMC2301) GetDutyCycle ¶
GetDutyCycle reads and returns the current PWM duty cycle in %
func (*EMC2301) SetDutyCycle ¶
SetDutyCycle sets the PWM duty cycle in %
type RPMResult ¶
type RPMResult struct { // Rpm The measured/calculated RPM (valid if !Stopped && !Undef) Rpm int // Stopped is true, when the PWM duty cycle is set to 0 Stopped bool // Undef is true, when the TACH value is too low to calculate the RPM (emc2301.pdf: EQUATION 4-3: SIMPLIFIED TACH CONVERSION) Undef bool }
RPMResult contains the result of a RPM measurement
Click to show internal directories.
Click to hide internal directories.