The I2C test validate proper implementation of the I2C hal. More...
Functions | |
void | fpga_i2c_test_get_capabilities () |
Test that i2c_get_capabilities() fills given i2c_capabilities_t instance with capabilities. More... | |
void | fpga_i2c_test_init_free (PinName sda, PinName scl) |
Test that i2c_init() successfully initializes and i2c_free() successfully frees i2c interface. More... | |
void | fpga_i2c_test_frequency (PinName sda, PinName scl) |
Test that i2c_frequency() sets the frequency used during the I2C transfer. More... | |
void | fpga_i2c_test_blocking_transmission_timeout (PinName sda, PinName scl, uint32_t frequency) |
Test blocking transmission timeout. More... | |
void | fpga_i2c_test_transmission_no_slave (PinName sda, PinName scl, uint32_t frequency) |
Test blocking transmission when no slave. More... | |
void | fpga_i2c_test_blocking_write_read (PinName sda, PinName scl, uint16_t addr, uint32_t frequency, TransferType ttype, uint32_t data_size, uint32_t transfer_count, bool stop_each) |
Test blocking transmission. More... | |
void | fpga_i2c_test_async_write_read (PinName sda, PinName scl, uint16_t addr, uint32_t frequency, TransferType ttype, uint32_t data_size, uint32_t transfer_count, bool stop_each) |
Test asynchronous transmission. More... | |
void | fpga_i2c_test_async_abort (PinName sda, PinName scl, uint32_t frequency) |
Test that call aborts ongoing asynchronous transfer. More... | |
The I2C test validate proper implementation of the I2C hal.
To run the I2C hal tests, use the command:
mbed test -t <toolchain> -m <target> -n tests-mbed_hal_fpga_ci_test_shield-i2c
void fpga_i2c_test_async_abort | ( | PinName | sda, |
PinName | scl, | ||
uint32_t | frequency | ||
) |
Test that call aborts ongoing asynchronous transfer.
Given is asynchronous transfer ongoing. When call . Then transfer is aborted, and callback doesn't triggers and stop condition is generated
void fpga_i2c_test_async_write_read | ( | PinName | sda, |
PinName | scl, | ||
uint16_t | addr, | ||
uint32_t | frequency, | ||
TransferType | ttype, | ||
uint32_t | data_size, | ||
uint32_t | transfer_count, | ||
bool | stop_each | ||
) |
Test asynchronous transmission.
Given board provides I2C-Master support. When I2C transmission is performed using different settings. Then data is successfully transfered.
void fpga_i2c_test_blocking_transmission_timeout | ( | PinName | sda, |
PinName | scl, | ||
uint32_t | frequency | ||
) |
Test blocking transmission timeout.
Given board provides I2C-Master support. When I2C transmission is performed using different settings. Then data is successfully transfered.
void fpga_i2c_test_blocking_write_read | ( | PinName | sda, |
PinName | scl, | ||
uint16_t | addr, | ||
uint32_t | frequency, | ||
TransferType | ttype, | ||
uint32_t | data_size, | ||
uint32_t | transfer_count, | ||
bool | stop_each | ||
) |
Test blocking transmission.
Given board provides I2C-Master support. When I2C transmission is performed using different settings. Then data is successfully transfered.
void fpga_i2c_test_frequency | ( | PinName | sda, |
PinName | scl | ||
) |
Test that i2c_frequency() sets the frequency used during the I2C transfer.
Given is platform with I2C support. When i2c_frequency() is called and valid frequency is specified. Then function is executed successfully and actual frequency which will be used during the transfer is returned.
void fpga_i2c_test_get_capabilities | ( | ) |
Test that i2c_get_capabilities() fills given i2c_capabilities_t instance with capabilities.
Given is platform with I2C support. When i2c_get_capabilities() is called. Then function fills the given i2c_capabilities_t instance.
void fpga_i2c_test_init_free | ( | PinName | sda, |
PinName | scl | ||
) |
Test that i2c_init() successfully initializes and i2c_free() successfully frees i2c interface.
Given is platform with I2C support. When i2c_init() is called with the valid pins configuration and then i2c_free() is called on the created I2C object. Then both operations are successfully performed.
void fpga_i2c_test_transmission_no_slave | ( | PinName | sda, |
PinName | scl, | ||
uint32_t | frequency | ||
) |
Test blocking transmission when no slave.
Given board provides I2C-Master support. When I2C transmission with address of nonexistent slave is performed using Then transfer fails returning appropriate error.