Updates to follow mbed SDK coding style guidelines.
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Dependents: 53L0A1_Satellites_with_Interrupts_OS5 Display_53L0A1_OS5
Fork of X_NUCLEO_53L0A1 by
Revision 14:d84672f45f7b, committed 2017-06-20
- Comitter:
- johnAlexander
- Date:
- Tue Jun 20 15:43:26 2017 +0000
- Parent:
- 13:615f7e38568c
- Child:
- 15:932d8b4e52c9
- Commit message:
- Update stmpe1600 & display classes to follow mbed SDK coding guidelines. Flow these updates in to vl53l0x_class and x_nucleo_53l0a1 class too.
Changed in this revision
--- a/Components/Display/Display_class.h Thu Jun 15 13:33:35 2017 +0000
+++ b/Components/Display/Display_class.h Tue Jun 20 15:43:26 2017 +0000
@@ -72,12 +72,12 @@
uint32_t u32; /*!< single dword i/o view */
}
/** cache the extended IO values */
-CurIOVal;
+cur_io_val;
/**
* lookup table for digit to bit position
*/
-static int DisplayBitPos[4]={0, 7, 16, 16+7};
+static int display_bit_posn[4]= {0, 7, 16, 16+7};
/**
* @defgroup XNUCLEO53L0A1_7Segment 7 segment display
@@ -96,22 +96,22 @@
* @{
*/
/** decimal point bit mapping* */
-#define DP (1<<7)
+#define DP (1 << 7)
/** sgement s0 bit mapping*/
-#define S0 (1<<3)
+#define S0 (1 << 3)
/** sgement s1 bit mapping*/
-#define S1 (1<<5)
+#define S1 (1 << 5)
/** sgement s2 bit mapping*/
-#define S2 (1<<6)
+#define S2 (1 << 6)
/** sgement s3 bit mapping*/
-#define S3 (1<<4)
+#define S3 (1 << 4)
/** sgement s4 bit mapping*/
-#define S4 (1<<0)
+#define S4 (1 << 0)
/** sgement s5 bit mapping*/
-#define S5 (1<<1)
+#define S5 (1 << 1)
/** sgement s6 bit mapping*/
-#define S6 (1<<2)
+#define S6 (1 << 2)
/**
* build a character by defining the non lighted segment (not one and no DP)
@@ -133,173 +133,173 @@
*/
#ifndef __cpluplus
/* refer to http://www.twyman.org.uk/Fonts/ */
-static const uint8_t ascii_to_display_lut[256]={
- 0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,
- [32]= 0,
- 0,0,0,0,0,0,0,0,
- 0,
- [42]= NOT_7_NO_DP(),
- 0,0,
- [45]= S6,
- 0,0,
- [48]= NOT_7_NO_DP(S6),
- [49]= S1+S2,
- [50]= S0+S1+S6+S4+S3,
- [51]= NOT_7_NO_DP(S4+S5),
- [52]= S5+S1+S6+S2,
- [53]= NOT_7_NO_DP(S1+S4),
- [54]= NOT_7_NO_DP(S1),
- [55]= S0+S1+S2,
- [56]= NOT_7_NO_DP(0),
- [57]= NOT_7_NO_DP(S4),
- 0,0,0,
- [61]= S3+S6,
- 0,
- [63]= NOT_7_NO_DP(S5+S3+S2),
- [64]= S0+S3,
- [65]= NOT_7_NO_DP(S3),
- [66]= NOT_7_NO_DP(S0+S1), /* as b */
- [67]= S0+S3+S4+S5, // same as [
- [68]= S0+S3+S4+S5, // same as [ DUMMY
- [69]= NOT_7_NO_DP(S1+S2),
- [70]= S6+S5+S4+S0,
- [71]= NOT_7_NO_DP(S4), /* same as 9 */
- [72]= NOT_7_NO_DP(S0+S3),
- [73]= S1+S2,
- [74]= S1+S2+S3+S4,
- [75]= NOT_7_NO_DP(S0+S3), /* same as H */
- [76]= S3+S4+S5,
- [77]= S0+S4+S2, /* same as m*/
- [78]= S2+S4+S6, /* same as n*/
- [79]= NOT_7_NO_DP(S6),
- [80]= S0+S1+S2+S5+S6, // sames as 'q'
- [81]= NOT_7_NO_DP(S3+S2),
- [82]= S4+S6,
- [83]= NOT_7_NO_DP(S1+S4), /* sasme as 5 */
- [84]= NOT_7_NO_DP(S0+S1+S2), /* sasme as t */
- [85]= NOT_7_NO_DP(S6+S0),
- [86]= S4+S3+S2, // is u but u use U
- [87]= S1+S3+S5,
- [88]= NOT_7_NO_DP(S0+S3), // similar to H
- [89]= NOT_7_NO_DP(S0+S4),
- [90]= S0+S1+S6+S4+S3, // same as 2
- [91]= S0+S3+S4+S5,
- 0,
- [93]= S0+S3+S2+S1,
- [94]= S0, /* use as top bar */
- [95]= S3,
- 0,
- [97]= S2+ S3+ S4+ S6 ,
- [98]= NOT_7_NO_DP(S0+S1),
- [99]= S6+S4+S3,
- [100]= NOT_7_NO_DP(S0+S5),
- [101]= NOT_7_NO_DP(S2),
- [102]= S6+S5+S4+S0, /* same as F */
- [103]= NOT_7_NO_DP(S4), /* same as 9 */
- [104]= S6+S5+S4+S2,
- [105]= S4,
- [106]= S1+S2+S3+S4,
- [107]= S6+S5+S4+S2, /* a h */
- [108]= S3+S4,
- [109]= S0+S4+S2, /* same as */
- [110]= S2+S4+S6,
- [111]= S6+S4+S3+S2,
- [112]= NOT_7_NO_DP(S3+S2), // same as P
- [113]= S0+S1+S2+S5+S6,
- [114]= S4+S6,
- [115]= NOT_7_NO_DP(S1+S4),
- [116]= NOT_7_NO_DP(S0+S1+S2),
- [117]= S4+S3+S2+S5+S1, // U
- [118]= S4+S3+S2, // is u but u use U
- [119]= S1+S3+S5,
- [120]= NOT_7_NO_DP(S0+S3), // similar to H
- [121]= NOT_7_NO_DP(S0+S4),
- [122]= S0+S1+S6+S4+S3, // same as 2
- 0,0,0,
- [126]= S0+S3+S6 /* 3 h bar */
+static const uint8_t ascii_to_display_lut[256]= {
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,
+ [32]= 0,
+ 0,0,0,0,0,0,0,0,
+ 0,
+ [42]= NOT_7_NO_DP(),
+ 0,0,
+ [45]= S6,
+ 0,0,
+ [48]= NOT_7_NO_DP(S6),
+ [49]= S1+S2,
+ [50]= S0+S1+S6+S4+S3,
+ [51]= NOT_7_NO_DP(S4+S5),
+ [52]= S5+S1+S6+S2,
+ [53]= NOT_7_NO_DP(S1+S4),
+ [54]= NOT_7_NO_DP(S1),
+ [55]= S0+S1+S2,
+ [56]= NOT_7_NO_DP(0),
+ [57]= NOT_7_NO_DP(S4),
+ 0,0,0,
+ [61]= S3+S6,
+ 0,
+ [63]= NOT_7_NO_DP(S5+S3+S2),
+ [64]= S0+S3,
+ [65]= NOT_7_NO_DP(S3),
+ [66]= NOT_7_NO_DP(S0+S1), /* as b */
+ [67]= S0+S3+S4+S5, // same as [
+ [68]= S0+S3+S4+S5, // same as [ DUMMY
+ [69]= NOT_7_NO_DP(S1+S2),
+ [70]= S6+S5+S4+S0,
+ [71]= NOT_7_NO_DP(S4), /* same as 9 */
+ [72]= NOT_7_NO_DP(S0+S3),
+ [73]= S1+S2,
+ [74]= S1+S2+S3+S4,
+ [75]= NOT_7_NO_DP(S0+S3), /* same as H */
+ [76]= S3+S4+S5,
+ [77]= S0+S4+S2, /* same as m*/
+ [78]= S2+S4+S6, /* same as n*/
+ [79]= NOT_7_NO_DP(S6),
+ [80]= S0+S1+S2+S5+S6, // sames as 'q'
+ [81]= NOT_7_NO_DP(S3+S2),
+ [82]= S4+S6,
+ [83]= NOT_7_NO_DP(S1+S4), /* sasme as 5 */
+ [84]= NOT_7_NO_DP(S0+S1+S2), /* sasme as t */
+ [85]= NOT_7_NO_DP(S6+S0),
+ [86]= S4+S3+S2, // is u but u use U
+ [87]= S1+S3+S5,
+ [88]= NOT_7_NO_DP(S0+S3), // similar to H
+ [89]= NOT_7_NO_DP(S0+S4),
+ [90]= S0+S1+S6+S4+S3, // same as 2
+ [91]= S0+S3+S4+S5,
+ 0,
+ [93]= S0+S3+S2+S1,
+ [94]= S0, /* use as top bar */
+ [95]= S3,
+ 0,
+ [97]= S2+ S3+ S4+ S6,
+ [98]= NOT_7_NO_DP(S0+S1),
+ [99]= S6+S4+S3,
+ [100]= NOT_7_NO_DP(S0+S5),
+ [101]= NOT_7_NO_DP(S2),
+ [102]= S6+S5+S4+S0, /* same as F */
+ [103]= NOT_7_NO_DP(S4), /* same as 9 */
+ [104]= S6+S5+S4+S2,
+ [105]= S4,
+ [106]= S1+S2+S3+S4,
+ [107]= S6+S5+S4+S2, /* a h */
+ [108]= S3+S4,
+ [109]= S0+S4+S2, /* same as */
+ [110]= S2+S4+S6,
+ [111]= S6+S4+S3+S2,
+ [112]= NOT_7_NO_DP(S3+S2), // same as P
+ [113]= S0+S1+S2+S5+S6,
+ [114]= S4+S6,
+ [115]= NOT_7_NO_DP(S1+S4),
+ [116]= NOT_7_NO_DP(S0+S1+S2),
+ [117]= S4+S3+S2+S5+S1, // U
+ [118]= S4+S3+S2, // is u but u use U
+ [119]= S1+S3+S5,
+ [120]= NOT_7_NO_DP(S0+S3), // similar to H
+ [121]= NOT_7_NO_DP(S0+S4),
+ [122]= S0+S1+S6+S4+S3, // same as 2
+ 0,0,0,
+ [126]= S0+S3+S6 /* 3 h bar */
};
#else
/* refer to http://www.twyman.org.uk/Fonts/ */
-static const uint8_t ascii_to_display_lut[256]={
- [' ']= 0,
- ['-']= S6,
- ['_']= S3,
- ['=']= S3+S6,
- ['~']= S0+S3+S6, /* 3 h bar */
- ['^']= S0, /* use as top bar */
+static const uint8_t ascii_to_display_lut[256]= {
+ [' ']= 0,
+ ['-']= S6,
+ ['_']= S3,
+ ['=']= S3+S6,
+ ['~']= S0+S3+S6, /* 3 h bar */
+ ['^']= S0, /* use as top bar */
- ['?']= NOT_7_NO_DP(S5+S3+S2),
- ['*']= NOT_7_NO_DP(),
- ['[']= S0+S3+S4+S5,
- [']']= S0+S3+S2+S1,
- ['@']= S0+S3,
+ ['?']= NOT_7_NO_DP(S5+S3+S2),
+ ['*']= NOT_7_NO_DP(),
+ ['[']= S0+S3+S4+S5,
+ [']']= S0+S3+S2+S1,
+ ['@']= S0+S3,
- ['0']= NOT_7_NO_DP(S6),
- ['1']= S1+S2,
- ['2']= S0+S1+S6+S4+S3,
- ['3']= NOT_7_NO_DP(S4+S5),
- ['4']= S5+S1+S6+S2,
- ['5']= NOT_7_NO_DP(S1+S4),
- ['6']= NOT_7_NO_DP(S1),
- ['7']= S0+S1+S2,
- ['8']= NOT_7_NO_DP(0),
- ['9']= NOT_7_NO_DP(S4),
+ ['0']= NOT_7_NO_DP(S6),
+ ['1']= S1+S2,
+ ['2']= S0+S1+S6+S4+S3,
+ ['3']= NOT_7_NO_DP(S4+S5),
+ ['4']= S5+S1+S6+S2,
+ ['5']= NOT_7_NO_DP(S1+S4),
+ ['6']= NOT_7_NO_DP(S1),
+ ['7']= S0+S1+S2,
+ ['8']= NOT_7_NO_DP(0),
+ ['9']= NOT_7_NO_DP(S4),
- ['a']= S2+ S3+ S4+ S6 ,
- ['b']= NOT_7_NO_DP(S0+S1),
- ['c']= S6+S4+S3,
- ['d']= NOT_7_NO_DP(S0+S5),
- ['e']= NOT_7_NO_DP(S2),
- ['f']= S6+S5+S4+S0, /* same as F */
- ['g']= NOT_7_NO_DP(S4), /* same as 9 */
- ['h']= S6+S5+S4+S2,
- ['i']= S4,
- ['j']= S1+S2+S3+S4,
- ['k']= S6+S5+S4+S2, /* a h */
- ['l']= S3+S4,
- ['m']= S0+S4+S2, /* same as */
- ['n']= S2+S4+S6,
- ['o']= S6+S4+S3+S2,
- ['p']= NOT_7_NO_DP(S3+S2), // same as P
- ['q']= S0+S1+S2+S5+S6,
- ['r']= S4+S6,
- ['s']= NOT_7_NO_DP(S1+S4),
- ['t']= NOT_7_NO_DP(S0+S1+S2),
- ['u']= S4+S3+S2+S5+S1, // U
- ['v']= S4+S3+S2, // is u but u use U
- ['w']= S1+S3+S5,
- ['x']= NOT_7_NO_DP(S0+S3), // similar to H
- ['y']= NOT_7_NO_DP(S0+S4),
- ['z']= S0+S1+S6+S4+S3, // same as 2
+ ['a']= S2+ S3+ S4+ S6,
+ ['b']= NOT_7_NO_DP(S0+S1),
+ ['c']= S6+S4+S3,
+ ['d']= NOT_7_NO_DP(S0+S5),
+ ['e']= NOT_7_NO_DP(S2),
+ ['f']= S6+S5+S4+S0, /* same as F */
+ ['g']= NOT_7_NO_DP(S4), /* same as 9 */
+ ['h']= S6+S5+S4+S2,
+ ['i']= S4,
+ ['j']= S1+S2+S3+S4,
+ ['k']= S6+S5+S4+S2, /* a h */
+ ['l']= S3+S4,
+ ['m']= S0+S4+S2, /* same as */
+ ['n']= S2+S4+S6,
+ ['o']= S6+S4+S3+S2,
+ ['p']= NOT_7_NO_DP(S3+S2), // same as P
+ ['q']= S0+S1+S2+S5+S6,
+ ['r']= S4+S6,
+ ['s']= NOT_7_NO_DP(S1+S4),
+ ['t']= NOT_7_NO_DP(S0+S1+S2),
+ ['u']= S4+S3+S2+S5+S1, // U
+ ['v']= S4+S3+S2, // is u but u use U
+ ['w']= S1+S3+S5,
+ ['x']= NOT_7_NO_DP(S0+S3), // similar to H
+ ['y']= NOT_7_NO_DP(S0+S4),
+ ['z']= S0+S1+S6+S4+S3, // same as 2
- ['A']= NOT_7_NO_DP(S3),
- ['B']= NOT_7_NO_DP(S0+S1), /* as b */
- ['C']= S0+S3+S4+S5, // same as [
- ['E']= NOT_7_NO_DP(S1+S2),
- ['F']= S6+S5+S4+S0,
- ['G']= NOT_7_NO_DP(S4), /* same as 9 */
- ['H']= NOT_7_NO_DP(S0+S3),
- ['I']= S1+S2,
- ['J']= S1+S2+S3+S4,
- ['K']= NOT_7_NO_DP(S0+S3), /* same as H */
- ['L']= S3+S4+S5,
- ['M']= S0+S4+S2, /* same as m*/
- ['N']= S2+S4+S6, /* same as n*/
- ['O']= NOT_7_NO_DP(S6),
- ['P']= S0+S1+S2+S5+S6, // sames as 'q'
- ['Q']= NOT_7_NO_DP(S3+S2),
- ['R']= S4+S6,
- ['S']= NOT_7_NO_DP(S1+S4), /* sasme as 5 */
- ['T']= NOT_7_NO_DP(S0+S1+S2), /* sasme as t */
- ['U']= NOT_7_NO_DP(S6+S0),
- ['V']= S4+S3+S2, // is u but u use U
- ['W']= S1+S3+S5,
- ['X']= NOT_7_NO_DP(S0+S3), // similar to H
- ['Y']= NOT_7_NO_DP(S0+S4),
- ['Z']= S0+S1+S6+S4+S3 // same as 2
+ ['A']= NOT_7_NO_DP(S3),
+ ['B']= NOT_7_NO_DP(S0+S1), /* as b */
+ ['C']= S0+S3+S4+S5, // same as [
+ ['E']= NOT_7_NO_DP(S1+S2),
+ ['F']= S6+S5+S4+S0,
+ ['G']= NOT_7_NO_DP(S4), /* same as 9 */
+ ['H']= NOT_7_NO_DP(S0+S3),
+ ['I']= S1+S2,
+ ['J']= S1+S2+S3+S4,
+ ['K']= NOT_7_NO_DP(S0+S3), /* same as H */
+ ['L']= S3+S4+S5,
+ ['M']= S0+S4+S2, /* same as m*/
+ ['N']= S2+S4+S6, /* same as n*/
+ ['O']= NOT_7_NO_DP(S6),
+ ['P']= S0+S1+S2+S5+S6, // sames as 'q'
+ ['Q']= NOT_7_NO_DP(S3+S2),
+ ['R']= S4+S6,
+ ['S']= NOT_7_NO_DP(S1+S4), /* sasme as 5 */
+ ['T']= NOT_7_NO_DP(S0+S1+S2), /* sasme as t */
+ ['U']= NOT_7_NO_DP(S6+S0),
+ ['V']= S4+S3+S2, // is u but u use U
+ ['W']= S1+S3+S5,
+ ['X']= NOT_7_NO_DP(S0+S3), // similar to H
+ ['Y']= NOT_7_NO_DP(S0+S4),
+ ['Z']= S0+S1+S6+S4+S3 // same as 2
};
#endif
@@ -315,91 +315,93 @@
/** @} */
-//#define DISPLAY_DELAY 1 // in mSec
+//#define DISPLAY_DELAY 1 // in mSec
/* Classes -------------------------------------------------------------------*/
/** Class representing Display
- */
+ */
class Display
{
private:
- STMPE1600 &stmpe1600_exp0;
- STMPE1600 &stmpe1600_exp1;
+ Stmpe1600 &stmpe1600_exp0;
+ Stmpe1600 &stmpe1600_exp1;
public:
- /** Constructor
- * @param[in] &stmpe_1600 device handler to be used for display control
- */
- Display (STMPE1600 &stmpe_1600_exp0, STMPE1600 &stmpe_1600_exp1) : stmpe1600_exp0(stmpe_1600_exp0), stmpe1600_exp1(stmpe_1600_exp1) {
- uint16_t ExpanderData;
+ /** Constructor
+ * @param[in] &stmpe_1600 device handler to be used for display control
+ */
+ Display (Stmpe1600 &stmpe_1600_exp0, Stmpe1600 &stmpe_1600_exp1) : stmpe1600_exp0(stmpe_1600_exp0), stmpe1600_exp1(stmpe_1600_exp1)
+ {
+ uint16_t expander_data;
// detect the extenders
- stmpe1600_exp0.read16bitReg(0x00, &ExpanderData);
+ stmpe1600_exp0.read_16bit_reg(0x00, &expander_data);
// if (ExpanderData != 0x1600) {/* log - failed to find expander exp0 */ }
- stmpe1600_exp1.read16bitReg(0x00, &ExpanderData);
+ stmpe1600_exp1.read_16bit_reg(0x00, &expander_data);
// if (ExpanderData != 0x1600) {/* log - failed to find expander exp1 */ }
// configure all necessary GPIO pins as outputs
- ExpanderData = 0xFFFF;
- stmpe1600_exp0.write16bitReg(GPDR, &ExpanderData);
- ExpanderData = 0xBFFF; // leave bit 14 as an input, for the pushbutton, PB1.
- stmpe1600_exp1.write16bitReg(GPDR, &ExpanderData);
+ expander_data = 0xFFFF;
+ stmpe1600_exp0.write_16bit_reg(GPDR, &expander_data);
+ expander_data = 0xBFFF; // leave bit 14 as an input, for the pushbutton, PB1.
+ stmpe1600_exp1.write_16bit_reg(GPDR, &expander_data);
// shut down all segment and all device
- ExpanderData = 0x7F + (0x7F << 7);
- stmpe1600_exp0.write16bitReg(GPSR, &ExpanderData);
- stmpe1600_exp1.write16bitReg(GPSR, &ExpanderData);
+ expander_data = 0x7F + (0x7F << 7);
+ stmpe1600_exp0.write_16bit_reg(GPSR, &expander_data);
+ stmpe1600_exp1.write_16bit_reg(GPSR, &expander_data);
}
-
- /*** Interface Methods ***/
- /**
- * @brief Print the string on display
- * @param[in] String to be printed
- * @param[in] String lenght [min 1, max 4]
- * @return void
- */
- void DisplayString (const char *str)
+
+ /*** Interface Methods ***/
+ /**
+ * @brief Print the string on display
+ * @param[in] String to be printed
+ * @param[in] String lenght [min 1, max 4]
+ * @return void
+ */
+ void display_string (const char *str)
{
- uint16_t ExpanderData;
- uint32_t Segments;
- int BitPos;
+ uint16_t expander_data;
+ uint32_t segments;
+ int bit_posn;
int i;
- for( i=0; i<4 && str[i]!=0; i++){
- Segments = (uint32_t)ascii_to_display_lut[(uint8_t)str[i]];
- Segments =(~Segments)&0x7F;
- BitPos=DisplayBitPos[i];
- CurIOVal.u32 &=~(0x7F<<BitPos);
- CurIOVal.u32 |= Segments<<BitPos;
+ for (i = 0; (i < 4 && str[i] != 0); i++)
+ {
+ segments = (uint32_t)ascii_to_display_lut[(uint8_t)str[i]];
+ segments =(~segments) & 0x7F;
+ bit_posn = display_bit_posn[i];
+ cur_io_val.u32 &= ~(0x7F << bit_posn);
+ cur_io_val.u32 |= segments << bit_posn;
}
/* clear unused digit */
- for( ; i<4;i++){
- BitPos=DisplayBitPos[i];
- CurIOVal.u32 |=0x7F<<BitPos;
+ for( ; i < 4; i++)
+ {
+ bit_posn = display_bit_posn[i];
+ cur_io_val.u32 |= 0x7F << bit_posn;
}
// stmpe1600_exp0.write16bitReg(GPSR, (uint16_t *)&CurIOVal.bytes[0]);
// stmpe1600_exp1.write16bitReg(GPSR, (uint16_t *)&CurIOVal.bytes[2]);
// ordered low-byte/high-byte!
- CurIOVal.bytes[1] |= 0xC0; // ensure highest bits are high, as these are xshutdown pins for left & right sensors!
- ExpanderData = (CurIOVal.bytes[1] << 8) + CurIOVal.bytes[0];
- stmpe1600_exp0.write16bitReg(GPSR, &ExpanderData);
- CurIOVal.bytes[3] |= 0x80; // ensure highest bit is high, as this is xshutdown pin on central sensor!
- ExpanderData = (CurIOVal.bytes[3] << 8) + CurIOVal.bytes[2];
- stmpe1600_exp1.write16bitReg(GPSR, &ExpanderData);
+ cur_io_val.bytes[1] |= 0xC0; // ensure highest bits are high, as these are xshutdown pins for left & right sensors!
+ expander_data = (cur_io_val.bytes[1] << 8) + cur_io_val.bytes[0];
+ stmpe1600_exp0.write_16bit_reg(GPSR, &expander_data);
+ cur_io_val.bytes[3] |= 0x80; // ensure highest bit is high, as this is xshutdown pin on central sensor!
+ expander_data = (cur_io_val.bytes[3] << 8) + cur_io_val.bytes[2];
+ stmpe1600_exp1.write_16bit_reg(GPSR, &expander_data);
}
- void ClearDisplay(void)
+ void clear_display(void)
{
- uint16_t ExpanderData;
+ uint16_t expander_data;
- ExpanderData = 0x7F + (0x7F << 7);
- stmpe1600_exp0.write16bitReg(GPSR, &ExpanderData);
- stmpe1600_exp1.write16bitReg(GPSR, &ExpanderData);
+ expander_data = 0x7F + (0x7F << 7);
+ stmpe1600_exp0.write_16bit_reg(GPSR, &expander_data);
+ stmpe1600_exp1.write_16bit_reg(GPSR, &expander_data);
}
-
};
#ifdef __cplusplus
--- a/Components/STMPE1600/stmpe1600_class.h Thu Jun 15 13:33:35 2017 +0000
+++ b/Components/STMPE1600/stmpe1600_class.h Tue Jun 20 15:43:26 2017 +0000
@@ -39,17 +39,20 @@
/* Includes ------------------------------------------------------------------*/
#include "DevI2C.h"
-#define STMPE1600_DEF_DEVICE_ADDRESS (uint8_t)0x42*2
+#define STMPE1600_DEF_DEVICE_ADDRESS (uint8_t)0x42*2
#define STMPE1600_DEF_DIGIOUT_LVL 1
/** STMPE1600 registr map **/
-#define ChipID_0_7 (uint8_t)0x00
-#define ChipID_8_15 (uint8_t)0x01
-#define VersionId (uint8_t)0x02
-#define SYS_CTRL (uint8_t)0x03
-#define IEGPIOR_0_7 (uint8_t)0x08
+//#define ChipID_0_7 (uint8_t)0x00
+#define CHIP_ID_0_7 (uint8_t)0x00
+//#define ChipID_8_15 (uint8_t)0x01
+#define CHIP_ID_8_15 (uint8_t)0x01
+//#define VersionId (uint8_t)0x02
+#define VERSION_ID (uint8_t)0x02
+#define SYS_CTRL (uint8_t)0x03
+#define IEGPIOR_0_7 (uint8_t)0x08
#define IEGPIOR_8_15 (uint8_t)0x09
-#define ISGPIOR_0_7 (uint8_t)0x0A
+#define ISGPIOR_0_7 (uint8_t)0x0A
#define ISGPIOR_8_15 (uint8_t)0x0B
#define GPMR_0_7 (uint8_t)0x10
#define GPMR_8_15 (uint8_t)0x11
@@ -60,250 +63,279 @@
#define GPIR_0_7 (uint8_t)0x16
#define GPIR_8_15 (uint8_t)0x17
-#define SOFT_RESET (uint8_t)0x80
+#define SOFT_RESET (uint8_t)0x80
- typedef enum {
+typedef enum {
// GPIO Expander pin names
GPIO_0=0,
GPIO_1,
GPIO_2,
- GPIO_3,
+ GPIO_3,
GPIO_4,
GPIO_5,
GPIO_6,
- GPIO_7,
+ GPIO_7,
GPIO_8,
GPIO_9,
GPIO_10,
- GPIO_11,
+ GPIO_11,
GPIO_12,
GPIO_13,
GPIO_14,
GPIO_15,
- NOT_CON
-} ExpGpioPinName;
+ NOT_CON
+} ExpGpioPinName;
typedef enum {
INPUT = 0,
OUTPUT,
NOT_CONNECTED
-}ExpGpioPinDirection;
+} ExpGpioPinDirection;
/* Classes -------------------------------------------------------------------*/
/** Class representing a single stmpe1600 GPIO expander output pin
*/
-class STMPE1600DigiOut {
-
- public:
+//class STMPE1600DigiOut {
+class Stmpe1600DigiOut
+{
+
+public:
/** Constructor
* @param[in] &i2c device I2C to be used for communication
* @param[in] outpinname the desired out pin name to be created
- * @param[in] DevAddr the stmpe1600 I2C device addres (deft STMPE1600_DEF_DEVICE_ADDRESS)
- * @param[in] lvl the default ot pin level
- */
- STMPE1600DigiOut (DevI2C &i2c, ExpGpioPinName outpinname, uint8_t DevAddr=STMPE1600_DEF_DEVICE_ADDRESS, bool lvl=STMPE1600_DEF_DIGIOUT_LVL): dev_i2c(i2c), expdevaddr(DevAddr), exppinname(outpinname)
+ * @param[in] DevAddr the stmpe1600 I2C device address (deft STMPE1600_DEF_DEVICE_ADDRESS)
+ * @param[in] lvl the default ot pin level
+ */
+// STMPE1600DigiOut (DevI2C &i2c, ExpGpioPinName outpinname, uint8_t DevAddr=STMPE1600_DEF_DEVICE_ADDRESS, bool lvl=STMPE1600_DEF_DIGIOUT_LVL): dev_i2c(i2c), expdevaddr(DevAddr), exppinname(outpinname)
+ Stmpe1600DigiOut(DevI2C &i2c, ExpGpioPinName out_pin_name, uint8_t dev_addr=STMPE1600_DEF_DEVICE_ADDRESS, bool lvl=STMPE1600_DEF_DIGIOUT_LVL): dev_i2c(i2c), exp_dev_addr(dev_addr), exp_pin_name(out_pin_name)
{
- uint8_t data[2];
- if (exppinname == NOT_CON) return;
- /* set the exppinname as output */
- dev_i2c.i2c_read(data, expdevaddr, GPDR_0_7, 1);
- dev_i2c.i2c_read(&data[1], expdevaddr, GPDR_8_15, 1);
- *(uint16_t*)data = *(uint16_t*)data | (1<<(uint16_t)exppinname); // set gpio as out
- dev_i2c.i2c_write(data, expdevaddr, GPDR_0_7, 1);
- dev_i2c.i2c_write(&data[1], expdevaddr, GPDR_8_15, 1);
- write(lvl);
- }
+ uint8_t data[2];
- /**
- * @brief Write on the out pin
- * @param[in] lvl level to write
- * @return 0 on Success
- */
- void write (int lvl)
- {
- uint8_t data[2];
- if (exppinname == NOT_CON) return;
- /* set the exppinname state to lvl */
- dev_i2c.i2c_read(data, expdevaddr, GPSR_0_7, 2);
- *(uint16_t*)data = *(uint16_t*)data & (uint16_t)(~(1<<(uint16_t)exppinname)); // set pin mask
- if (lvl) *(uint16_t*)data = *(uint16_t*)data | (uint16_t)(1<<(uint16_t)exppinname);
- dev_i2c.i2c_write(data, expdevaddr, GPSR_0_7, 2);
+ if (exp_pin_name == NOT_CON)
+ return;
+ /* set the exp_pin_name as output */
+ dev_i2c.i2c_read(data, exp_dev_addr, GPDR_0_7, 1);
+ dev_i2c.i2c_read(&data[1], exp_dev_addr, GPDR_8_15, 1);
+ *(uint16_t*)data = *(uint16_t*)data | (1 << (uint16_t)exp_pin_name); // set gpio as out
+ dev_i2c.i2c_write(data, exp_dev_addr, GPDR_0_7, 1);
+ dev_i2c.i2c_write(&data[1], exp_dev_addr, GPDR_8_15, 1);
+ write(lvl);
}
- /**
- * @brief Overload assignement operator
- */
- STMPE1600DigiOut& operator=(int lvl)
+ /**
+ * @brief Write on the out pin
+ * @param[in] lvl level to write
+ * @return 0 on Success
+ */
+ void write(int lvl)
{
- write (lvl);
- return *this;
- }
-
- private:
- DevI2C &dev_i2c;
- uint8_t expdevaddr;
- ExpGpioPinName exppinname;
+ uint8_t data[2];
+
+ if (exp_pin_name == NOT_CON)
+ return;
+ /* set the exp_pin_name state to lvl */
+ dev_i2c.i2c_read(data, exp_dev_addr, GPSR_0_7, 2);
+ *(uint16_t*)data = *(uint16_t*)data & (uint16_t)(~(1 << (uint16_t)exp_pin_name)); // set pin mask
+ if (lvl) *(uint16_t*)data = *(uint16_t*)data | (uint16_t)(1 << (uint16_t)exp_pin_name);
+ dev_i2c.i2c_write(data, exp_dev_addr, GPSR_0_7, 2);
+ }
+
+ /**
+ * @brief Overload assignement operator
+ */
+// STMPE1600DigiOut& operator=(int lvl)
+ Stmpe1600DigiOut& operator=(int lvl)
+ {
+ write (lvl);
+ return *this;
+ }
+
+private:
+ DevI2C &dev_i2c;
+ uint8_t exp_dev_addr;
+ ExpGpioPinName exp_pin_name;
};
/* Classes -------------------------------------------------------------------*/
/** Class representing a single stmpe1600 GPIO expander input pin
*/
-class STMPE1600DigiIn
-{
- public:
- /** Constructor
- * @param[in] &i2c device I2C to be used for communication
- * @param[in] inpinname the desired input pin name to be created
- * @param[in] DevAddr the stmpe1600 I2C device addres (deft STMPE1600_DEF_DEVICE_ADDRESS)
- */
- STMPE1600DigiIn (DevI2C &i2c, ExpGpioPinName inpinname, uint8_t DevAddr=STMPE1600_DEF_DEVICE_ADDRESS): dev_i2c(i2c), expdevaddr(DevAddr), exppinname(inpinname)
+//class STMPE1600DigiIn
+class Stmpe1600DigiIn
+{
+public:
+ /** Constructor
+ * @param[in] &i2c device I2C to be used for communication
+ * @param[in] inpinname the desired input pin name to be created
+ * @param[in] DevAddr the stmpe1600 I2C device addres (deft STMPE1600_DEF_DEVICE_ADDRESS)
+ */
+// STMPE1600DigiIn (DevI2C &i2c, ExpGpioPinName inpinname, uint8_t DevAddr=STMPE1600_DEF_DEVICE_ADDRESS): dev_i2c(i2c), expdevaddr(DevAddr), exppinname(inpinname)
+ Stmpe1600DigiIn(DevI2C &i2c, ExpGpioPinName in_pin_name, uint8_t dev_addr=STMPE1600_DEF_DEVICE_ADDRESS): dev_i2c(i2c), exp_dev_addr(dev_addr), exp_pin_name(in_pin_name)
{
- uint8_t data[2];
- if (exppinname == NOT_CON) return;
- /* set the exppinname as input pin direction */
- dev_i2c.i2c_read(data, expdevaddr, GPDR_0_7, 2);
- *(uint16_t*)data = *(uint16_t*)data & (uint16_t)(~(1<<(uint16_t)exppinname)); // set gpio as in
- dev_i2c.i2c_write(data, expdevaddr, GPDR_0_7, 2);
- }
+ uint8_t data[2];
+
+ if (exp_pin_name == NOT_CON)
+ return;
+ /* set the exp_pin_name as input pin direction */
+ dev_i2c.i2c_read(data, exp_dev_addr, GPDR_0_7, 2);
+ *(uint16_t*)data = *(uint16_t*)data & (uint16_t)(~(1 << (uint16_t)exp_pin_name)); // set gpio as in
+ dev_i2c.i2c_write(data, exp_dev_addr, GPDR_0_7, 2);
+ }
- /**
- * @brief Read the input pin
- * @return The pin logical state 0 or 1
- */
- bool read ()
+ /**
+ * @brief Read the input pin
+ * @return The pin logical state 0 or 1
+ */
+ bool read()
{
- uint8_t data[2];
- if (exppinname == NOT_CON) return 0;
- /* read the exppinname */
- dev_i2c.i2c_read(data, expdevaddr, GPMR_0_7, 2);
- *(uint16_t*)data = *(uint16_t*)data & (uint16_t)(1<<(uint16_t)exppinname); // mask the in gpio
- if (data[0] || data[1]) return 1;
- return 0;
+ uint8_t data[2];
+
+ if (exp_pin_name == NOT_CON)
+ return false;
+ /* read the exp_pin_name */
+ dev_i2c.i2c_read(data, exp_dev_addr, GPMR_0_7, 2);
+ *(uint16_t*)data = *(uint16_t*)data & (uint16_t)(1 << (uint16_t)exp_pin_name); // mask the in gpio
+ if (data[0] || data[1]) return true;
+ return false;
}
-
- operator int()
- {
- return read();
- }
-
- private:
- DevI2C &dev_i2c;
- uint8_t expdevaddr;
- ExpGpioPinName exppinname;
+
+ operator int()
+ {
+ return read();
+ }
+
+private:
+ DevI2C &dev_i2c;
+ uint8_t exp_dev_addr;
+ ExpGpioPinName exp_pin_name;
};
/* Classes -------------------------------------------------------------------*/
/** Class representing a whole stmpe1600 component (16 gpio)
*/
-class STMPE1600 {
-
- public:
+//class STMPE1600 {
+class Stmpe1600
+{
+
+public:
/** Constructor
* @param[in] &i2c device I2C to be used for communication
* @param[in] DevAddr the stmpe1600 I2C device addres (deft STMPE1600_DEF_DEVICE_ADDRESS)
- */
- STMPE1600 (DevI2C &i2c, uint8_t DevAddr=STMPE1600_DEF_DEVICE_ADDRESS ) : dev_i2c(i2c)
- {
- dev_i2c = i2c;
- expdevaddr = DevAddr;
- writeSYS_CTRL (SOFT_RESET);
-
- GPDR0_15 = (uint16_t)0; // gpio dir all IN
- write16bitReg (GPDR_0_7, &GPDR0_15);
- GPSR0_15 = (uint16_t)0x0ffff; // gpio status all 1
- write16bitReg (GPSR_0_7, &GPSR0_15);
+ */
+// STMPE1600 (DevI2C &i2c, uint8_t DevAddr=STMPE1600_DEF_DEVICE_ADDRESS ) : dev_i2c(i2c)
+ Stmpe1600(DevI2C &i2c, uint8_t dev_addr=STMPE1600_DEF_DEVICE_ADDRESS ) : dev_i2c(i2c)
+ {
+ dev_i2c = i2c;
+ exp_dev_addr = dev_addr;
+ write_sys_ctrl(SOFT_RESET);
+
+ gpdr0_15 = (uint16_t)0; // gpio dir all IN
+ write_16bit_reg(GPDR_0_7, &gpdr0_15);
+ gpsr0_15 = (uint16_t)0x0ffff; // gpio status all 1
+ write_16bit_reg(GPSR_0_7, &gpsr0_15);
+ }
+
+ /**
+ * @brief Write the SYS_CTRL register
+ * @param[in] Data to be written (bit fields)
+ */
+// void writeSYS_CTRL (uint8_t data) // data = SOFT_RESET reset the device
+ void write_sys_ctrl (uint8_t data) // data = SOFT_RESET reset the device
+ {
+ dev_i2c.i2c_write(&data, exp_dev_addr, SYS_CTRL, 1);
+ }
+
+ /**
+ * @brief Set the out pin
+ * @param[in] The pin name
+ * @return 0 on Success
+ */
+// bool setGPIO (ExpGpioPinName PinName)
+ bool set_gpio (ExpGpioPinName pin_name)
+ {
+ if (pin_name == NOT_CON)
+ return true;
+ gpsr0_15 = gpsr0_15 | ((uint16_t)0x0001 << pin_name);
+ write_16bit_reg (GPSR_0_7, &gpsr0_15);
+ return false;
+ }
+
+ /**
+ * @brief Clear the out pin
+ * @param[in] The pin name
+ * @return 0 on Success
+ */
+// bool clrGPIO (ExpGpioPinName PinName)
+ bool clear_gpio (ExpGpioPinName pin_name)
+ {
+ if (pin_name == NOT_CON)
+ return true;
+ gpsr0_15 = gpsr0_15 & (~((uint16_t)0x0001 << pin_name));
+ write_16bit_reg(GPSR_0_7, &gpsr0_15);
+ return false;
}
- /**
- * @brief Write the SYS_CTRL register
- * @param[in] Data to be written (bit fields)
- */
- void writeSYS_CTRL (uint8_t data) // data = SOFT_RESET reset the device
+ /**
+ * @brief Read the input pin
+ * @param[in] The pin name
+ * @return The logical pin level
+ */
+// bool rdGPIO (ExpGpioPinName PinName)
+ bool read_gpio (ExpGpioPinName pin_name)
{
- dev_i2c.i2c_write(&data, expdevaddr, SYS_CTRL, 1);
+ uint16_t gpmr0_15;
+ if (pin_name == NOT_CON)
+ return true;
+ read_16bit_reg(GPMR_0_7, &gpmr0_15);
+ gpmr0_15 = gpmr0_15 & ((uint16_t)0x0001 << pin_name);
+ if (gpmr0_15)
+ return true;
+ return false;
}
-
- /**
- * @brief Set the out pin
- * @param[in] The pin name
- * @return 0 on Success
- */
- bool setGPIO (ExpGpioPinName PinName)
- {
- if (PinName == NOT_CON) return true;
- GPSR0_15 = GPSR0_15 | ((uint16_t)0x0001<<PinName);
- write16bitReg (GPSR_0_7 , &GPSR0_15);
- return false;
- }
-
- /**
- * @brief Clear the out pin
- * @param[in] The pin name
- * @return 0 on Success
- */
- bool clrGPIO (ExpGpioPinName PinName)
- {
- if (PinName == NOT_CON) return true;
- GPSR0_15 = GPSR0_15 & (~((uint16_t)0x0001<<PinName));
- write16bitReg (GPSR_0_7 , &GPSR0_15);
- return false;
- }
-
- /**
- * @brief Read the input pin
- * @param[in] The pin name
- * @return The logical pin level
- */
- bool rdGPIO (ExpGpioPinName PinName)
- {
- uint16_t gpmr0_15;
- if (PinName == NOT_CON) return true;
- read16bitReg (GPMR_0_7, &gpmr0_15);
- gpmr0_15 = gpmr0_15 & ((uint16_t)0x0001<<PinName);
- if (gpmr0_15) return true;
- return false;
- }
-
- /**
- * @brief Set the pin direction
- * @param[in] The pin name
- * @param[in] The pin direction
- * @return 0 on success
- */
- bool setGPIOdir (ExpGpioPinName PinName, ExpGpioPinDirection PinDir)
- {
- if (PinName == NOT_CON || PinDir == NOT_CONNECTED) return true;
- GPDR0_15 = GPDR0_15 & (~((uint16_t)0x0001<<PinName)); // clear the Pin
- GPDR0_15 = GPDR0_15 | ((uint16_t)PinDir<<PinName);
- write16bitReg (GPDR_0_7 , &GPDR0_15);
- return false;
- }
+
+ /**
+ * @brief Set the pin direction
+ * @param[in] The pin name
+ * @param[in] The pin direction
+ * @return 0 on success
+ */
+// bool setGPIOdir (ExpGpioPinName PinName, ExpGpioPinDirection PinDir)
+ bool set_gpio_dir (ExpGpioPinName pin_name, ExpGpioPinDirection pin_dir)
+ {
+ if (pin_name == NOT_CON || pin_dir == NOT_CONNECTED)
+ return true;
+ gpdr0_15 = gpdr0_15 & (~((uint16_t)0x0001 << pin_name)); // clear the Pin
+ gpdr0_15 = gpdr0_15 | ((uint16_t)pin_dir << pin_name);
+ write_16bit_reg(GPDR_0_7, &gpdr0_15);
+ return false;
+ }
- /**
- * @brief Read a 16 bits register
- * @param[in] The register address
- * @param[in] The pointer to the read data
- */
- void read16bitReg (uint8_t Reg16Addr, uint16_t *Reg16Data)
+ /**
+ * @brief Read a 16 bits register
+ * @param[in] The register address
+ * @param[in] The pointer to the read data
+ */
+// void read16bitReg (uint8_t Reg16Addr, uint16_t *Reg16Data)
+ void read_16bit_reg (uint8_t reg16_addr, uint16_t *reg16_data)
{
- dev_i2c.i2c_read((uint8_t*)Reg16Data, expdevaddr, Reg16Addr, 2);
- }
+ dev_i2c.i2c_read((uint8_t*)reg16_data, exp_dev_addr, reg16_addr, 2);
+ }
- /**
- * @brief Write a 16 bits register
- * @param[in] The register address
- * @param[in] The pointer to the data to be written
- */
- void write16bitReg (uint8_t Reg16Addr, uint16_t *Reg16Data)
+ /**
+ * @brief Write a 16 bits register
+ * @param[in] The register address
+ * @param[in] The pointer to the data to be written
+ */
+// void write16bitReg (uint8_t Reg16Addr, uint16_t *Reg16Data)
+ void write_16bit_reg (uint8_t reg16_addr, uint16_t *reg16_data)
{
- dev_i2c.i2c_write((uint8_t*)Reg16Data, expdevaddr, Reg16Addr, 2);
- }
+ dev_i2c.i2c_write((uint8_t*)reg16_data, exp_dev_addr, reg16_addr, 2);
+ }
- private:
- DevI2C &dev_i2c;
- uint16_t GPDR0_15; // local copy of bit direction reg
- uint16_t GPSR0_15; // local copy of bit status reg
- uint8_t expdevaddr; // expander device i2c addr
+private:
+ DevI2C &dev_i2c;
+ uint16_t gpdr0_15; // local copy of bit direction reg
+ uint16_t gpsr0_15; // local copy of bit status reg
+ uint8_t exp_dev_addr; // expander device i2c addr
};
#endif // __STMPE1600_CLASS
--- a/Components/VL53L0X/vl53l0x_class.h Thu Jun 15 13:33:35 2017 +0000
+++ b/Components/VL53L0X/vl53l0x_class.h Tue Jun 20 15:43:26 2017 +0000
@@ -1,5 +1,5 @@
/*******************************************************************************
- Copyright © 2016, STMicroelectronics International N.V.
+ Copyright © 2016, STMicroelectronics International N.V.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -61,7 +61,7 @@
#define STATUS_FAIL 0x01
-#define VL53L0X_OsDelay(...) HAL_Delay(2)
+#define VL53L0X_OsDelay(...) wait_ms(2) // 2 msec delay. can also use wait(float secs)/wait_us(int)
#ifdef USE_EMPTY_STRING
#define VL53L0X_STRING_DEVICE_INFO_NAME ""
@@ -320,7 +320,8 @@
* @param[in] pin_gpio1 pin Mbed InterruptIn PinName to be used as component GPIO_1 INT
* @param[in] device address, 0x29 by default
*/
- VL53L0X(DevI2C &i2c, STMPE1600DigiOut &pin, PinName pin_gpio1, uint8_t DevAddr=DEFAULT_DEVICE_ADDRESS) : dev_i2c(i2c), expgpio0(&pin)
+// VL53L0X(DevI2C &i2c, STMPE1600DigiOut &pin, PinName pin_gpio1, uint8_t DevAddr=DEFAULT_DEVICE_ADDRESS) : dev_i2c(i2c), expgpio0(&pin)
+ VL53L0X(DevI2C &i2c, Stmpe1600DigiOut &pin, PinName pin_gpio1, uint8_t DevAddr=DEFAULT_DEVICE_ADDRESS) : dev_i2c(i2c), expgpio0(&pin)
{
MyDevice.I2cDevAddr=DevAddr;
MyDevice.comms_type=1; // VL53L0X_COMMS_I2C
@@ -1443,7 +1444,8 @@
/* Digital out pin */
DigitalOut *gpio0;
/* GPIO expander */
- STMPE1600DigiOut *expgpio0;
+// STMPE1600DigiOut *expgpio0;
+ Stmpe1600DigiOut *expgpio0;
/* Measure detection IRQ */
InterruptIn *gpio1Int;
/* Device data */
--- a/x_nucleo_53l0a1.h Thu Jun 15 13:33:35 2017 +0000
+++ b/x_nucleo_53l0a1.h Tue Jun 20 15:43:26 2017 +0000
@@ -64,19 +64,19 @@
*/
X_NUCLEO_53L0A1(DevI2C *ext_i2c) : dev_i2c(ext_i2c)
{
- stmpe1600_exp0 = new STMPE1600(*ext_i2c, (0x43 * 2)); // U21
+ stmpe1600_exp0 = new Stmpe1600(*ext_i2c, (0x43 * 2)); // U21
- stmpe1600_exp1 = new STMPE1600(*ext_i2c, (0x42 * 2)); // U19
+ stmpe1600_exp1 = new Stmpe1600(*ext_i2c, (0x42 * 2)); // U19
display = new Display(*stmpe1600_exp0, *stmpe1600_exp1);
- xshutdown_centre=new STMPE1600DigiOut(*dev_i2c, GPIO_15, (0x42 * 2)); // U19 on schematic
+ xshutdown_centre=new Stmpe1600DigiOut(*dev_i2c, GPIO_15, (0x42 * 2)); // U19 on schematic
sensor_centre=new VL53L0X(*dev_i2c, *xshutdown_centre, A2);
- xshutdown_left=new STMPE1600DigiOut(*dev_i2c, GPIO_14, (0x43 * 2)); // U21 on schematic
+ xshutdown_left=new Stmpe1600DigiOut(*dev_i2c, GPIO_14, (0x43 * 2)); // U21 on schematic
sensor_left=new VL53L0X(*dev_i2c, *xshutdown_left, D8);
- xshutdown_right=new STMPE1600DigiOut(*dev_i2c, GPIO_15, (0x43 * 2)); // U21 on schematic
+ xshutdown_right=new Stmpe1600DigiOut(*dev_i2c, GPIO_15, (0x43 * 2)); // U21 on schematic
sensor_right=new VL53L0X(*dev_i2c, *xshutdown_right, D2);
}
@@ -89,19 +89,19 @@
*/
X_NUCLEO_53L0A1(DevI2C *ext_i2c, PinName gpio1_centre,
PinName gpio1_left, PinName gpio1_right) : dev_i2c(ext_i2c) {
- stmpe1600_exp0 = new STMPE1600(*ext_i2c, (0x43 * 2)); // U21
+ stmpe1600_exp0 = new Stmpe1600(*ext_i2c, (0x43 * 2)); // U21
- stmpe1600_exp1 = new STMPE1600(*ext_i2c, (0x42 * 2)); // U19
+ stmpe1600_exp1 = new Stmpe1600(*ext_i2c, (0x42 * 2)); // U19
display = new Display(*stmpe1600_exp0, *stmpe1600_exp1);
- xshutdown_centre=new STMPE1600DigiOut(*dev_i2c, GPIO_15, (0x42 * 2)); // U19 on schematic
+ xshutdown_centre=new Stmpe1600DigiOut(*dev_i2c, GPIO_15, (0x42 * 2)); // U19 on schematic
sensor_centre=new VL53L0X(*dev_i2c, *xshutdown_centre, gpio1_centre);
- xshutdown_left=new STMPE1600DigiOut(*dev_i2c, GPIO_14, (0x43 * 2)); // U21 on schematic
+ xshutdown_left=new Stmpe1600DigiOut(*dev_i2c, GPIO_14, (0x43 * 2)); // U21 on schematic
sensor_left=new VL53L0X(*dev_i2c, *xshutdown_left, gpio1_left);
- xshutdown_right=new STMPE1600DigiOut(*dev_i2c, GPIO_15, (0x43 * 2)); // U21 on schematic
+ xshutdown_right=new Stmpe1600DigiOut(*dev_i2c, GPIO_15, (0x43 * 2)); // U21 on schematic
sensor_right=new VL53L0X(*dev_i2c, *xshutdown_right, gpio1_right);
}
@@ -177,11 +177,11 @@
VL53L0X *sensor_centre;
VL53L0X *sensor_left;
VL53L0X *sensor_right;
- STMPE1600 *stmpe1600_exp0;
- STMPE1600 *stmpe1600_exp1;
- STMPE1600DigiOut *xshutdown_centre;
- STMPE1600DigiOut *xshutdown_left;
- STMPE1600DigiOut *xshutdown_right;
+ Stmpe1600 *stmpe1600_exp0;
+ Stmpe1600 *stmpe1600_exp1;
+ Stmpe1600DigiOut *xshutdown_centre;
+ Stmpe1600DigiOut *xshutdown_left;
+ Stmpe1600DigiOut *xshutdown_right;
Display *display;
private:
