First draft HMC5883 magnetometer sensor using physical quantities, outputting via serial port using std::cout on mbed os 5
Diff: magnetometer.h
- Revision:
- 9:87a7169b4d5c
- Parent:
- 8:c5dc1ce10722
--- a/magnetometer.h Thu Mar 26 21:13:44 2020 +0000 +++ b/magnetometer.h Thu Mar 26 21:35:19 2020 +0000 @@ -14,52 +14,5 @@ bool mag_data_ready(); bool mag_read(quan::three_d::vect<quan::magnetic_flux_density::uT> & v); -#if 0 -//true if the hmc5883 is detected -bool mag_detected(); - -// only 1,2,4,8 available -// else returns false and does nothing -bool mag_set_samples_average(int n_samples); - -// set data rate specified as a rational -//data rate 0.75 <3,4>, 1.5 <3,2>, 3 <3>,7.5 <15,2>, 15 <15>(Default) -// , 30 <30>, 75 <75> -//N.B. wont link if other values specified -template <int N, int D=1> -bool mag_set_data_rate(); - -// set +- range -// sets the nearest greater equal +-range to abs(range_in) -// N.B so wont necessarily set exact range input -// TODO: get_range -// returns false if range is too big -bool mag_set_range(quan::magnetic_flux_density::uT const & range_in); - -quan::magnetic_flux_density::uT mag_get_range(); - -// probably remove and decide how to do this behind the scenes -// in concert with mag_set_data_rate -bool mag_set_continuous_measurement_mode(); - -// could rename to start single_measurement? -bool mag_set_single_measurement_mode(); - -bool mag_do_single_measurement( - quan::three_d::vect<quan::magnetic_flux_density::uT>& result - ); - -// TODO prefer mag enable / disable() ? -bool mag_set_idle_mode(); - -// TODO callback? -bool mag_data_ready(); - -// TODO ignore this make private -bool mag_data_locked(); - -bool mag_read(quan::three_d::vect<quan::magnetic_flux_density::uT> & v); - -#endif #endif