-
Notifications
You must be signed in to change notification settings - Fork 3
Description
I'm starting to implement the DIN and DOUT feature of EdgePiGPIO. These two feature requires to use GPIO character device. All pins of DIN (DIN1~DIN8) are attached on RPI CPU and requires direct pin access. For DOUT pins, DOUT1 and DOUT2 are attached on the CPU but rest of the pins are attached on the expander chip( i2c device). In order to access both pin groups on different hardware, I'm planning to refactor the EdgePiGPIO module as follows:
┌──────────────────────────┐ ┌─────────────────────────────┐
│ │ │ │
│ │ │ │
│ edgpi_gpio_expander.py │ │ edgpi_gpio_chip.py │
│ │ │ │
│ │ │ │
└──────────────────────┬───┘ ┌──┴─────────────────────────────┘
│ │
│ │
│ │
│ │
┌─────▼────────────────▼────┐
│ edgpi_gpio.py │
│ │
└───────────────────────────┘
The current EdgePiGPIO class will be moved to a separate file and changed its name to edgepi_gpio_expander. This class only takes care of gpio pins on the expander chip. And a new class is generated in a separate file edgepi_gpio_chip. This will take care of direct control of pins on the CPU. Then the current edgepi_gpio will inherit both classes and instantiate one or both of them depending on the module config.
- Get rid of configuration parameter passing
- start with implementing the new generic instantiation and use case first #154
- once all functionality is implemented, start removing outdated methods #155
- Check pin numbers
- Configs being used for testing