skydarc meneldoll / Mbed 2 deprecated IQS572_HelloWorld

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

IQS5xx Class Reference

IQS5xx Class Reference

This class allows for easy control over a IQS5xx IC. More...

#include <IQS5xx.h>

Public Member Functions

 IQS5xx (PinName sda, PinName scl, PinName rdy)
uint8_t I2C_Write (uint16_t ui16RegisterAddress, uint8_t *pData, uint8_t ui8NoOfBytes)
 I2C write function.
uint8_t I2C_Read (uint16_t ui16RegisterAddress, uint8_t *pData, uint8_t ui8NoOfBytes)
 I2C read function.
void AcknowledgeReset (void)
 Acknowledge the reset flag.
void DisplaySnap (void)
 Display a snap state change.
void Process_XY (void)
 Process the data received.
void Close_Comms ()
 Terminate communication window.

Detailed Description

This class allows for easy control over a IQS5xx IC.

Definition at line 17 of file IQS5xx.h.


Constructor & Destructor Documentation

IQS5xx ( PinName  sda,
PinName  scl,
PinName  rdy 
)
Parameters:
sdathe pin identifier for SDA I2C signal
sclthe pin identifier for SCL I2C signal
i2c_addrthe 8-bit I2C address for this device. Note that LSB is a don't care.

Definition at line 12 of file IQS5xx.cpp.


Member Function Documentation

void AcknowledgeReset ( void   )

Acknowledge the reset flag.

This function simply sets the ACK_RESET bit found in the SYSTEM_CONTROL_0 register. By setting this bit the SHOW_RESET flag is cleared in the SYSTEM_INFO_0 register. During normal operation, the SHOW_RESET bit can be monitored and if it becomes set, then an unexpected reset has occurred. If any device configuration is needed, it must then be repeated.

Parameters:
None
Returns:
None

Definition at line 35 of file IQS5xx.cpp.

void Close_Comms (  )

Terminate communication window.

The IQS5xx B000 does not close the communication window on the reception of the STOP bit; therefore this function sends the END COMMUNICATION WINDOW COMMAND (Please see datasheet for more information). RDY will go low after receiving any write to 0xEEEE followed by a STOP.

Parameters:
None
Returns:
None

Definition at line 310 of file IQS5xx.cpp.

void DisplaySnap ( void   )

Display a snap state change.

If the state of any snap output has changed, then this function can be used to display which Rx/Tx channel has changed status.

Parameters:
None
Returns:
None

Definition at line 133 of file IQS5xx.cpp.

uint8_t I2C_Read ( uint16_t  ui16RegisterAddress,
uint8_t *  pData,
uint8_t  ui8NoOfBytes 
)

I2C read function.

This function reads data from the address specified and stores this data in the area provided by the pointer. If anything in the read process is not successful, then it will be repeated up till four more times. If still not successful, it will write an error message on the serial terminal.

Parameters:
ui16RegisterAddressis the 16-bit memory map address on the IQS5xx
pDatais a pointer to where the read data must be stored
ui8NoOfBytesindicates how many bytes of data to read
Returns:
Boolean indicating success/fail of read attempt

Definition at line 373 of file IQS5xx.cpp.

uint8_t I2C_Write ( uint16_t  ui16RegisterAddress,
uint8_t *  pData,
uint8_t  ui8NoOfBytes 
)

I2C write function.

This function writes the provided data to the address specified. If anything in the write process is not successful, then it will be repeated up till four more times. If still not successful, it will write an error message on the serial terminal.

Parameters:
ui16RegisterAddressis the 16-bit memory map address on the IQS5xx
pDatais a pointer to the first byte of a block of data to write
ui8NoOfBytesindicates how many bytes of data to write
Returns:
Boolean indicating success/fail of write attempt

Definition at line 333 of file IQS5xx.cpp.

void Process_XY ( void   )

Process the data received.

This function sorts the read bytes from the IQS5xx and prints relevant data on serial port. REL_X[n]: Relative X Position of the finger n; n is from (1 to 5) REL_Y[n]: Relative X Position of the finger n; n is from (1 to 5) ABS_X[n]: Absolute X Position of the finger n; n is from (1 to 5) ABS_Y[n]: Absolute Y Position of the finger n; n is from (1 to 5) ui16TouchStrength[n] : Touch strength of finger n; n is from (1 to 5) ui8Area[n] : Touch area of finger n; this is number of channels under touch for a particular finger; Where 'n' is from (1 to 5)

Parameters:
None
Returns:
None

Definition at line 180 of file IQS5xx.cpp.