# moxa-ltc3350-driver

This driver provides an interface for the LTC3350.

## Usage Instructions

### 1. Set Alarm Thresholds
You can configure thresholds for ESR and capacitance to trigger alarms.

- **Set ESR Threshold**:
  Write `14 <ESR_threshold_in_uOhm>` to `ltc3350/set_alarm`.
  Example:
  ```bash
  echo "14 5000" > ltc3350/set_alarm
  ```

- **Set Capacitance Threshold**:
  Write `15 <Capacitance_threshold_in_uF>` to `ltc3350/set_alarm`.
  Example:
  ```bash
  echo "15 1000000" > ltc3350/set_alarm
  ```

### 2. Trigger Measurement
To start a measurement of ESR and capacitance, write any value to the `meas_cap_esr` attribute.

- **Start Measurement**:
  Write anything to `ltc3350_capacitor/meas_cap_esr`.
  Example:
  ```bash
  echo "1" > ltc3350_capacitor/meas_cap_esr
  ```

### 3. Read Measured Values
After triggering a measurement, you can read the latest calculated values after roughly 15 minutes.

- **Read Capacitance (uF)**:
  Read from `ltc3350_capacitor/cap`.
- **Read ESR (uOhm)**:
  Read from `ltc3350_capacitor/esr`.

### 4. Clear Alarms
If an alarm has been triggered (SMBAlert), you can clear it by writing to the `release_smbalert` attribute.

- **Release SMBAlert**:
  Write anything to `ltc3350/release_smbalert`.
  Example:
  ```bash
  echo "1" > ltc3350/release_smbalert
  ```
