From 22a6c52795c70412a9b2a42a58d45d5039b0a8cb Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Fri, 24 Mar 2017 13:09:25 -0600 Subject: [PATCH] bmg160: fixup some comments, add GPIO to FTI Signed-off-by: Jon Trulson --- src/bmg160/bmg160.h | 20 ++++++++++---------- src/bmg160/bmg160_fti.c | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/bmg160/bmg160.h b/src/bmg160/bmg160.h index 7bea1fef..bd6c9fc1 100644 --- a/src/bmg160/bmg160.h +++ b/src/bmg160/bmg160.h @@ -87,7 +87,7 @@ extern "C" { * * @param bus I2C or SPI bus to use. * @param addr The address for this device, or -1 for SPI. - * @param cs The gpio pin to use for the SPI Chip Select. -Use 1 for + * @param cs The gpio pin to use for the SPI Chip Select. Use -1 for * I2C or for SPI with a hardware controlled pin. * @return The device context, or NULL on error. */ @@ -196,7 +196,7 @@ extern "C" { * Set the power mode of the device. Care must be taken when * setting a low power or suspend mode. See the datasheet for * details. In certain power modes, register write must be - * drastically slowed down. which we cannot support. + * drastically slowed down, which we cannot support. * * @param dev The device context. * @param power One of the BMG160_POWER_MODE_T values. @@ -457,14 +457,14 @@ extern "C" { * install an interrupt handler. * * @param dev The device context. - * @param intr one of the INTERRUPT_PINS_T values specifying which - * interrupt pin you are installing. - * @param gpio gpio pin to use as interrupt pin - * @param level the interrupt trigger level (one of mraa_gpio_edge_t + * @param intr One of the BMG160_INTERRUPT_PINS_T values + * specifying which interrupt pin you are installing. + * @param gpio GPIO pin to use as interrupt pin + * @param level The interrupt trigger level (one of mraa_gpio_edge_t * values). Make sure that you have configured the interrupt pin * properly for whatever level you choose. - * @param isr the interrupt handler, accepting a void * argument - * @param arg the argument to pass the the interrupt handler + * @param isr The interrupt handler, accepting a void * argument + * @param arg The argument to pass the the interrupt handler * @return UPM result. */ upm_result_t bmg160_install_isr(const bmg160_context dev, @@ -476,8 +476,8 @@ extern "C" { * uninstall a previously installed interrupt handler * * @param dev The device context. - * @param intr one of the INTERRUPT_PINS_T values specifying which - * interrupt pin you are removing. + * @param intr One of the BMG160_INTERRUPT_PINS_T values + * specifying which interrupt pin you are removing. */ void bmg160_uninstall_isr(const bmg160_context dev, BMG160_INTERRUPT_PINS_T intr); diff --git a/src/bmg160/bmg160_fti.c b/src/bmg160/bmg160_fti.c index 03ef0b10..d3a3f68f 100644 --- a/src/bmg160/bmg160_fti.c +++ b/src/bmg160/bmg160_fti.c @@ -31,7 +31,7 @@ const char upm_bmg160_name[] = "BMG160"; const char upm_bmg160_description[] = "Triple Axis Digital Gyroscope"; -const upm_protocol_t upm_bmg160_protocol[] = {UPM_I2C, UPM_SPI}; +const upm_protocol_t upm_bmg160_protocol[] = {UPM_I2C, UPM_SPI, UPM_GPIO}; const upm_sensor_t upm_bmg160_category[] = {UPM_GYROSCOPE}; // forward declarations @@ -45,7 +45,7 @@ const upm_sensor_descriptor_t upm_bmg160_get_descriptor() upm_sensor_descriptor_t usd; usd.name = upm_bmg160_name; usd.description = upm_bmg160_description; - usd.protocol_size = 2; + usd.protocol_size = 3; usd.protocol = upm_bmg160_protocol; usd.category_size = 1; usd.category = upm_bmg160_category;