What is a TcCount16?

I was recently looking at some code and came across TcCount16. I know it is related to timers, but I couldn't find anything on the internet explaining what it is and how to use it.

What is TcCount16?

Thank you.

Maybe you could share the code you found ...

I think it refers the 16-bit timer/counter, not sure though, please post the code

Thanks, Akash

The code comes from the IR library. Specifically the sam.cpp file.

typedef struct { /* 16-bit Counter Mode */
	  __IO TC_CTRLA_Type             CTRLA;       /**< \brief Offset: 0x00 (R/W 16) Control A */
	  __IO TC_READREQ_Type           READREQ;     /**< \brief Offset: 0x02 (R/W 16) Read Request */
	  __IO TC_CTRLBCLR_Type          CTRLBCLR;    /**< \brief Offset: 0x04 (R/W  8) Control B Clear */
	  __IO TC_CTRLBSET_Type          CTRLBSET;    /**< \brief Offset: 0x05 (R/W  8) Control B Set */
	  __IO TC_CTRLC_Type             CTRLC;       /**< \brief Offset: 0x06 (R/W  8) Control C */
	       RoReg8                    Reserved1[0x1];
	  __IO TC_DBGCTRL_Type           DBGCTRL;     /**< \brief Offset: 0x08 (R/W  8) Debug Control */
	       RoReg8                    Reserved2[0x1];
	  __IO TC_EVCTRL_Type            EVCTRL;      /**< \brief Offset: 0x0A (R/W 16) Event Control */
	  __IO TC_INTENCLR_Type          INTENCLR;    /**< \brief Offset: 0x0C (R/W  8) Interrupt Enable Clear */
	  __IO TC_INTENSET_Type          INTENSET;    /**< \brief Offset: 0x0D (R/W  8) Interrupt Enable Set */
	  __IO TC_INTFLAG_Type           INTFLAG;     /**< \brief Offset: 0x0E (R/W  8) Interrupt Flag Status and Clear */
	  __I  TC_STATUS_Type            STATUS;      /**< \brief Offset: 0x0F (R/   8) Status */
	  __IO TC_COUNT16_COUNT_Type     COUNT;       /**< \brief Offset: 0x10 (R/W 16) COUNT16 Counter Value */
	       RoReg8                    Reserved3[0x6];
	  __IO TC_COUNT16_CC_Type        CC[2];       /**< \brief Offset: 0x18 (R/W 16) COUNT16 Compare/Capture */
	} TcCount16;

From tc.h

The SAM can do 8/16/32 bit timers

TC_COUNT16 refers to the registers specific for 16-bit timing mode

It's a struct containing references to the registers that control one of the 16-bit timer/counter modules on the SAM chips. Suspect the headers specific to the chip define one at a specific address in the part of memory where the registers are for each 16-bit timer counter peripheral on the part.

That snippet from tc.h is where it's defined; I don't use the SAM chips so I couldn't tell you where that is; I would guess that it's one of the files included with the compiler toolchain packages, making it analogous to the io*.h files for AVR