Skip to content

Commit 4ae270b

Browse files
I2CTester: add address mismatch statistics
1 parent fb58931 commit 4ae270b

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

components/testing/COMPONENT_FPGA_CI_TEST_SHIELD/I2CTester.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ uint8_t I2CTester::num_dev_addr_matches()
8484
return num_correct;
8585
}
8686

87+
uint8_t I2CTester::num_dev_addr_mismatches()
88+
{
89+
uint8_t num_incorrect = 0;
90+
read(TESTER_I2C_NUMBER_DEV_ADDR_MISMATCHES, &num_incorrect, sizeof(num_incorrect));
91+
return num_incorrect;
92+
}
93+
8794
void I2CTester::set_device_address(uint16_t addr)
8895
{
8996
uint16_t data = addr;

components/testing/COMPONENT_FPGA_CI_TEST_SHIELD/I2CTester.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ class I2CTester: public MbedTester {
9696
*/
9797
uint8_t num_dev_addr_matches();
9898

99+
/**
100+
* Get the number of times the device address has been sent incorrectly
101+
*
102+
* @return The number of times the device address has been sent incorrectly
103+
*/
104+
uint8_t num_dev_addr_mismatches();
105+
99106
/**
100107
* Set the I2C slave device address
101108
*

components/testing/COMPONENT_FPGA_CI_TEST_SHIELD/fpga_config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,4 @@
194194
#define TESTER_I2C_NUM_READS (0x018 + 0x00105000)
195195
#define TESTER_I2C_FROM_SLAVE_CHECKSUM (0x01A + 0x00105000)
196196
#define TESTER_I2C_FROM_SLAVE_CHECKSUM_SIZE 4
197+
#define TESTER_I2C_NUMBER_DEV_ADDR_MISMATCHES (0x01E + 0x00105000)

0 commit comments

Comments
 (0)