Skip to content

Commit 0f509e5

Browse files
authored
feat(aw9523): add auto_init to config (#116)
* Update aw9523 config to have auto_init (default true) * Update aw9523 constructor to call initialize() if config.auto_init is set to true * Rebuild docs
1 parent 45ae8d8 commit 0f509e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+162
-149
lines changed

components/aw9523/include/aw9523.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,21 @@ class Aw9523 {
7676
MaxLedCurrent max_led_current = MaxLedCurrent::IMAX; ///< Max current allowed on each LED.
7777
write_fn write; ///< Function to write to the device.
7878
read_fn read; ///< Function to read from the device.
79+
bool auto_init = true; ///< Automatically initialize the device.
7980
Logger::Verbosity log_level{Logger::Verbosity::WARN}; ///< Log verbosity for the component.
8081
};
8182

8283
/**
83-
* @brief Construct the Aw9523. Initialization called separately.
84+
* @brief Construct the Aw9523. Will call initialize() if auto_init is true.
8485
* @param config Config structure for configuring the AW9523
8586
*/
8687
Aw9523(const Config &config)
8788
: config_(config), address_(config.device_address), write_(config.write), read_(config.read),
88-
logger_({.tag = "Aw9523", .level = config.log_level}) {}
89+
logger_({.tag = "Aw9523", .level = config.log_level}) {
90+
if (config.auto_init) {
91+
initialize();
92+
}
93+
}
8994

9095
/**
9196
* @brief Initialize the component class.

docs/adc/adc_types.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
<li><a href="index.html">ADC APIs</a> &raquo;</li>
142142
<li>ADC Types</li>
143143
<li class="wy-breadcrumbs-aside">
144-
<a href="https://github.com/esp-cpp/espp/blob/32e4a73/docs/en/adc/adc_types.rst" class="fa fa-github"> Edit on GitHub</a>
144+
<a href="https://github.com/esp-cpp/espp/blob/45ae8d8/docs/en/adc/adc_types.rst" class="fa fa-github"> Edit on GitHub</a>
145145
</li>
146146
</ul>
147147
<hr/>

docs/adc/ads1x15.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
<li><a href="index.html">ADC APIs</a> &raquo;</li>
143143
<li>ADS1x15 I2C ADC</li>
144144
<li class="wy-breadcrumbs-aside">
145-
<a href="https://github.com/esp-cpp/espp/blob/32e4a73/docs/en/adc/ads1x15.rst" class="fa fa-github"> Edit on GitHub</a>
145+
<a href="https://github.com/esp-cpp/espp/blob/45ae8d8/docs/en/adc/ads1x15.rst" class="fa fa-github"> Edit on GitHub</a>
146146
</li>
147147
</ul>
148148
<hr/>
@@ -159,7 +159,7 @@ <h2>API Reference<a class="headerlink" href="#api-reference" title="Permalink to
159159
<section id="header-file">
160160
<h3>Header File<a class="headerlink" href="#header-file" title="Permalink to this headline"></a></h3>
161161
<ul class="simple">
162-
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/32e4a73/components/ads1x15/include/ads1x15.hpp">components/ads1x15/include/ads1x15.hpp</a></p></li>
162+
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/45ae8d8/components/ads1x15/include/ads1x15.hpp">components/ads1x15/include/ads1x15.hpp</a></p></li>
163163
</ul>
164164
</section>
165165
<section id="classes">

docs/adc/ads7138.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
<li><a href="index.html">ADC APIs</a> &raquo;</li>
143143
<li>ADS7138 I2C ADC</li>
144144
<li class="wy-breadcrumbs-aside">
145-
<a href="https://github.com/esp-cpp/espp/blob/32e4a73/docs/en/adc/ads7138.rst" class="fa fa-github"> Edit on GitHub</a>
145+
<a href="https://github.com/esp-cpp/espp/blob/45ae8d8/docs/en/adc/ads7138.rst" class="fa fa-github"> Edit on GitHub</a>
146146
</li>
147147
</ul>
148148
<hr/>
@@ -164,7 +164,7 @@ <h2>API Reference<a class="headerlink" href="#api-reference" title="Permalink to
164164
<section id="header-file">
165165
<h3>Header File<a class="headerlink" href="#header-file" title="Permalink to this headline"></a></h3>
166166
<ul class="simple">
167-
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/32e4a73/components/ads7138/include/ads7138.hpp">components/ads7138/include/ads7138.hpp</a></p></li>
167+
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/45ae8d8/components/ads7138/include/ads7138.hpp">components/ads7138/include/ads7138.hpp</a></p></li>
168168
</ul>
169169
</section>
170170
<section id="classes">

docs/adc/continuous_adc.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
<li><a href="index.html">ADC APIs</a> &raquo;</li>
143143
<li>Continuous ADC</li>
144144
<li class="wy-breadcrumbs-aside">
145-
<a href="https://github.com/esp-cpp/espp/blob/32e4a73/docs/en/adc/continuous_adc.rst" class="fa fa-github"> Edit on GitHub</a>
145+
<a href="https://github.com/esp-cpp/espp/blob/45ae8d8/docs/en/adc/continuous_adc.rst" class="fa fa-github"> Edit on GitHub</a>
146146
</li>
147147
</ul>
148148
<hr/>
@@ -164,7 +164,7 @@ <h2>API Reference<a class="headerlink" href="#api-reference" title="Permalink to
164164
<section id="header-file">
165165
<h3>Header File<a class="headerlink" href="#header-file" title="Permalink to this headline"></a></h3>
166166
<ul class="simple">
167-
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/32e4a73/components/adc/include/continuous_adc.hpp">components/adc/include/continuous_adc.hpp</a></p></li>
167+
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/45ae8d8/components/adc/include/continuous_adc.hpp">components/adc/include/continuous_adc.hpp</a></p></li>
168168
</ul>
169169
</section>
170170
<section id="classes">

docs/adc/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
<li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
135135
<li>ADC APIs</li>
136136
<li class="wy-breadcrumbs-aside">
137-
<a href="https://github.com/esp-cpp/espp/blob/32e4a73/docs/en/adc/index.rst" class="fa fa-github"> Edit on GitHub</a>
137+
<a href="https://github.com/esp-cpp/espp/blob/45ae8d8/docs/en/adc/index.rst" class="fa fa-github"> Edit on GitHub</a>
138138
</li>
139139
</ul>
140140
<hr/>

docs/adc/oneshot_adc.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
<li><a href="index.html">ADC APIs</a> &raquo;</li>
143143
<li>Oneshot ADC</li>
144144
<li class="wy-breadcrumbs-aside">
145-
<a href="https://github.com/esp-cpp/espp/blob/32e4a73/docs/en/adc/oneshot_adc.rst" class="fa fa-github"> Edit on GitHub</a>
145+
<a href="https://github.com/esp-cpp/espp/blob/45ae8d8/docs/en/adc/oneshot_adc.rst" class="fa fa-github"> Edit on GitHub</a>
146146
</li>
147147
</ul>
148148
<hr/>
@@ -163,7 +163,7 @@ <h2>API Reference<a class="headerlink" href="#api-reference" title="Permalink to
163163
<section id="header-file">
164164
<h3>Header File<a class="headerlink" href="#header-file" title="Permalink to this headline"></a></h3>
165165
<ul class="simple">
166-
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/32e4a73/components/adc/include/oneshot_adc.hpp">components/adc/include/oneshot_adc.hpp</a></p></li>
166+
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/45ae8d8/components/adc/include/oneshot_adc.hpp">components/adc/include/oneshot_adc.hpp</a></p></li>
167167
</ul>
168168
</section>
169169
<section id="classes">

docs/bldc/bldc_driver.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
<li><a href="index.html">BLDC APIs</a> &raquo;</li>
140140
<li>BLDC Driver</li>
141141
<li class="wy-breadcrumbs-aside">
142-
<a href="https://github.com/esp-cpp/espp/blob/32e4a73/docs/en/bldc/bldc_driver.rst" class="fa fa-github"> Edit on GitHub</a>
142+
<a href="https://github.com/esp-cpp/espp/blob/45ae8d8/docs/en/bldc/bldc_driver.rst" class="fa fa-github"> Edit on GitHub</a>
143143
</li>
144144
</ul>
145145
<hr/>
@@ -156,7 +156,7 @@ <h2>API Reference<a class="headerlink" href="#api-reference" title="Permalink to
156156
<section id="header-file">
157157
<h3>Header File<a class="headerlink" href="#header-file" title="Permalink to this headline"></a></h3>
158158
<ul class="simple">
159-
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/32e4a73/components/bldc_driver/include/bldc_driver.hpp">components/bldc_driver/include/bldc_driver.hpp</a></p></li>
159+
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/45ae8d8/components/bldc_driver/include/bldc_driver.hpp">components/bldc_driver/include/bldc_driver.hpp</a></p></li>
160160
</ul>
161161
</section>
162162
<section id="classes">

docs/bldc/bldc_motor.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
<li><a href="index.html">BLDC APIs</a> &raquo;</li>
142142
<li>BLDC Motor</li>
143143
<li class="wy-breadcrumbs-aside">
144-
<a href="https://github.com/esp-cpp/espp/blob/32e4a73/docs/en/bldc/bldc_motor.rst" class="fa fa-github"> Edit on GitHub</a>
144+
<a href="https://github.com/esp-cpp/espp/blob/45ae8d8/docs/en/bldc/bldc_motor.rst" class="fa fa-github"> Edit on GitHub</a>
145145
</li>
146146
</ul>
147147
<hr/>
@@ -172,7 +172,7 @@ <h2>API Reference<a class="headerlink" href="#api-reference" title="Permalink to
172172
<section id="header-file">
173173
<h3>Header File<a class="headerlink" href="#header-file" title="Permalink to this headline"></a></h3>
174174
<ul class="simple">
175-
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/32e4a73/components/bldc_motor/include/bldc_motor.hpp">components/bldc_motor/include/bldc_motor.hpp</a></p></li>
175+
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/45ae8d8/components/bldc_motor/include/bldc_motor.hpp">components/bldc_motor/include/bldc_motor.hpp</a></p></li>
176176
</ul>
177177
</section>
178178
<section id="classes">
@@ -565,13 +565,13 @@ <h4>Example Usage<a class="headerlink" href="#classespp_1_1_bldc_motor_1bldc_mot
565565
<section id="id1">
566566
<h3>Header File<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h3>
567567
<ul class="simple">
568-
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/32e4a73/components/bldc_motor/include/bldc_types.hpp">components/bldc_motor/include/bldc_types.hpp</a></p></li>
568+
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/45ae8d8/components/bldc_motor/include/bldc_types.hpp">components/bldc_motor/include/bldc_types.hpp</a></p></li>
569569
</ul>
570570
</section>
571571
<section id="id2">
572572
<h3>Header File<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h3>
573573
<ul class="simple">
574-
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/32e4a73/components/bldc_motor/include/sensor_direction.hpp">components/bldc_motor/include/sensor_direction.hpp</a></p></li>
574+
<li><p><a class="reference external" href="https://github.com/esp-cpp/espp/blob/45ae8d8/components/bldc_motor/include/sensor_direction.hpp">components/bldc_motor/include/sensor_direction.hpp</a></p></li>
575575
</ul>
576576
</section>
577577
</section>

docs/bldc/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
<li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
132132
<li>BLDC APIs</li>
133133
<li class="wy-breadcrumbs-aside">
134-
<a href="https://github.com/esp-cpp/espp/blob/32e4a73/docs/en/bldc/index.rst" class="fa fa-github"> Edit on GitHub</a>
134+
<a href="https://github.com/esp-cpp/espp/blob/45ae8d8/docs/en/bldc/index.rst" class="fa fa-github"> Edit on GitHub</a>
135135
</li>
136136
</ul>
137137
<hr/>

0 commit comments

Comments
 (0)