SPI-Brigde (capseld), for polling interrupt, it is neccessary to adapt the constructor and the function getInt()
Diff: SC18IS602.h
- Revision:
- 3:9cf83f16c17d
- Parent:
- 2:cb90c271c412
--- a/SC18IS602.h Mon Feb 18 16:03:44 2019 +0000 +++ b/SC18IS602.h Thu Apr 23 22:55:50 2020 +0000 @@ -21,10 +21,10 @@ static const int USER_ADR_MASK = 0x07; struct{ - static const int CS0 = 0x01; - static const int CS1 = 0x02; - static const int CS2 = 0x04; - static const int CS3 = 0x08; + static const uint8_t CS0 = 0x01; + static const uint8_t CS1 = 0x02; + static const uint8_t CS2 = 0x04; + static const uint8_t CS3 = 0x08; }CMD_RW; static const int ADR_SPI_CONF = 0xF0; @@ -63,7 +63,7 @@ - // Bist position of Register GPIO Enable + // Bit position of Register GPIO Enable struct{ static const int CS0 = 0; static const int CS1 = 1; @@ -92,7 +92,7 @@ // public SC18IS602(I2C *_i2c, uint8_t uiAdr); SC18IS602(I2C *_i2c, PCA9555 *_pca , uint8_t uiAdr); // - SC18IS602(I2C *_i2c, DigitalIn *_IntPin, uint8_t uiAdr); // + SC18IS602(I2C *_i2c, DigitalIn *_IntPin, uint8_t uiAdr); // bool configSPI(uint8_t uiConf); @@ -103,8 +103,8 @@ bool gpio_pin3_off(); bool gpio_toggle(uint8_t uiPort); - bool sendViaSPI(char cAdrByte, char *cDataBytes, uint8_t uiNum); - bool readViaSPI(char cAdrByte, char *cDataBytes, uint8_t uiNum); + bool sendViaSPI(uint8_t uiCS, char cAdrByte, char *cDataBytes, uint8_t uiNum); + bool readViaSPI(uint8_t uiCS, char cAdrByte, char *cDataBytes, uint8_t uiNum); //void setIntFuncPtr( bool (*Int_ptr)(void));