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.
Dependents: IQS620_HelloWorld IQS622_HelloWorld IQS624_HelloWorld IQS621_HelloWorld ... more
IQS62x.h
- Committer:
- AzqDev
- Date:
- 2017-05-12
- Revision:
- 9:7c2666dfbc9a
- Parent:
- 7:5e7ea07265d9
- Child:
- 10:8fdac52881aa
File content as of revision 9:7c2666dfbc9a:
// A class library for Azoteq IQS62x devices
// More info on IQS624 sensor IC: http://www.azoteq.com/products/proxfusion/iqs624?mbed
// IQS624 1-minute youtube video: http://bit.ly/IQS624Video
#include "mbed.h"
// Verify these 3 pin definitions if your hardware is not on the list of tested boards
#if defined (TARGET_LPC1768) || defined (TARGET_LPC11U24)
#define IQS_I2C_CLOCK_PIN p27 /* on LPC1768/LPC11U24 this is marked as p10 */
#define IQS_I2C_DATA_PIN p28 /* on LPC1768/LPC11U24 this is marked as p9 */
#define IQS_READY_PIN p26 /* on LPC1768/LPC11U24 this is marked as p8 */
#else
// If your board has an Arduino interface the definitions below will likely work, also works for Teensy
#define IQS_I2C_CLOCK_PIN I2C_SCL /* on NUCLEO boards this is marked as SCL/D15 on CN5 */
#define IQS_I2C_DATA_PIN I2C_SDA /* on NUCLEO boards this is marked as SDA/D14 on CN5 */
#define IQS_READY_PIN D2 /* on NUCLEO boards this is marked as D2 on CN9 */
#endif
#define I2C_ADR (0x44 << 1) /* I2C address of IQS62x */
#define I2CSPEED 100000 /* I2C clock speed */
#define NUMBER_OF_REGISTERS 224 /* number of registers to read from IQS62x */
#define I2CBufferSize 256 /* size of I2C read buffer */
class IQS62xIO { // basic IQS62x block read and write
public:
I2C i2c; // I2C interface
DigitalIn IQSready; // ready pin
const static int I2Cspeed = I2CSPEED; // I2C clock rate
int I2CErrorCount; // number of I2C errors
char I2CBuffer [I2CBufferSize]; // I2C read buffer
char * registers; // pointer to I2C read buffer
IQS62xIO(); // constructor
void writeRegister(int address, int data); // write a byte to a register
void configure(); // write configuration registers of the IQS62x
void readAll(); // read all registers from the IQS62x
void waitForReady(); // wait for IQS62x ready signal
};
IQS624
IQS620A
IQS620A-EVAL-1
IQS621
IQS621-EVAL-1
IQS622
IQS622-EVAL-1
IQS624-EVAL-1