added i2c wiretapping
This commit is contained in:
parent
fca48257b7
commit
b3151a0ba0
@ -4,6 +4,10 @@
|
|||||||
#include "fsfw_hal/linux/UnixFileGuard.h"
|
#include "fsfw_hal/linux/UnixFileGuard.h"
|
||||||
#include "fsfw_hal/linux/utility.h"
|
#include "fsfw_hal/linux/utility.h"
|
||||||
|
|
||||||
|
#if FSFW_HAL_I2C_WIRETAPPING == 1
|
||||||
|
#include "fsfw/globalfunctions/arrayprinter.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <linux/i2c-dev.h>
|
#include <linux/i2c-dev.h>
|
||||||
@ -112,6 +116,11 @@ ReturnValue_t I2cComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s
|
|||||||
#endif
|
#endif
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if FSFW_HAL_I2C_WIRETAPPING == 1
|
||||||
|
sif::info << "Sent I2C data to bus " << deviceFile << ":" << std::endl;
|
||||||
|
arrayprinter::print(sendData, sendLen);
|
||||||
|
#endif
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,6 +185,11 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe
|
|||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if FSFW_HAL_I2C_WIRETAPPING == 1
|
||||||
|
sif::info << "I2C read bytes from bus " << deviceFile << ":" << std::endl;
|
||||||
|
arrayprinter::print(replyBuffer, requestLen);
|
||||||
|
#endif
|
||||||
|
|
||||||
i2cDeviceMapIter->second.replyLen = requestLen;
|
i2cDeviceMapIter->second.replyLen = requestLen;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,11 @@
|
|||||||
#define FSFW_HAL_SPI_WIRETAPPING 0
|
#define FSFW_HAL_SPI_WIRETAPPING 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Can be used for low-level debugging of the I2C bus
|
||||||
|
#ifndef FSFW_HAL_I2C_WIRETAPPING
|
||||||
|
#define FSFW_HAL_I2C_WIRETAPPING 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef FSFW_HAL_L3GD20_GYRO_DEBUG
|
#ifndef FSFW_HAL_L3GD20_GYRO_DEBUG
|
||||||
#define FSFW_HAL_L3GD20_GYRO_DEBUG 0
|
#define FSFW_HAL_L3GD20_GYRO_DEBUG 0
|
||||||
#endif /* FSFW_HAL_L3GD20_GYRO_DEBUG */
|
#endif /* FSFW_HAL_L3GD20_GYRO_DEBUG */
|
||||||
|
Loading…
Reference in New Issue
Block a user