We are trying to use the i2c code from the USB audio projects. In file i2c-sp.xc is:
#ifdef __XS2A__
What does this definition mean and where would it be defined? Do we want to use it for an XU216? I searched everywhere for the string and could not find it.
__XS2A__?
-
- XCore Addict
- Posts: 158
- Joined: Thu Mar 20, 2014 8:04 am
Hi,
If your target platform is using XS2 devices, then this macro check becomes true (expanded in xml file I believe!? during build time).
In specific i2c_master_single_port.xc file, this check "__XS2A__" facilitates the following:
Regards,
/srinie
If your target platform is using XS2 devices, then this macro check becomes true (expanded in xml file I believe!? during build time).
In specific i2c_master_single_port.xc file, this check "__XS2A__" facilitates the following:
- Since XS2 devices support dual fetch and execute, I presume its possible to sample the Clock line at the same bit period, where as with XS1 devices, this might not be possible
- Hence XS2 device implements more feature in I2C lib (clock stretching) in comparison with previous version devices
Regards,
/srinie
-
- XCore Addict
- Posts: 169
- Joined: Fri Oct 23, 2015 10:23 am
Hi Fas,
This is one of several pre-defined macros created by the tools (XC & C compilers and assembler preprocessor).
Try:
xcc1llvm -dM -E test.xc
xcc2clang -dM -E test.c
This is one of several pre-defined macros created by the tools (XC & C compilers and assembler preprocessor).
Try:
xcc1llvm -dM -E test.xc
xcc2clang -dM -E test.c
-
- XCore Addict
- Posts: 169
- Joined: Fri Oct 23, 2015 10:23 am
I should have added, the tools decide what predefines to define based on the XN file or the target or architecture (etc) you pass into them directly (as above) or indirectly (via xcc front end) viz:
xcc -march=xs2a -dM -E test.c
xcc -march=xs2a -dM -E test.c
-
Verified
- Respected Member
- Posts: 347
- Joined: Wed Jan 27, 2016 5:21 pm
For background - xCORE200 devices implement the XS2 architecture; similar to XS1 but with dual issue and a few extra instructions. The compiler needs to know; and some libraries depend on the extended instructions.
-
- Active Member
- Posts: 39
- Joined: Sat May 09, 2020 4:20 pm
Is "XS2A" equivalent with "XS2"?
-
Verified
- XCore Legend
- Posts: 1077
- Joined: Thu Dec 10, 2009 9:20 pm
- Location: Bristol, UK
Yes, essentially, there never was an XS2B and the latest architecture is XS3A, so never likely to be one.
(fun fact, there was an XS1A and XS1B)
(fun fact, there was an XS1A and XS1B)
Technical Director @ XMOS. Opinions expressed are my own