2020-03-22 22:11:55 -03:00
|
|
|
/*
|
|
|
|
|
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
|
|
|
|
* running old operating systems and software designed for IBM
|
|
|
|
|
* PC systems and compatibles from 1981 through fairly recent
|
|
|
|
|
* system designs based on the PCI bus.
|
|
|
|
|
*
|
|
|
|
|
* This file is part of the 86Box distribution.
|
|
|
|
|
*
|
2020-03-28 18:50:47 -03:00
|
|
|
* Definitions for hardware monitoring chips.
|
2020-03-22 22:11:55 -03:00
|
|
|
*
|
2020-03-25 00:46:02 +02:00
|
|
|
*
|
2020-03-22 22:11:55 -03:00
|
|
|
*
|
|
|
|
|
* Author: RichardG, <richardg867@gmail.com>
|
2020-05-18 00:11:31 -03:00
|
|
|
*
|
2020-03-22 22:11:55 -03:00
|
|
|
* Copyright 2020 RichardG.
|
|
|
|
|
*/
|
|
|
|
|
#ifndef EMU_HWM_H
|
|
|
|
|
# define EMU_HWM_H
|
|
|
|
|
|
|
|
|
|
|
2020-03-24 19:53:09 -03:00
|
|
|
#define RESISTOR_DIVIDER(v, r1, r2) (((v) * (r2)) / ((r1) + (r2)))
|
2020-03-22 22:11:55 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _hwm_values_ {
|
|
|
|
|
uint16_t fans[4];
|
2020-03-28 18:50:47 -03:00
|
|
|
uint8_t temperatures[4];
|
2020-03-24 19:53:09 -03:00
|
|
|
uint16_t voltages[8];
|
2020-03-22 22:11:55 -03:00
|
|
|
} hwm_values_t;
|
|
|
|
|
|
2020-05-18 22:54:59 -03:00
|
|
|
typedef struct {
|
|
|
|
|
uint32_t local;
|
|
|
|
|
hwm_values_t *values;
|
|
|
|
|
|
|
|
|
|
uint8_t regs[8];
|
|
|
|
|
uint8_t addr_register;
|
|
|
|
|
uint8_t temp_idx;
|
|
|
|
|
uint8_t smbus_addr;
|
|
|
|
|
|
|
|
|
|
uint8_t as99127f_smbus_addr;
|
|
|
|
|
} lm75_t;
|
|
|
|
|
|
2020-03-22 22:11:55 -03:00
|
|
|
|
|
|
|
|
extern void hwm_set_values(hwm_values_t new_values);
|
|
|
|
|
extern hwm_values_t* hwm_get_values();
|
|
|
|
|
|
2020-07-02 21:42:31 -03:00
|
|
|
extern void lm75_remap(lm75_t *dev, uint8_t addr);
|
2020-05-18 22:54:59 -03:00
|
|
|
extern uint8_t lm75_read(lm75_t *dev, uint8_t reg);
|
|
|
|
|
extern uint8_t lm75_write(lm75_t *dev, uint8_t reg, uint8_t val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern const device_t lm75_1_4a_device;
|
|
|
|
|
extern const device_t lm75_w83781d_device;
|
2020-03-22 22:11:55 -03:00
|
|
|
|
2020-05-18 00:11:31 -03:00
|
|
|
extern const device_t lm78_device;
|
2020-03-22 22:11:55 -03:00
|
|
|
extern const device_t w83781d_device;
|
|
|
|
|
extern const device_t as99127f_device;
|
2020-05-18 00:11:31 -03:00
|
|
|
extern const device_t as99127f_rev2_device;
|
2020-03-22 22:11:55 -03:00
|
|
|
|
2020-07-02 21:42:31 -03:00
|
|
|
extern const device_t gl518sm_2c_device;
|
|
|
|
|
extern const device_t gl518sm_2d_device;
|
|
|
|
|
|
2020-03-22 22:11:55 -03:00
|
|
|
|
|
|
|
|
#endif /*EMU_HWM_H*/
|