Fork from ST-Expansion-Sw-Team Repo.
Dependencies: VL53L1X_mbed
Revision 28:b3aa04ca507c, committed 2020-11-02
- Comitter:
- johnAlexander
- Date:
- Mon Nov 02 14:09:59 2020 +0000
- Parent:
- 27:74b34293d419
- Commit message:
- Move to use VL53L1X_mbed sensor class lib.
Changed in this revision
--- a/Components/VL53L1X.lib Thu Oct 29 16:33:44 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://os.mbed.com/teams/ST/code/VL53L1X/#aa13392d16bb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Components/VL53L1X_mbed.lib Mon Nov 02 14:09:59 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/teams/ST/code/VL53L1X_mbed/#744e8b1b9837
--- a/XNucleo53L1A1.cpp Thu Oct 29 16:33:44 2020 +0000 +++ b/XNucleo53L1A1.cpp Mon Nov 02 14:09:59 2020 +0000 @@ -3,7 +3,7 @@ XNucleo53L1A1 *XNucleo53L1A1::_instance = NULL; -XNucleo53L1A1 *XNucleo53L1A1::instance(vl53L1X_DevI2C *ext_i2c) +XNucleo53L1A1 *XNucleo53L1A1::instance(VL53L1X_DevI2C *ext_i2c) { if (_instance == NULL) { _instance = new XNucleo53L1A1(ext_i2c); @@ -13,7 +13,7 @@ return _instance; } -XNucleo53L1A1 *XNucleo53L1A1::instance(vl53L1X_DevI2C *ext_i2c, +XNucleo53L1A1 *XNucleo53L1A1::instance(VL53L1X_DevI2C *ext_i2c, PinName gpio1_centre, PinName gpio1_left, PinName gpio1_right) { @@ -30,10 +30,10 @@ { int status, n_dev = 0; - sensor_centre->VL53L1_Off(); - sensor_left->VL53L1_Off(); - sensor_right->VL53L1_Off(); - status = sensor_centre->InitSensor(NEW_SENSOR_CENTRE_ADDRESS); + sensor_centre->vl53l1_off(); + sensor_left->vl53l1_off(); + sensor_right->vl53l1_off(); + status = sensor_centre->init_sensor(NEW_SENSOR_CENTRE_ADDRESS); if (status) { delete sensor_centre; delete xshutdown_centre; @@ -45,7 +45,7 @@ n_dev++; } - status = sensor_left->InitSensor(NEW_SENSOR_LEFT_ADDRESS); + status = sensor_left->init_sensor(NEW_SENSOR_LEFT_ADDRESS); if (status) { delete sensor_left; delete xshutdown_left; @@ -57,7 +57,7 @@ n_dev++; } - status = sensor_right->InitSensor(NEW_SENSOR_RIGHT_ADDRESS); + status = sensor_right->init_sensor(NEW_SENSOR_RIGHT_ADDRESS); if (status) { delete sensor_right; delete xshutdown_right;
--- a/XNucleo53L1A1.h Thu Oct 29 16:33:44 2020 +0000 +++ b/XNucleo53L1A1.h Mon Nov 02 14:09:59 2020 +0000 @@ -40,10 +40,10 @@ /* Includes ------------------------------------------------------------------*/ -#include "vl53l1x_class.h" +#include "VL53L1X_Class.h" #include "Stmpe1600.h" //#include "DevI2C.h" -#include "vl53L1x_I2c.h" +#include "VL53L1X_I2C.h" /** New device addresses */ @@ -64,7 +64,7 @@ /** Constructor 1 * @param[in] &i2c device I2C to be used for communication */ - XNucleo53L1A1(vl53L1X_DevI2C *ext_i2c) : dev_i2c(ext_i2c) + XNucleo53L1A1(VL53L1X_DevI2C *ext_i2c) : dev_i2c(ext_i2c) { stmpe1600_exp0 = new Stmpe1600((DevI2C*)ext_i2c, (0x43 * 2)); // U21 @@ -87,7 +87,7 @@ * @param[in] PinName gpio1_left Mbed DigitalOut pin name to be used as a left sensor GPIO_1 INT * @param[in] PinName gpio1_right Mbed DigitalOut pin name to be used as a right sensor GPIO_1 INT */ - XNucleo53L1A1(vl53L1X_DevI2C *ext_i2c, PinName gpio1_centre, + XNucleo53L1A1(VL53L1X_DevI2C *ext_i2c, PinName gpio1_centre, PinName gpio1_left, PinName gpio1_right) : dev_i2c(ext_i2c) { stmpe1600_exp0 = new Stmpe1600((DevI2C*)ext_i2c, (0x43 * 2)); // U21 @@ -147,7 +147,7 @@ * @param[in] &i2c device I2C to be used for communication * @return Pointer to the object instance */ - static XNucleo53L1A1 *instance(vl53L1X_DevI2C *ext_i2c); + static XNucleo53L1A1 *instance(VL53L1X_DevI2C *ext_i2c); /** * @brief Creates a singleton object instance @@ -157,7 +157,7 @@ * @param[in] PinName gpio1_right the pin connected to right sensor INT * @return Pointer to the object instance */ - static XNucleo53L1A1 *instance(vl53L1X_DevI2C *ext_i2c, PinName gpio1_centre, + static XNucleo53L1A1 *instance(VL53L1X_DevI2C *ext_i2c, PinName gpio1_centre, PinName gpio1_left, PinName gpio1_right); /** @@ -166,7 +166,7 @@ */ int init_board(); - vl53L1X_DevI2C *dev_i2c; + VL53L1X_DevI2C *dev_i2c; VL53L1X *sensor_centre; VL53L1X *sensor_left; VL53L1X *sensor_right;