|
| | Pca9685GpioPin (hf_pin_num_t pin, Pca9685Handler *parent_handler, hf_gpio_active_state_t active_state=hf_gpio_active_state_t::HF_GPIO_ACTIVE_HIGH) noexcept |
| | Construct a PCA9685 GPIO pin wrapper.
|
| |
| | ~Pca9685GpioPin () noexcept override=default |
| | Default destructor.
|
| |
|
| bool | Initialize () noexcept override |
| | Initialize the GPIO pin (sets channel to full-off by default).
|
| |
| bool | Deinitialize () noexcept override |
| | Deinitialize (marks as uninitialized; channel state persists).
|
| |
| bool | IsPinAvailable () const noexcept override |
| | Check if this channel number is valid (0-15).
|
| |
| hf_u8_t | GetMaxPins () const noexcept override |
| | Returns 16 (total channels on the PCA9685).
|
| |
| const char * | GetDescription () const noexcept override |
| | Returns a description string like "PCA9685_CH_5".
|
| |
|
|
| hf_gpio_err_t | SetDirectionImpl (hf_gpio_direction_t direction) noexcept override |
| | Set pin direction. Only OUTPUT is supported.
|
| |
| hf_gpio_err_t | GetDirectionImpl (hf_gpio_direction_t &direction) const noexcept override |
| | Get direction (always OUTPUT).
|
| |
| hf_gpio_err_t | SetOutputModeImpl (hf_gpio_output_mode_t mode) noexcept override |
| | Set output mode. Only push-pull is natively supported (global setting).
|
| |
| hf_gpio_err_t | GetOutputModeImpl (hf_gpio_output_mode_t &mode) const noexcept override |
| | Get output mode (tracked internally).
|
| |
| hf_gpio_err_t | SetPullModeImpl (hf_gpio_pull_mode_t mode) noexcept override |
| | Not supported – returns GPIO_ERR_UNSUPPORTED_OPERATION.
|
| |
| hf_gpio_pull_mode_t | GetPullModeImpl () const noexcept override |
| | Returns FLOATING (no pull resistors on PCA9685).
|
| |
| hf_gpio_err_t | SetPinLevelImpl (hf_gpio_level_t level) noexcept override |
| | Write pin level via the PCA9685 driver.
|
| |
| hf_gpio_err_t | GetPinLevelImpl (hf_gpio_level_t &level) noexcept override |
| | Read pin level (returns cached state since PCA9685 is output-only).
|
| |
BaseGpio adapter for a single PCA9685 channel used as a digital output.
Wraps one of the 16 PCA9685 PWM channels (0-15) as a HardFOC BaseGpio instance. Since the PCA9685 is a PWM output controller (not a GPIO expander), this wrapper operates in output-only mode:
- HIGH: Sets the channel to full-on (bit 12 of ON register)
- LOW: Sets the channel to full-off (bit 12 of OFF register)
- Input: Not supported (PCA9685 cannot read pin states)
- Pull mode: Not supported
- Interrupts: Not supported
This is useful for controlling LEDs, relays, or enable pins where simple on/off control is sufficient without PWM.
- Note
- Pin instances are created via Pca9685Handler::CreateGpioPin() and stored in the handler's pin registry as shared_ptr.