valeria toffoli
/
COG4050_adxrs290_adxrs453
driver for gyro
Fork of COG4050_adxl355_adxl357-ver2 by
ADXRS290/ADXRS290.cpp@6:45d2393ef468, 2018-08-14 (annotated)
- Committer:
- vtoffoli
- Date:
- Tue Aug 14 06:49:07 2018 +0000
- Revision:
- 6:45d2393ef468
- Parent:
- 4:23b53636b576
- Child:
- 7:5aaa09c40283
update 14.08.2018
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vtoffoli | 6:45d2393ef468 | 1 | #include <stdint.h> |
vtoffoli | 6:45d2393ef468 | 2 | #include "mbed.h" |
vtoffoli | 6:45d2393ef468 | 3 | #include "ADXRS290.h" |
vtoffoli | 6:45d2393ef468 | 4 | |
vtoffoli | 6:45d2393ef468 | 5 | |
vtoffoli | 6:45d2393ef468 | 6 | ADXRS290::ADXRS290(PinName cs_pin, PinName MOSI, PinName MISO, PinName SCK): adxrs290(MOSI, MISO, SCK), cs(cs_pin) |
vtoffoli | 6:45d2393ef468 | 7 | { |
vtoffoli | 6:45d2393ef468 | 8 | cs = 1; |
vtoffoli | 6:45d2393ef468 | 9 | adxrs290.format(8,_SPI_MODE); |
vtoffoli | 6:45d2393ef468 | 10 | adxrs290.lock(); |
vtoffoli | 6:45d2393ef468 | 11 | gyro_sens = 5e-3; |
vtoffoli | 6:45d2393ef468 | 12 | t_sens = 0.1; |
vtoffoli | 6:45d2393ef468 | 13 | } |
vtoffoli | 6:45d2393ef468 | 14 | |
vtoffoli | 6:45d2393ef468 | 15 | /** SPI bus frequency */ |
vtoffoli | 6:45d2393ef468 | 16 | void ADXRS290::frequency(int hz) |
vtoffoli | 6:45d2393ef468 | 17 | { |
vtoffoli | 6:45d2393ef468 | 18 | adxrs290.frequency(hz); |
vtoffoli | 6:45d2393ef468 | 19 | } |
vtoffoli | 6:45d2393ef468 | 20 | |
vtoffoli | 6:45d2393ef468 | 21 | /** ----------------------------------- */ |
vtoffoli | 6:45d2393ef468 | 22 | /** Writes the reg register with data */ |
vtoffoli | 6:45d2393ef468 | 23 | /** ----------------------------------- */ |
vtoffoli | 6:45d2393ef468 | 24 | void ADXRS290::write_reg(ADXRS290_register_t reg, uint8_t data){} |
vtoffoli | 6:45d2393ef468 | 25 | uint8_t ADXRS290::read_reg(ADXRS290_register_t reg){} |
vtoffoli | 6:45d2393ef468 | 26 | uint16_t ADXRS290::read_reg_u16(ADXRS290_register_t reg){} |
vtoffoli | 6:45d2393ef468 | 27 | |
vtoffoli | 6:45d2393ef468 | 28 | void ADXRS290::set_power_ctl_reg(uint8_t data){} |
vtoffoli | 6:45d2393ef468 | 29 | void ADXRS290::set_filter_ctl_reg(ADXRS290_filter_ctl_t hpf, ADXRS290_filter_ctl_t odr){} |
vtoffoli | 6:45d2393ef468 | 30 | void ADXRS290::set_sync(ADXRS290_dataready_ctl_t data){} |
vtoffoli | 6:45d2393ef468 | 31 | |
vtoffoli | 6:45d2393ef468 | 32 | uint16_t ADXRS290::scanx(){} |
vtoffoli | 6:45d2393ef468 | 33 | uint16_t ADXRS290::scany(){} |
vtoffoli | 6:45d2393ef468 | 34 | uint16_t ADXRS290::scant(){} |
vtoffoli | 6:45d2393ef468 | 35 |