www.beck-ipc.com

@CHIP-RTOS C Library V2.06 - I2C Bus API


I2C_set_speed

Select I2C frequency

void I2C_set_speed ( unsigned char n, unsigned char m );

Parameters

n

parameter n

m

parameter m

Return Value

-- none --

Comments

This function sets the I2C bus speed, if the I2C hardware interface is used.

FREQsample = CPU clock / 2^N
FREQoscl = CPU clock / ((2^N) * (M+1) * 10)

FREQoscl is the frequency of the I²C clock line when the I²C controller is in master mode.
FREQsample is the frequency at which the I²C bus is sampled. This frequency should be at least 10 times faster than the fastest master on the bus, to ensure that START and STOP conditions are always detected.

Default is N=4, M=5, which sets FREQsample to 6 MHz and FREQoscl to 100 KHz at 96 MHz CPU frequency.

See Also

    I2C_init                

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
    n/an/an/aV0.90

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.01

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


End of document