Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: HelloWorld_6180XA1 SunTracker_BLE Servo_6180XA1 BLE_HR_Light ... more
Fork of X_NUCLEO_6180XA1 by
XNucleo6180XA1 Class Reference
Class representing the X-NUCLEO-VL6180XA1 expansion board singleton obj. More...
#include <XNucleo6180XA1.h>
| Public Member Functions | |
| int | init_board () | 
| Initialize the board and sensors with deft values. | |
| bool | rd_switch () | 
| Read the on board red slider switch. | |
| bool | is_sensor_top_present () | 
| Check the presence of sensor top. | |
| bool | is_sensor_bottom_present () | 
| Check the presence of sensor bottom. | |
| bool | is_sensor_left_present () | 
| Check the presence of sensor left. | |
| bool | is_sensor_right_present () | 
| Check the presence of sensor right. | |
| Static Public Member Functions | |
| static XNucleo6180XA1 * | instance (DevI2C *ext_i2c) | 
| Creates a singleton object instance. | |
| static XNucleo6180XA1 * | instance (DevI2C *ext_i2c, PinName gpio1_top, PinName gpio1_bottom, PinName gpio1_left, PinName gpio1_right) | 
| Creates a singleton object instance. | |
| Protected Member Functions | |
| XNucleo6180XA1 (DevI2C *ext_i2c) | |
| Constructor 1. | |
| XNucleo6180XA1 (DevI2C *ext_i2c, PinName gpio1_top, PinName gpio1_bottom, PinName gpio1_left, PinName gpio1_right) | |
| Constructor 2. | |
| XNucleo6180XA1 () | |
| Override default copy constructor as empty. | |
| void | operator= (const XNucleo6180XA1 &) | 
| Override default assignement operator to avoid multiple singletons. | |
Detailed Description
Class representing the X-NUCLEO-VL6180XA1 expansion board singleton obj.
Definition at line 67 of file XNucleo6180XA1.h.
Constructor & Destructor Documentation
| XNucleo6180XA1 | ( | DevI2C * | ext_i2c ) |  [protected] | 
Constructor 1.
x_nucleo_6180xa1 board Constructor. Default the INT gpio \ configuration as the electrical schematic. Self sensing for optional \ expansion sensors (L/B/R).
- Parameters:
- 
  [in] &i2c device I2C to be used for communication 
Definition at line 76 of file XNucleo6180XA1.h.
| XNucleo6180XA1 | ( | DevI2C * | ext_i2c, | 
| PinName | gpio1_top, | ||
| PinName | gpio1_bottom, | ||
| PinName | gpio1_left, | ||
| PinName | gpio1_right | ||
| ) |  [protected] | 
Constructor 2.
- Parameters:
- 
  [in] &i2c device I2C to be used for communication [in] PinName gpio1_top Mbed DigitalOut pin name to be used as a top sensor GPIO_1 INT [in] PinName gpio1_bottom Mbed DigitalOut pin name to be used as a bottom sensor GPIO_1 INT [in] PinName gpio1_left Mbed DigitalOut pin name to be used as a left sensor GPIO_1 INT [in] PinName gpio1_right Mbed DigitalOut pin name to be used as a right sensor GPIO_1 INT 
Definition at line 107 of file XNucleo6180XA1.h.
| XNucleo6180XA1 | ( | ) |  [protected] | 
Override default copy constructor as empty.
- Parameters:
- 
  [in] &XNucleo6180XA1 singleton object reference 
- Returns:
Definition at line 132 of file XNucleo6180XA1.h.
Member Function Documentation
| int init_board | ( | ) | 
Initialize the board and sensors with deft values.
- Returns:
- 0 on success
Definition at line 74 of file XNucleo6180XA1.cpp.
| XNucleo6180XA1 * instance | ( | DevI2C * | ext_i2c ) |  [static] | 
Creates a singleton object instance.
- Parameters:
- 
  [in] &i2c device I2C to be used for communication 
- Returns:
- Pointer to the object instance
Definition at line 51 of file XNucleo6180XA1.cpp.
| XNucleo6180XA1 * instance | ( | DevI2C * | ext_i2c, | 
| PinName | gpio1_top, | ||
| PinName | gpio1_bottom, | ||
| PinName | gpio1_left, | ||
| PinName | gpio1_right | ||
| ) |  [static] | 
Creates a singleton object instance.
- Parameters:
- 
  [in] &i2c device I2C to be used for communication [in] PinName gpio1_top the pin connected to top sensor INT [in] PinName gpio1_bottem the pin connected to bottom sensor INT [in] PinName gpio1_left the pin connected to left sensor INT [in] PinName gpio1_right the pin connected to right sensor INT 
- Returns:
- Pointer to the object instance
Definition at line 61 of file XNucleo6180XA1.cpp.
| bool is_sensor_bottom_present | ( | ) | 
Check the presence of sensor bottom.
To be called after init_board
- Returns:
- true is present, false if absent
Definition at line 190 of file XNucleo6180XA1.h.
| bool is_sensor_left_present | ( | ) | 
Check the presence of sensor left.
To be called after init_board
- Returns:
- true is present, false if absent
Definition at line 201 of file XNucleo6180XA1.h.
| bool is_sensor_right_present | ( | ) | 
Check the presence of sensor right.
To be called after init_board
- Returns:
- true is present, false if absent
Definition at line 212 of file XNucleo6180XA1.h.
| bool is_sensor_top_present | ( | ) | 
Check the presence of sensor top.
To be called after init_board
- Returns:
- true is present, false if absent
Definition at line 179 of file XNucleo6180XA1.h.
| void operator= | ( | const XNucleo6180XA1 & | ) |  [protected] | 
Override default assignement operator to avoid multiple singletons.
- Parameters:
- 
  [in] &XNucleo6180XA1 singleton object reference 
- Returns:
| bool rd_switch | ( | ) | 
Read the on board red slider switch.
- Returns:
- 0 or 1 according to switch position
Definition at line 171 of file XNucleo6180XA1.h.
Generated on Wed Jul 13 2022 23:03:14 by
 1.7.2
 1.7.2 
    
 X-NUCLEO-6180XA1   Proximity and Ambient Light Sensor
            X-NUCLEO-6180XA1   Proximity and Ambient Light Sensor