Clock Blocks API's Documentation Topic is solved

New to XMOS and XCore? Get started here.
Jcvc
Member
Posts: 10
Joined: Wed May 07, 2025 11:13 pm

Clock Blocks API's Documentation

Post by Jcvc »

Hi,

I'm still new with XMOS and I've been reading through and modifying some of the code of some of the examples as well as usb audio reference guide. As I'm now trying to play around a bit with the PIOs, I'm struggling to find documentation on some of the API's (or existing code) that are available to control the Clock Blocks (so that I can, for example, just generate a clock on a PIO through it) or to similarly use PIO's as normal GPIO's.

Regarding the clock blocks, I can see on the code that there are some API's calling configure_out_port, configure_clock_rate and some others, but I have not managed to find the documentation where I can read the code or even what their inputs are meant to be...

Would it be possible to provide some guidance on where I could learn about the topic? I've found document https://www.xmos.com/download/XS1-Library(X6020A).pdf/ but it seems to be fairly out of date (>10 years old) and can't have the examples code in there running properly.

Also, since xC is being deprecated (even though at the moment widely used), is the https://www.xmos.com/documentation/XM-0 ... index.html the only source of documentation for the C implementation on XMOS?

Thank you and apologies for the basic questions...
View Solution
User avatar
xhuw
Verified
Active Member
Posts: 54
Joined: Wed May 22, 2024 2:36 pm

Post by xhuw »

Hey you should be able to find APIs for controlling the clock blocks in <xcore/clock.h> https://www.xmos.com/documentation/XM-0 ... re-clock-h

A couple of other useful links from the same docs:

https://www.xmos.com/documentation/XM-0 ... index.html#

https://www.xmos.com/documentation/XM-0 ... cheat.html
XMOS Software Engineer

Image
Jcvc
Member
Posts: 10
Joined: Wed May 07, 2025 11:13 pm

Post by Jcvc »

Thank you, that helps :)
Is there any documentation on synchronisation of ports? (via external source/clock or internal) Or is that explained within the https://www.xmos.com/documentation/XM-0 ... re-clock-h documentation?
User avatar
xhuw
Verified
Active Member
Posts: 54
Joined: Wed May 22, 2024 2:36 pm

Post by xhuw »

You might find these functions interesting which you can find on the site with the lib_xcore docs:

clock_set_source_port() from xcore/clock.h

port_set_clock() from xcore/port.h

lib_xcore has APIs for almost everything the chip can do for info on ports, clocks etc. the architecture guide is useful https://www.xmos.com/documentation/XM-0 ... and-output
but you probably have to do a little bit of searching through the docs to figure out which API to call to configure a specific thing
XMOS Software Engineer

Image
Jcvc
Member
Posts: 10
Joined: Wed May 07, 2025 11:13 pm

Post by Jcvc »

Thank you! Yup, been doing quite a bit of reading, but as was struggling with specific bits of the documentation, had to ask, sorry!