Veethree D7 SDK
Loading...
Searching...
No Matches
System library overview

Introduction

The D7 SDK System Library provides interfaces for controlling various hardware components of the Veethree D7 platform including display backlight, button illumination, buzzer, bootloader environment variables retrieval, and OTP register access.

Key Features

  • Display backlight control with brightness adjustment
  • Button illumination control with individual and group control
  • Buzzer control for audible feedback
  • Set and get operations of the bootloader environment variables
  • System information retrieval
  • OTP register read operations

Architecture

The System Library is organized into several key components:

  • Display - Control of the display backlight and properties
  • Buttons - Control of button illumination
  • Buzzer - Control of the system buzzer
  • Bootloader - Interface for bootloader operations
  • System Info - Functions to retrieve system information
  • OTP - One-Time Programmable register access for device configuration

Main Components

Display Control

The Display component provides interfaces for controlling the display backlight and properties.

Key class:

void example() {
using namespace vsdk::sys;
// Set the backlight brightness (0-100%)
}
static void set_brightness(uint32_t value)
Set the brightness level.
backlight_manager interface.
Any entities that belong to the system library.

Button Backlight control

The Button Backlight control provides interfaces for controlling the button LEDs.

Key class:

void example() {
using namespace vsdk::sys;
rgb_button_backlight(rgb_button_id::btn1).set_colour(200, 10, 0);
}
rgb_button_backlight interface.
The rgb_button_backlight class.
Definition button_backlight.h:42
void set_colour(uint8_t red, uint8_t green, uint8_t blue)
Set all colour components.

Buzzer Control

The Buzzer component provides interfaces for generating audible feedback.

Key class:

#include <system/buzzer.h>
void example() {
using namespace vsdk::sys;
// Enable the buzzer
// Wait for 500ms
std::this_thread::sleep_for(500ms);
// Disable the buzzer
}
buzzer interface
static void buzzer_enable(bool enable, buzzer_boost level=buzzer_boost::no_boost)
Enable or disable the buzzer, using default definitions for buzzer_config.

Bootloader Operations

The bootloader component is responsible for interacting with the board bootloader, primarily via bootloader environment variables.

Key class:

void example() {
using namespace vsdk::sys;
// Set a bootloader variable value
bootloader_manager::set_value("brightness_level", 75);
// Get a bootloader variable value
std::string brightness_level{};
bootloader_manager::get_value("brightness_level", brightness_level);
}
bootloader_manager interface
static void get_value(std::string_view var, uint64_t &value)
Get a bootloader variable value.
static void set_value(std::string_view var, uint64_t value, bool hex=false)
Set a bootloader variable value.

System Information

The System Information component provides interfaces for retrieving system information.

Key classes:

void example() {
using namespace vsdk::sys;
// Get the system information instance
}
board_info interface
static std::string soc_serial_number()
Get the board SoC serial number.

OTP Register Access

The OTP (One-Time Programmable) component provides interfaces for reading permanent device configuration data, and factory-programmed information from OTP registers.

Key class:

void read_device_info() {
using namespace vsdk::sys;
// Read device serial number or calibration data
std::vector<uint32_t> data;
auto result = otp_manager::read(0x2c4, 4, data);
if (result == otp_result::success) {
// Process the OTP data
for (size_t i = 0; i < data.size(); i++) {
// Handle each 32-bit word
}
}
}
static otp_result read(uint32_t word_address, size_t num_words, std::vector< uint32_t > &data)
Read OTP register words.
OTP register manager interface.

Common OTP Register Addresses

Fuse Row Index Purpose
708-709 MAC Address 1
710-711 MAC Address 2
765-766 Device Information

Please refer to the i.MX8QXP Reference Manual, Chapter 7 (Fuse Map) for complete fuse row specifications.

See the System library examples page for complete code examples.