Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate clockConfigRead and clockConfigWrite, Add GPIO_TCLKA_TCLKC_SEL #1

Merged
merged 10 commits into from
Oct 31, 2024

Conversation

bahadirdonmez
Copy link
Member

No description provided.

for (uint8_t i = numberOfClocks - 1; i < numberOfClocks; i--) {
// Extract each 4-bit segment and print as a hexadecimal digit
uint8_t segment = (outputMapValue >> (4 * i)) & 0xF;
printf("%X", segment);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you just print outputMapValue as %016X ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this was a bit annoying, I tried the followings but none of them worked...

printf("Current clock output map: 0x%016X\r\n", outputMapValue);
printf("Current clock output map: 0x%016lX\r\n", outputMapValue);
printf("Current clock output map: 0x%016llX\r\n", outputMapValue);
printf("Current clock output map: 0x%016" PRIx64 "\r\n", outputMapValue);

Could it be that the micro-controller cannot print long long unsigned integer (64-bit)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would have to add printlli, similar to https://github.com/tiqi-group/openMMC/blob/feature/afck/modules/printf-stdarg.c#L127 (and adapt print accordingly)

But there is no real reason to use a custom printf implementation.
https://github.com/eyalroz/printf/ would be a better alternative.

At least write a comment why you did this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I now added some comments about this and added a TODO for using https://github.com/eyalroz/printf/

@mastadle
Copy link
Collaborator

mastadle commented Aug 7, 2024

Don't you want to include GPIO_TCLKA_TCLKC_SEL in the gpio set/read command in the cli commands?

@bahadirdonmez
Copy link
Member Author

Don't you want to include GPIO_TCLKA_TCLKC_SEL in the gpio set/read command in the cli commands?

Good point, I will add it quickly

@bahadirdonmez
Copy link
Member Author

Don't you want to include GPIO_TCLKA_TCLKC_SEL in the gpio set/read command in the cli commands?

I added and tested it quickly. It works.

@bahadirdonmez
Copy link
Member Author

I now added gpio_direction_read and gpio_direction_write CLI functions. They are necessary to dynamically set the GPIO_TCLKA_TCLKC_SEL pin as input in order to disable the low-jitter clock bypass.

@mastadle mastadle merged commit 4e6dd39 into tiqi-group:feature/afck Oct 31, 2024
0 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants