-
Notifications
You must be signed in to change notification settings - Fork 8.4k
drivers: counter: microchip: Add counter using TCC timer #100745
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
base: main
Are you sure you want to change the base?
drivers: counter: microchip: Add counter using TCC timer #100745
Conversation
Adds the binding yaml for tcc peripheral Signed-off-by: Muhammed Asif <[email protected]>
dfa126f to
d4232d4
Compare
- Adds support for g1 counter driver with tcc peripheral Signed-off-by: Muhammed Asif <[email protected]>
- Updates the supported section of the board yaml file Signed-off-by: Muhammed Asif <[email protected]>
d4232d4 to
dd0a274
Compare
Added sam_e54_xpro.overlay files for tcc. Added sam_e54_xpro platform allow in testcase.yaml. Signed-off-by: Farsin NASAR V A <[email protected]>
dd0a274 to
145b3f2
Compare
|
|
|
||
| struct tcc_counter_irq_map { | ||
| const uint32_t ovf_irq_line; /* Overflow interrupt number */ | ||
| const uint32_t comp_irq_line[6u]; /* Channel interrupt number */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6u ? Magic number
|
|
||
| p_regs->TCC_PER = max_counter_value; | ||
|
|
||
| for (uint8_t index = 0u; index < max_channels; index++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we capture a error related to the max_channels ? I mean what is the maximum channels available.
Is this defined by the
| channels: |
If yes, I think there is a way to define max value to the property then at compile time we pick greater then values.
|
|
||
| data->channel_data[channel].callback = NULL; | ||
| cc_value = data->channel_data[channel].compare_value; | ||
| if (cb != NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an empty line before the if ()
| platform_exclude: nucleo_f302r8 | ||
| platform_exclude: | ||
| - nucleo_f302r8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, try to make the changes
- platform_exclude: nucleo_f302r8
+ platform_exclude:
+ - nucleo_f302r8In a separete commit. This helps if we need to rollback code. I know this example is very small but the principle can be used for simple things or more elaborated ones.



Adds g1 driver for counter using tcc peripheral