Library to read and write Azoteq IQS6xx device registers via I2C.

Dependents:   IQS620_HelloWorld IQS622_HelloWorld IQS624_HelloWorld IQS621_HelloWorld ... more

Library: IQS62x

Library to read and write Azoteq IQS6xx device registers via I2C.

Supported Devices

Components / IQS620A
Ultra low power sensor for magnetic field, capacitive touch and inductive proximity. Empowers next-generation user interfaces.

Components / IQS621
Azoteq IQS621 ultra low power sensor for ambient light, magnetic field, capacitance and inductive proximity. Empowers next-generation user interfaces.

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.

Components / IQS624
Ultra low power sensor for rotating magnetic field, capacitive touch, and inductive proximity. Empowers next-generation user interfaces.

Handy Table of ProxFusion Device Features


ALS = Ambient Light Sensor PIR = Passive Infrared

/media/uploads/AzqDev/mbed-azoteq-proxfusion-handy-table-of-product-features.jpg

Committer:
AzqDev
Date:
Sat Feb 04 07:19:09 2017 +0000
Revision:
0:ce75ae1e8fc7
Child:
1:2f08ab339e17
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AzqDev 0:ce75ae1e8fc7 1 // A class library for Azoteq IQS62x devices
AzqDev 0:ce75ae1e8fc7 2 #include "mbed.h"
AzqDev 0:ce75ae1e8fc7 3
AzqDev 0:ce75ae1e8fc7 4 // Verify these 3 pin definitions if your hardware is not on the list of tested boards
AzqDev 0:ce75ae1e8fc7 5 // If your board has an Arduino interface the definitions below will likely work
AzqDev 0:ce75ae1e8fc7 6
AzqDev 0:ce75ae1e8fc7 7 #define IQS_I2C_CLOCK_PIN I2C_SCL /* on NUCLEO boards this is marked as SCL/D15 on CN5 */
AzqDev 0:ce75ae1e8fc7 8 #define IQS_I2C_DATA_PIN I2C_SDA /* on NUCLEO boards this is marked as SDA/D14 on CN5 */
AzqDev 0:ce75ae1e8fc7 9 #define IQS_READY_PIN D2 /* on NUCLEO boards this is marked as D2 on CN9 */
AzqDev 0:ce75ae1e8fc7 10
AzqDev 0:ce75ae1e8fc7 11 #define I2C_ADR (0x44 << 1) /* I2C address of IQS62x */
AzqDev 0:ce75ae1e8fc7 12 #define I2CSPEED 100000 /* I2C clock speed */
AzqDev 0:ce75ae1e8fc7 13 #define NUMBER_OF_REGISTERS 224 /* number of registers to read from IQS62x */
AzqDev 0:ce75ae1e8fc7 14 #define I2CBufferSize 256 /* size of I2C read buffer */
AzqDev 0:ce75ae1e8fc7 15
AzqDev 0:ce75ae1e8fc7 16 class IQS62xIO { // basic IQS62x block read and write
AzqDev 0:ce75ae1e8fc7 17 public:
AzqDev 0:ce75ae1e8fc7 18 I2C i2c; // I2C interface
AzqDev 0:ce75ae1e8fc7 19 DigitalIn IQSready; // ready pin
AzqDev 0:ce75ae1e8fc7 20 const static int I2Cspeed = I2CSPEED; // I2C clock rate
AzqDev 0:ce75ae1e8fc7 21 int I2CErrorCount; // number of I2C errors
AzqDev 0:ce75ae1e8fc7 22 char I2CBuffer [I2CBufferSize]; // I2C read buffer
AzqDev 0:ce75ae1e8fc7 23 char * registers; // pointer to I2C read buffer
AzqDev 0:ce75ae1e8fc7 24 IQS62xIO(); // constructor
AzqDev 0:ce75ae1e8fc7 25
AzqDev 0:ce75ae1e8fc7 26 void configure(); // write configuration registers of the IQS62x
AzqDev 0:ce75ae1e8fc7 27 void readAll(); // read all registers from the IQS62x
AzqDev 0:ce75ae1e8fc7 28 void waitForReady(); // wait for IQS62x ready signal
AzqDev 0:ce75ae1e8fc7 29 };