Skip to content

Commit 61e8292

Browse files
tmediccixiaoxiang781216
authored andcommitted
examples/i2schar: Implement loopback mode check
This commit implements the loopback mode for the i2schar example application. This mode - available only when both RX and TX are enabled - allows the user to test the I2S buses when the TX pin is connected to the RX pin. This is done by pre-filling a buffer with known data (additionally, it checks the peripheral's data width to format the data in the buffer accordingly) and passing it for both the transmitter and the receiver threads. This buffer is written to the TX and the received buffer is compared to the known buffer. Signed-off-by: Tiago Medicci <[email protected]>
1 parent 7ac03cf commit 61e8292

File tree

4 files changed

+358
-36
lines changed

4 files changed

+358
-36
lines changed

examples/i2schar/i2schar.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
#endif
7474

7575
#ifndef CONFIG_EXAMPLES_I2SCHAR_BUFSIZE
76-
# define CONFIG_EXAMPLES_I2SCHAR_BUFSIZE 256
76+
# define CONFIG_EXAMPLES_I2SCHAR_BUFSIZE 256
7777
#endif
7878

7979
/****************************************************************************
@@ -83,6 +83,7 @@
8383
struct i2schar_state_s
8484
{
8585
bool initialized;
86+
bool loopback;
8687
FAR char *devpath;
8788
#ifdef CONFIG_EXAMPLES_I2SCHAR_TX
8889
int txcount;

0 commit comments

Comments
 (0)