24.6.4.10.1 Function tc_set_top_value()
Set the timer TOP/period value.
enum status_code tc_set_top_value( const struct tc_module *const module_inst, const uint32_t top_value)
For 8-bit counter size this function writes the top value to the period register.
For 16- and 32-bit counter size this function writes the top value to Capture Compare register 0. The value in this register can not be used for any other purpose.
Data direction | Parameter name | Description |
---|---|---|
[in] |
module_inst |
Pointer to the software module instance struct |
[in] |
top_value |
New timer TOP value to set |
Returns
Status of the TOP set procedure.
Return value | Description |
---|---|
STATUS_OK |
The timer TOP value was updated successfully |
STATUS_ERR_INVALID_ARG |
The configured TC module counter size in the module instance is invalid |