Skip to content

Conversation

@mchp-asif
Copy link
Contributor

Adds g1 driver for counter using tcc peripheral

Adds the binding yaml for tcc peripheral

Signed-off-by: Muhammed Asif <[email protected]>
@mchp-asif mchp-asif force-pushed the g1_counter_tcc_upstream branch 3 times, most recently from dfa126f to d4232d4 Compare December 9, 2025 14:12
- 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]>
@mchp-asif mchp-asif force-pushed the g1_counter_tcc_upstream branch from d4232d4 to dd0a274 Compare December 9, 2025 14:46
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]>
@mchp-asif mchp-asif force-pushed the g1_counter_tcc_upstream branch from dd0a274 to 145b3f2 Compare December 9, 2025 15:10
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 9, 2025

@mchp-asif mchp-asif marked this pull request as ready for review December 10, 2025 05:09
@zephyrbot zephyrbot added area: Devicetree Bindings area: Counter platform: Microchip MEC Microchip MEC Platform platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) area: Boards/SoCs area: Tests Issues related to a particular existing or missing test labels Dec 10, 2025
@nandojve nandojve changed the title drivers: microchip: sam_e54_xpro: counter using tcc drivers: counter: microchip: Add counter using TCC timer Dec 11, 2025

struct tcc_counter_irq_map {
const uint32_t ovf_irq_line; /* Overflow interrupt number */
const uint32_t comp_irq_line[6u]; /* Channel interrupt number */
Copy link
Member

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++) {
Copy link
Member

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

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) {
Copy link
Member

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 ()

Comment on lines -8 to +9
platform_exclude: nucleo_f302r8
platform_exclude:
- nucleo_f302r8
Copy link
Member

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_f302r8

In 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Boards/SoCs area: Counter area: Devicetree Bindings area: Tests Issues related to a particular existing or missing test platform: Microchip MEC Microchip MEC Platform platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants