I2c_ds1307_rtc example
This example demonstrates use of the i2c driver (Inter-Integrated Circuit) in KasperskyOS.
In this example, the I2cClient program uses the i2c driver interface.
The client library of the i2c driver is statically linked to the I2cClient program. The i2c driver implementation uses a BSP (Board Support Platform) subsystem for configuring clock frequencies (Clocks) and pins multiplexing (PinMux). Therefore, to ensure correct operation of the driver, you need to do the following:
- Link the
I2cClientprogram to thei2c_CLIENT_LIBclient library. - Link the
I2cClientprogram to thebsp_CLIENT_LIBclient library. - Create an IPC channel between the
I2cClientprogram and thekl.drivers.I2Cdriver. - Create an IPC channel between the
I2cClientprogram and thekl.drivers.BSPdriver.
The CMake system, which is included with KasperskyOS Community Edition, is used to build and run the example.
Example files
The code of the example and build scripts are available at the following path:
/opt/KasperskyOS-Community-Edition-<version>/examples/i2c_ds1307_rtc
Building and running example
This example is intended to run only on Raspberry Pi. For the example to work correctly, you must connect a DS1307Z real-time clock module to the i2c port.
See Building and running examples section.