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

Add test for GPIO #400

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Add test for GPIO #400

wants to merge 14 commits into from

Conversation

cnlohr
Copy link
Owner

@cnlohr cnlohr commented Sep 24, 2024

(To test input/output electrical properties)

ADC1->ISQR = ((0)<<0) | ((1)<<5) | ((2)<<10) | ((3)<<15) | (3<<20);

// 0:7 => 3/9/15/30/43/57/73/241 cycles
ADC1->SAMPTR2 |= (7<<(3*0)) | (7<<(3*1)) | (7<<(3*2)) | (7<<(3*3));
Copy link
Contributor

@prosper00 prosper00 Sep 24, 2024

Choose a reason for hiding this comment

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

What about using the defines for setting these bits? More verbose, but also a bit more clear and corresponds to the RM nomenclature. For an example, I think this is a bit clearer

ADC1->ISQR=(ADC_JL_0 | ADC_JL_1 | ADC_JSQ4_1 | ADC_JSQ4_0 | ADC_JSQ3_1 | ADC_JSQ2_0);

ADC1->SAMPTR2 |= 	(ADC_SMP0_0 | ADC_SMP0_1 | ADC_SMP0_2 | \
			ADC_SMP1_0 | ADC_SMP1_1 | ADC_SMP1_2 | \
			ADC_SMP2_0 | ADC_SMP2_1 | ADC_SMP2_2 | \
			ADC_SMP3_1 | ADC_SMP3_1 | ADC_SMP3_2);

@cnlohr
Copy link
Owner Author

cnlohr commented Sep 25, 2024

Thanks, I've taken that into account, and updated it.

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.

4 participants