# digital_potentiometer_x9c10x

Digital potentiometer library for X9C102, X9C103, X9C104, X9C503

Author | Rob Jansen, Copyright © 2020..2020, all rights reserved.
Adapted-by |
Compiler | 2.5r4

Description

    This library controls digital potentiometer x9c10x using a 3
                 wire serial interface. Define the following pins:
                 -) x9c10x_increment_pin & x9c10x_increment_pin_direction
                 -) x9c10x_up_down_pin & x9c10x_up_down_pin_direction
                 -) x9c10x_chip_select_pin & x9c10x_chip_select_pin_direction

Sources

    Renesas datasheet for X9C102, X9C103, X9C104, X9C503.

Dependencies

No dependency found

## Summary

### Global variables/contants

- `const byte X9C10X_MIN_VALUE = 0`
- `const byte X9C10X_MAX_VALUE = 99`
- `var byte _x9c10x_wiper_shadow`

### Procedures

- `x9c10x_store()`
- `x9c10x_increment()`
- `x9c10x_decrement()`
- `x9c10x_init()`
- `x9c10x_wiper'put(byte in value)`

### Functions

## API details

### Global variables/contants

- `const byte X9C10X_MIN_VALUE = 0`

      Wiper values, 100 positions.

- `const byte X9C10X_MAX_VALUE = 99`

  No documentation found

- `var byte _x9c10x_wiper_shadow`

       LOCAL VARIABLES  --------------------------------

      Shadow value of the current wiper position. Needed because the value cannot
      be read back and can only be changed by increment and decrement.

### Procedures

- `x9c10x_store()`

      Store the current wiper value in the non volatile memory of the chip.

- `x9c10x_increment()`

      Increment the location of the wiper to change pot resistance but do not store
      it in the non volatile memory of the chip.

- `x9c10x_decrement()`

      Decrement the location of the wiper to change pot resistance but do not store
      it in the non volatile memory of the chip.

- `x9c10x_init()`

      Inititialize wiper and put it at X9C10X_MIN_VALUE.

- `x9c10x_wiper'put(byte in value)`

      Set the location of the wiper to change pot resistance but do not store
      it in the non volatile memory of the chip.
      Value must be in range X9C10X_MIN_VALUE .. X9C10X_MAX_VALUE.

### Functions

## Related samples

Here are the list of samples which use this library:

16f1823 | 16f1823_digital_potentiometer_x9c10x.jal
16f877 | 16f877_digital_potentiometer_x9c10x.jal
18f4550 | 18f4550_digital_potentiometer_x9c10x.jal