This example demonstrates how to work with I2C (Inter-Integrated Circuit) to control a real-time clock module based on the BM8563 chip in KasperskyOS.
This example is intended to run only on Radxa ROCK 3A.
Example directory in the SDK
The code of the example and build scripts are available at the following path:
/opt/KasperskyOS-Community-Edition-<platform>-<version>/examples/i2c_bm8563_rtc
List of programs
BM8563 is an application that uses the I2C driver interface.I2C – I2C driver.DCM – system program that lets you dynamically create IPC channels.BSP is a hardware platform support package (Board Support Package). Provides cross-platform peripheral configuration.To ensure the correct operation of I2C and BSP drivers, the following conditions must be met:
BM8563 program to the client libraries named i2c::process_interface and bsp::client.BM8563 and I2C programs and between the BM8563 and BSP programs.Initialization description
The solution initialization description file named init.yaml is generated during the solution build process based on the ./einit/src/init.yaml.in template. Macros in @INIT_*@ format contained in the template are automatically expanded in the resulting init.yaml file. For more details, refer to init.yaml.in template.
Security policy description
The security.psl file contains a description of a security policy for a KasperskyOS-based solution and is located in the ./einit/src directory. The declarations in the PSL file are provided with comments that explain the purpose of these declarations.
Resources
The ./resources/xdl/bm8563_rtc directory contains the BM8563.edl file, which is the EDL description for the BM8563 program.
Operating scenario
The BM8563 program performs the following actions:
BM8563_SECONDS_REG macro) and prints them to standard error in the date and time format.BM8563_STOP_RTC_BIT in the BM8563_CTRLSTS1_REG control register.BM8563_SECONDS_REG register).BM8563_CTRLSTS1_REG register).EXIT_SUCCESS code if there are no errors, otherwise it shows the EXIT_FAILURE code.Building and running the example
The CMake system, which is included with KasperskyOS Community Edition, is used to build and run the example.
See Building and running examples section.
Page top