File: microsol-common.h

package info (click to toggle)
nut 2.8.4%2Breally-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,720 kB
  • sloc: ansic: 132,030; sh: 17,256; cpp: 12,566; makefile: 5,646; python: 1,114; perl: 856; xml: 47
file content (67 lines) | stat: -rw-r--r-- 2,312 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* microsol-common.h -  common framework for Microsol Solis-based UPS hardware

   Copyright (C) 2004  Silvino B. Magalhaes    <sbm2yk@gmail.com>
                 2019  Roberto Panerai Velloso <rvelloso@gmail.com>
                 2021  Ygor A. S. Regados      <ygorre@tutanota.com>

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

   2021/03/19 - Version 0.70 - Initial release, based on solis driver

*/

#ifndef INCLUDED_MICROSOL_COMMON_H
#define INCLUDED_MICROSOL_COMMON_H

typedef unsigned int bool_t;

#define PACKET_SIZE 25

/* buffers */
extern unsigned char received_packet[PACKET_SIZE];

/* Identification */
extern const char *model_name;
extern unsigned int ups_model;
extern bool_t input_220v, output_220v;

/* logical */
extern bool_t detected;
extern bool_t line_unpowered, overheat, overload;
extern bool_t critical_battery, inverter_working;
/*extern bool_t recharging;*/ /* microsol-apc.c has its own copy */

/* Input group */
extern double input_voltage, input_current, input_frequency;
extern double input_minimum_voltage, input_maximum_voltage, input_nominal_voltage;
extern double input_low_limit, input_high_limit;

/* Output group */
extern double output_voltage, output_current, output_frequency;

/* Battery group */
extern int battery_extension;
extern double battery_voltage, battery_charge;
extern double temperature;

/* Power group */
extern double apparent_power, real_power, ups_load;
extern int load_power_factor, nominal_power, ups_power_factor;

extern void scan_received_pack_model_specific(void);
extern void set_ups_model(void);
extern bool_t ups_model_defined(void);

#endif				/* INCLUDED_MICROSOL_COMMON_H */