/* Bits set here indicate that the GPIO is an output. */ #define FXL6408_REG_IO_DIR 0x03
/* * Bits set here, when the corresponding bit of IO_DIR is set, drive * the output high instead of low.
*/ #define FXL6408_REG_OUTPUT 0x05
/* Bits here make the output High-Z, instead of the OUTPUT value. */ #define FXL6408_REG_OUTPUT_HIGH_Z 0x07
/* Returns the current status (1 = HIGH) of the input pins. */ #define FXL6408_REG_INPUT_STATUS 0x0f
/* * Return the current interrupt status * This bit is HIGH if input GPIO != default state (register 09h). * The flag is cleared after being read (bit returns to 0). * The input must go back to default state and change again before this flag is raised again.
*/ #define FXL6408_REG_INT_STS 0x13
gpio_config.regmap = devm_regmap_init_i2c(client, ®map); if (IS_ERR(gpio_config.regmap)) return dev_err_probe(dev, PTR_ERR(gpio_config.regmap), "failed to allocate register map\n");
ret = fxl6408_identify(dev, gpio_config.regmap); if (ret) return ret;
/* Disable High-Z of outputs, so that our OUTPUT updates actually take effect. */
ret = regmap_write(gpio_config.regmap, FXL6408_REG_OUTPUT_HIGH_Z, 0); if (ret) return dev_err_probe(dev, ret, "failed to write 'output high Z' register\n");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.