14 if (!this->
parent_->select_page_(0)) {
15 ESP_LOGE(TAG,
"Failed to select page 0");
18 optional<uint8_t> curr = this->
parent_->read_byte(PCM5122_REG_GPIO_ENABLE);
19 if (!curr.has_value()) {
20 ESP_LOGE(TAG,
"Failed to read GPIO_ENABLE");
24 this->
parent_->reg(PCM5122_REG_GPIO_ENABLE) = curr.value() & ~(1 << (this->
pin_ - 1));
26 this->
parent_->reg(PCM5122_REG_GPIO_ENABLE) = curr.value() | (1 << (this->
pin_ - 1));
27 this->
parent_->reg(PCM5122_REG_GPIO_OUTPUT_SELECT + (this->
pin_ - 1)) = PCM5122_GPIO_OUTPUT_SELECT_REGISTER;
28 optional<uint8_t> invert = this->
parent_->read_byte(PCM5122_REG_GPIO_INVERT);
29 if (!invert.has_value()) {
30 ESP_LOGE(TAG,
"Failed to read GPIO_INVERT");
34 this->
parent_->reg(PCM5122_REG_GPIO_INVERT) = invert.value() | (1 << (this->
pin_ - 1));
36 this->
parent_->reg(PCM5122_REG_GPIO_INVERT) = invert.value() & ~(1 << (this->
pin_ - 1));