Mistake on this page?
Report an issue in GitHub or email us
Functions
I2C hal tests

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...
 

Detailed Description

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

Function Documentation

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.

Note
Frequency must be in range specified by the capabilities of the I2C peripheral.
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.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.