eth32_set_pwm_base_period

int eth32_set_pwm_base_period(eth32 handle, int period);

Summary

This function configures the main PWM clock to have a cycle period of the given number of counts. This defines the base frequency that will be used for the PWM channels. The base frequency is not individually selectable for each channel, so this function will affect both PWM outputs. Each complete PWM waveform will have a duration of (period + 1) PWM clock cycles. The PWM clock counts at a rate of 2 MHZ. This means, for example, that specifying a period of 99 would result in a frequency of 20 KHZ (2,000,000/(99+1)). The base period is specified as a 16-bit number that may range from a value of 49 (40 KHZ) to a value of 65,535 (30.5 HZ).

Parameters

  • handle - The value returned by the eth32_open function.

  • period - Number of PWM clock counts to make up the base period of the PWM channels. This may range from 49 - 65535.

Return Value

This function returns zero on success and a negative error code on failure. Please see the Error Codes section for possible error codes.

See Also

eth32_get_pwm_base_period, eth32_set_pwm_channel, eth32_set_pwm_clock_state, eth32_set_pwm_duty_period,