25.6.4.13.8 Function tcc_set_double_buffer_top_values()

Set the timer TOP/PERIOD value and buffer value.

enum status_code tcc_set_double_buffer_top_values( const struct tcc_module *const module_inst, const uint32_t top_value, const uint32_t top_buffer_value)

This function writes the given value to the PER and PERB register. Usually as preparation for double buffer or circulared double buffer (circular buffer).

When using MFRQ, the top values are defined by the CC0 and CCB0, the PER and PERB values are ignored, so tcc_set_double_buffer_compare_values (module,channel_0,value,buffer) must be used instead of this function to change the actual top values in that case. For all other waveforms operation the top values are defined by PER and PERB registers values.

Table 25-62. Parameters
Data directionParameter nameDescription

[in]

module_inst

Pointer to the software module instance struct

[in]

top_value

New value to be loaded into the PER register

[in]

top_buffer_value

New value to be loaded into the PERB register

Returns

Status of the TOP set procedure.

Table 25-63. Return Values
Return valueDescription

STATUS_OK

The timer TOP value was updated successfully

STATUS_ERR_INVALID_ARG

An invalid channel index was supplied or top/period value exceed resolution