25.6.4.8.2 Function tcc_set_compare_value()

Sets a TCC module compare value.

enum status_code tcc_set_compare_value( const struct tcc_module *const module_inst, const enum tcc_match_capture_channel channel_index, const uint32_t compare)

Writes a compare value to the given TCC module compare/capture channel.

If double buffering is enabled it always write to the buffer register. The value will then be updated immediately by calling tcc_force_double_buffer_update(), or be updated when the lock update bit is cleared and the UPDATE condition happen.

Table 25-43. Parameters
Data directionParameter nameDescription

[in]

module_inst

Pointer to the software module instance struct

[in]

channel_index

Index of the compare channel to write to

[in]

compare

New compare value to set

Returns

Status of the compare update procedure.

Table 25-44. Return Values
Return valueDescription

STATUS_OK

The compare value was updated successfully

STATUS_ERR_INVALID_ARG

An invalid channel index was supplied or compare value exceed resolution