aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/device/spi.h
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2013-10-30 09:45:58 +1100
committerAndrew Tridgell <tridge@samba.org>2013-11-30 20:17:09 +1100
commit244c3602f2959335bfd4ae14c4a25eb06a8355a3 (patch)
treec59b3cb9f5018ed13ad47ef6ed6241e1aa5db406 /src/drivers/device/spi.h
parent7d415b0c42465bffb79a3c69443e7bf85b59eb26 (diff)
downloadpx4-firmware-244c3602f2959335bfd4ae14c4a25eb06a8355a3.tar.gz
px4-firmware-244c3602f2959335bfd4ae14c4a25eb06a8355a3.tar.bz2
px4-firmware-244c3602f2959335bfd4ae14c4a25eb06a8355a3.zip
SPI: added set_frequency() API
this allows the bus speed to be changed on the fly by device drivers. This is needed for the MPU6000
Diffstat (limited to 'src/drivers/device/spi.h')
-rw-r--r--src/drivers/device/spi.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/drivers/device/spi.h b/src/drivers/device/spi.h
index 9103dca2e..299575dc5 100644
--- a/src/drivers/device/spi.h
+++ b/src/drivers/device/spi.h
@@ -102,6 +102,17 @@ protected:
int transfer(uint8_t *send, uint8_t *recv, unsigned len);
/**
+ * Set the SPI bus frequency
+ * This is used to change frequency on the fly. Some sensors
+ * (such as the MPU6000) need a lower frequency for setup
+ * registers and can handle higher frequency for sensor
+ * value registers
+ *
+ * @param frequency Frequency to set (Hz)
+ */
+ void set_frequency(uint32_t frequency);
+
+ /**
* Locking modes supported by the driver.
*/
enum LockMode {