www.beck-ipc.com

@CHIP-RTOS C Library V2.06 - Hardware API


hal_get_frequencies

Get the specified system frequency.

unsigned long hal_get_frequencies (
                         HW_FREQ_SELECTOR freq_select );

SC1x Parameters

freq_select
Enumerator, which frequency to get:
    GET_FRQ_PROCESSOR = 0:   Return processor frequency
    GET_FRQ_TIMER = 1:   Return maximum TMROUT square wave frequency
    GET_FRQ_MAX_BAUD = 2:   Return maximum baud rate
    GET_FRQ_PWD = 3:   PWD timer frequency
    GET_FRQ_TIMERBASE = 3:   Return timer base frequency

SC1x3 Parameters

freq_select
Enumerator, which frequency to get:
    GET_FRQ_PROCESSOR = 0:   Return processor frequency
    GET_FRQ_TIMER = 1:   Return maximum TMROUT square wave frequency
    GET_FRQ_MAX_BAUD = 2:   Return maximum baud rate
    GET_FRQ_TIMERBASE = 3:   Return timer base frequency

Return Value

frequency [Hz].

Comments

Use the timer base frequency to compute the correct timer clock divider value, where:

    Timer frequency = timer base frequency / clock divider

Use the maximum TMROUT sqare wave frequency to compute the correct timer clock divider value for the TMROUT, where:

    TMROUT frequency = maximum TMROUT sqare wave frequency / clock divider

Use the maximum baud rate to select the correct baud rate divisor for the specific processor.   The baud_divider argument to Fossil Extended line control initialization fossil_set_extctrl function can be calculated based on the following equation.

    baud_divider = maximum baud rate / desired baud rate

See Also

RTOS API

This library function invokes a RTOS software interrupt. Refer to this RTOS API function's documentation for more details.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3
    V1.00V1.00V1.00V0.90

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document