Hi Giovanni, RM, all,
Here is a patch for the BMP085 Digital pressure sensor ex sub-project support.
To resume the action of the patch:
- Creation of two HAL classes: hal_barometer and hal_thermometer. Those classes are a bit different to the zip a send last time.
- Creation of the os/ex/Bosch folder with the driver files (bmp085.c, bmp085.h and bmp085.mk)
- Creation of a demo in testhal/STM32/STM32F4xx/I2C-BMP085/
There is still a lot of work , but I need your point of view to improve my current work. All comment are welcome
Digital pressure sensor Driver
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Location: Munich (Germany)
- Has thanked: 83 times
- Been thanked: 67 times
- Contact:
Re: Digital pressure sensor Driver
In barometer and temperature class there are missed calibration methods (set_bias, reset_bias, set_sensitivity, reset_sensitivity).
Now it is get_channels_number
This is redundant. You already have the read_raw and read_cooked methods in the basesensor class and barometer/thermometer extend this class.
Take a look to LSM303DLHC. Here I have 3 VMT
using vmt_lsm303dlhcacc->read_raw I am able to read raw data from accelermeter only
using vmt_lsm303dlhccomp->read_raw I am able to read raw data from compass only
using vmt_basesensor->read_raw I am able to read raw data from both subsystems
Code: Select all
/**
* @name Macro Functions (BaseBarometer)
* @{
*/
/**
* @brief Barometer get axes number.
*
* @param[in] ip pointer to a @p BaseBarometer class.
* @return The number of axes of the BaseSensor
*
* @api
*/
#define barometerGetAxesNumber(ip) \
(ip)->vmt_basebarometer->get_axes_number(ip)
Now it is get_channels_number
Code: Select all
/**
* @brief BaseBarometer specific methods.
*/
#define _base_barometer_methods_alone \
/* Invoke the get pressure data.*/ \
msg_t (*get_pressure)(void *instance, int32_t pressure[]);
This is redundant. You already have the read_raw and read_cooked methods in the basesensor class and barometer/thermometer extend this class.
Take a look to LSM303DLHC. Here I have 3 VMT
Code: Select all
/**
* @brief LSM303DLHC 6-axis accelerometer/compass class.
*/
struct LSM303DLHCDriver {
/** @brief BaseSensor Virtual Methods Table. */
const struct BaseSensorVMT *vmt_basesensor;
/** @brief BaseAccelerometer Virtual Methods Table. */
const struct BaseAccelerometerVMT *vmt_baseaccelerometer;
/** @brief BaseCompass Virtual Methods Table. */
const struct BaseCompassVMT *vmt_basecompass;
/** @brief LSM303DLHC Accelerometer Virtual Methods Table. */
const struct LSM303DLHCACCVMT *vmt_lsm303dlhcacc;
/** @brief LSM303DLHC Compass Virtual Methods Table. */
const struct LSM303DLHCCOMPVMT *vmt_lsm303dlhccomp;
_lsm303dlhc_data
};
using vmt_lsm303dlhcacc->read_raw I am able to read raw data from accelermeter only
using vmt_lsm303dlhccomp->read_raw I am able to read raw data from compass only
using vmt_basesensor->read_raw I am able to read raw data from both subsystems
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Location: Munich (Germany)
- Has thanked: 83 times
- Been thanked: 67 times
- Contact:
Re: Digital pressure sensor Driver
I will edit and commit both classes for barometer and thermometer by the end of the day.
Is this ok to you?
Ciao,
RM
Is this ok to you?
Ciao,
RM
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Location: Munich (Germany)
- Has thanked: 83 times
- Been thanked: 67 times
- Contact:
Re: Digital pressure sensor Driver
Hi Theo,
I have added three new classes on trunk: hygrometer, barometer and thermometer. They are completely identical on accelerometer/magnetometer classes except for that convention already discussed (axes/channels).
I am intentioned to restyle current MEMS implementation simplifying code, optimizing code in certain points and improving configuration structures (enabling user to set-up interrupt registers). Even more I will introduce support for a barometer (LPS25H) and for a hygrometer/thermometer (HTS221) both from ST.
I will make these edits in the next 48h. I suggest you to take a look to new version of device driver before to develop your own driver.
Ciao,
RM
I have added three new classes on trunk: hygrometer, barometer and thermometer. They are completely identical on accelerometer/magnetometer classes except for that convention already discussed (axes/channels).
I am intentioned to restyle current MEMS implementation simplifying code, optimizing code in certain points and improving configuration structures (enabling user to set-up interrupt registers). Even more I will introduce support for a barometer (LPS25H) and for a hygrometer/thermometer (HTS221) both from ST.
I will make these edits in the next 48h. I suggest you to take a look to new version of device driver before to develop your own driver.
Ciao,
RM
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: Digital pressure sensor Driver
Hi RM,
Thanks for your feedback. I will then wait the new version of the driver and port and update what I have done according to the new implementation.
Did you take a look at my driver code?
Thanks for your feedback. I will then wait the new version of the driver and port and update what I have done according to the new implementation.
Did you take a look at my driver code?
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Location: Munich (Germany)
- Has thanked: 83 times
- Been thanked: 67 times
- Contact:
Re: Digital pressure sensor Driver
Honestly last time I saw only sensor classes. I will take a look to driver implementation as soon I have some spare time. Fore sure I will take a deep look into before to add it to trunk.
Thanks a lot for your contribution and your patience.
Ciao,
RM
Thanks a lot for your contribution and your patience.
Ciao,
RM
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: Digital pressure sensor Driver
ok, I will send another patch for the driver and a demo after new port. It will be interesting to have a look at the last version maybe.
It is a pleasure to contribute to the project, it is my way to say thank you.
I'm also learning at the same time
regards,
Theo
It is a pleasure to contribute to the project, it is my way to say thank you.
I'm also learning at the same time
regards,
Theo
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: Digital pressure sensor Driver
I just remark that in the trunk the readme file don't show the existace of the ex repository for the moment.
It shows rt, nil hal but not ex.
regads
Theo
It shows rt, nil hal but not ex.
regads
Theo
Who is online
Users browsing this forum: No registered users and 1 guest