@@ -412,6 +412,7 @@ bool QwiicKX13xCore::getRawAccelData(rawOutputData *rawAccelData){
412412}
413413
414414
415+ // Reads a single register using the selected bus.
415416KX13X_STATUS_t QwiicKX13xCore::readRegister (uint8_t *dataPointer, uint8_t reg)
416417{
417418
@@ -485,6 +486,8 @@ KX13X_STATUS_t QwiicKX13xCore::readMultipleRegisters(uint8_t reg, uint8_t dataBu
485486 }
486487}
487488
489+ // This function is used when more than 32 bytes (TwoWire maximum buffer
490+ // length) of data are requested.
488491KX13X_STATUS_t QwiicKX13xCore::overBufLenI2CRead (uint8_t reg, uint8_t dataBuffer[], int16_t numBytes)
489492{
490493 uint8_t resizedRead;
@@ -519,6 +522,8 @@ KX13X_STATUS_t QwiicKX13xCore::overBufLenI2CRead(uint8_t reg, uint8_t dataBuffer
519522 return KX13X_SUCCESS;
520523}
521524
525+ // Writes the given value to the given register, using the provided mask and
526+ // bit position.
522527KX13X_STATUS_t QwiicKX13xCore::writeRegister (uint8_t reg, uint8_t mask, uint8_t data, uint8_t bitPos)
523528{
524529
@@ -563,8 +568,11 @@ KX13X_STATUS_t QwiicKX13xCore::writeRegister(uint8_t reg, uint8_t mask, uint8_t
563568// ******************************************************************************************
564569// ******************************************************************************************
565570
571+ // Constructor
566572QwiicKX132::QwiicKX132 () { }
567573
574+ // Uses the beginCore function to check that the part ID from the "who am I"
575+ // register matches the correct value. Uses I2C for data transfer.
568576bool QwiicKX132::begin (uint8_t kxAddress, TwoWire &i2cPort){
569577
570578 if ( kxAddress != KX13X_DEFAULT_ADDRESS && kxAddress != KX13X_ALT_ADDRESS )
@@ -578,6 +586,8 @@ bool QwiicKX132::begin(uint8_t kxAddress, TwoWire &i2cPort){
578586
579587}
580588
589+ // Uses the beginCore function to check that the part ID from the "who am I"
590+ // register matches the correct value. Uses SPI for data transfer.
581591bool QwiicKX132::beginSPI (uint8_t csPin, uint32_t spiPortSpeed, SPIClass &spiPort){
582592
583593 uint8_t partID = beginSPICore (csPin, spiPortSpeed, spiPort);
@@ -587,8 +597,9 @@ bool QwiicKX132::beginSPI(uint8_t csPin, uint32_t spiPortSpeed, SPIClass &spiPor
587597 return false ;
588598}
589599
600+ // Grabs raw accel data and passes it to the following function to be
601+ // converted.
590602outputData QwiicKX132::getAccelData (){
591-
592603
593604 uint8_t tempRegVal;
594605 KX13X_STATUS_t returnError;
@@ -603,6 +614,7 @@ outputData QwiicKX132::getAccelData(){
603614 }
604615}
605616
617+ // Converts acceleration data according to the set range value.
606618bool QwiicKX132::convAccelData (outputData *userAccel, rawOutputData *rawAccelData){
607619
608620 uint8_t regVal;
@@ -646,8 +658,11 @@ bool QwiicKX132::convAccelData(outputData *userAccel, rawOutputData *rawAccelDat
646658// ******************************************************************************************
647659// ******************************************************************************************
648660
661+ // Constructor
649662QwiicKX134::QwiicKX134 () { }
650663
664+ // Uses the beginCore function to check that the part ID from the "who am I"
665+ // register matches the correct value. Uses I2C for data transfer.
651666bool QwiicKX134::begin (uint8_t kxAddress, TwoWire &i2cPort){
652667
653668 if ( kxAddress != KX13X_DEFAULT_ADDRESS && kxAddress != KX13X_ALT_ADDRESS )
@@ -661,6 +676,8 @@ bool QwiicKX134::begin(uint8_t kxAddress, TwoWire &i2cPort){
661676}
662677
663678
679+ // Uses the beginCore function to check that the part ID from the "who am I"
680+ // register matches the correct value. Uses SPI for data transfer.
664681bool QwiicKX134::beginSPI (uint8_t csPin, uint32_t spiPortSpeed, SPIClass &spiPort){
665682
666683 uint8_t partID = beginSPICore (csPin, spiPortSpeed, spiPort);
@@ -670,6 +687,8 @@ bool QwiicKX134::beginSPI(uint8_t csPin, uint32_t spiPortSpeed, SPIClass &spiPor
670687 return false ;
671688}
672689
690+ // Grabs raw accel data and passes it to the following function to be
691+ // converted.
673692outputData QwiicKX134::getAccelData (){
674693
675694 uint8_t tempRegVal;
@@ -686,6 +705,7 @@ outputData QwiicKX134::getAccelData(){
686705
687706}
688707
708+ // Converts acceleration data according to the set range value.
689709bool QwiicKX134::convAccelData (outputData *userAccel, rawOutputData *rawAccelData){
690710
691711 uint8_t regVal;
0 commit comments