i2c drivers: add '-k' flag for keep_running directly to BusCLIArguments

This commit is contained in:
Beat Küng
2020-09-18 10:18:40 +02:00
committed by Daniel Agar
parent 1bf030e8ba
commit 5fdff6a0e4
10 changed files with 48 additions and 39 deletions
@@ -110,6 +110,7 @@ public:
spi_mode_e spi_mode{SPIDEV_MODE3};
uint8_t i2c_address{0}; ///< optional I2C address: a driver can set this to allow configuring the I2C address
bool quiet_start{false}; ///< do not print a message when startup fails
bool keep_running{false}; ///< keep driver running even if no device is detected on startup
uint8_t orientation{0}; ///< distance_sensor_s::ROTATION_*
@@ -121,6 +122,8 @@ public:
int default_spi_frequency{-1}; ///< default spi bus frequency (driver needs to set this) [Hz]
int default_i2c_frequency{-1}; ///< default i2c bus frequency (driver needs to set this) [Hz]
bool support_keep_running{false}; ///< true if keep_running (see above) is supported
private:
bool validateConfiguration();
@@ -513,6 +513,11 @@ __EXPORT void PRINT_MODULE_USAGE_PARAMS_I2C_SPI_DRIVER(bool i2c_support, bool sp
*/
__EXPORT void PRINT_MODULE_USAGE_PARAMS_I2C_ADDRESS(uint8_t default_address);
/**
* -k flag
*/
__EXPORT void PRINT_MODULE_USAGE_PARAMS_I2C_KEEP_RUNNING_FLAG(void);
/** @note Each of the PRINT_MODULE_USAGE_PARAM_* methods apply to the previous PRINT_MODULE_USAGE_COMMAND_DESCR(). */
/**