Register Display On Serial Terminal For Azoteq IQS622 Ultra Low Power (5uA) I2C Multi-Function Sensor with Light Sensor + Active (Reflective) IR + Touch + Hall Effect Sensor

Dependents:   IQS622_HelloWorld

A library that performs a register dump of the Azoteq IQS622 ultra low power multisensor registers.

More information on the IQS622 here:

Components / IQS622
Azoteq IQS622 ultra low power sensor for ambient light, active (reflective) IR, magnetic field, capacitance and inductive proximity. Empowers next-generation user interfaces.


Low Cost Evaluation Board for Azoteq IQS622 Ultra Low Power (5uA) I2C Multi-Function Sensor with Light Sensor, Active (Reflective) IR, Touch and Hall Effect Sensor


IQS622DisplayTerminal.h

Committer:
AzqDev
Date:
2017-05-14
Revision:
5:d095cb71bef0
Parent:
4:a9a7666d8a98

File content as of revision 5:d095cb71bef0:

// A class library to display Azoteq IQS622 registers on a terminal

// More info on IQS622 sensor IC: http://bit.ly/IQS622-info

// IQS622 1-minute youtube video: N.A.

#include "mbed.h"

#define DISPLAY_BAUD_RATE 115200 /* baud rate of serial terminal */


#if defined(TARGET_TEENSY3_1) || defined (TARGET_TEENSY3_2) || IQS_USE_USBSERIAL
#warning if USBSerial.h can't be found import this library: developer.mbed.org/users/mbed_official/code/USBDevice
// USBSerial.h comes from the library http://developer.mbed.org/users/mbed_official/code/USBDevice which MUST be imported for Teensy
#include "USBSerial.h"
// USBSerial.h comes from the library http://developer.mbed.org/users/mbed_official/code/USBDevice which MUST be imported for Teensy
#endif

#if defined(TARGET_TEENSY3_1) || defined (TARGET_TEENSY3_2) || IQS_USE_USBSERIAL
class IQS622Display : public USBSerial { // use our own USB serial port (requires USB driver to be installed, see Teensy Website)
    public: void baud(int baudRate);
#else
class IQS622Display : public Serial { // use ARM mbed virtual serial port
#endif

  public:
    int frameCounter;
    IQS622Display(); // constructor
    void helloMessage(bool); // show startup message
    void showStatus(int,int); // show headings and I2C Error Count
    void showLine(char *,char *,int,int); // dump a single line of register values with color highlighting
    void showRegisters(char *,char *,bool); // show IQS62x registers
};