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
/// There is a sub module for each hardware family, as well as a common error type.

#[macro_use]
extern crate bitflags;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate anyhow;

/**
Interface with the Prostar MPPT (all models) as documented at
http://support.morningstarcorp.com/wp-content/uploads/2015/12/PSMPPT_public-MODBUS-doc_v04.pdf

# Examples
```
use morningstar::prostar_mppt as ps;
use std::{thread::sleep, time::{Instant, Duration}};

let con = ps::Connection::new("/dev/ttyUSB0", 1).await.expect("connection failed");
println!("{}", con.stats().expect("failed to get stats"));

// Stop charging the battery
con.write_coil(ps::Coil::ChargeDisconnect, true).await.expect("failed to stop charging");

// Start Charging again
con.write_coil(ps::Coil::ChargeDisconnect, false).await.expect("failed to start charging");
```
*/
pub mod prostar_mppt;