Schoolproject, Emulates a QT1070 from a touchberry

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers I2C_QT1070.h Source File

I2C_QT1070.h

00001 #pragma once
00002 #include "mbed.h"
00003 #include "QT1070.h"
00004 
00005 namespace QT1070touchemulator
00006 {
00007 
00008     enum Qt1070Register {
00009         CHIP_ID = 0,
00010         FIRMWARE = 1,
00011         KEY_STATUS = 3,
00012         RESET = 57
00013     };
00014 
00015     class I2cQT1070 : public I2CSlave
00016     {
00017     public:
00018         I2cQT1070(PinName sda, PinName scl, int address=0xDE, int frequentie = 100);
00019         void check_for_instruction(void);
00020         void save_register_adress(void);
00021     
00022     private:
00023         QT1070 Qt1070Chip;
00024         int registerAdress;
00025         int read_data(void);
00026         void send_data_to_master(void);
00027         void process_instruction(void);
00028     };
00029 };