Titan-Board-Mini SDK

Contents

  • Getting Started
    • Template Project
      • Introduction
      • Features
      • Project Structure
      • Quick Start
      • Secondary Development
      • Further Reading
  • Basics
    • Key Interrupt Example Guide
      • Introduction
      • RA8 Series MCU Interrupt System Overview
      • FSP Configuration
      • Example Code Description
      • Compilation & Download
      • Run Effect
    • LED Blink Example
      • Introduction
      • GPIO Introduction
        • 1. Overview
        • 2. RA8 Series GPIO Features
        • 3. RT-Thread PIN Framework
      • Hardware Description
      • Software Description
      • Compilation & Download
      • Run Effect
      • Further Reading
  • Drivers
    • ADC Driver Example
      • Introduction
        • Key Features
      • 1. Hardware Overview
        • 1.1 RA8P1 Microcontroller Overview
        • 1.2 ADC Hardware Features
        • 1.3 Hardware Connection Diagram
      • 2. Software Architecture
        • 2.1 RT-Thread ADC Driver Framework
        • 2.2 Project Software Architecture
        • 2.3 Program Execution Flow
      • 3. Usage Examples
        • 3.1 Basic ADC Sampling
        • 3.2 Multi-threading Implementation
        • 3.3 Command Line Interface Usage
      • 4. Running Results
        • 4.1 Terminal Output Example
      • 5. Reference Resources
        • 5.1 Technical Documentation
    • CAN FD Driver Example Guide
      • Introduction
        • Key Features
        • RA8P1 CAN FD Hardware Features
      • Software Architecture - RT-Thread CAN Device Framework
        • RT-Thread Driver Model
        • CAN Device Operation Interface
        • Interrupt Handling Mechanism
      • Operation Example
        • 1. Hardware Connection
        • 2. PCAN-View Software Configuration
        • 3. Terminal Command Operations
        • 4. Data Transceiver Testing
    • Ethernet Example Guide
      • Introduction
      • Ethernet Overview
        • 1. General Introduction
        • 2. Ethernet Frame Structure
      • RA8 Series Ethernet Features
        • 1. Network Interface Features
        • 2. MAC Features
        • 3. DMA and Buffer Features
        • 4. Interrupt Mechanism
        • 5. PHY Management
        • 6. Protocol and Stack Support
        • 7. Performance and Reliability
      • FSP Configuration
      • RT-Thread Settings Configuration
      • Software Description
      • Build & Download
      • Running Effect
        • iperf Test
    • GPT Driver Example Guide
      • Introduction
        • Core Features
        • Technology Stack
      • Hardware Introduction
        • 1. RA8P1 Microcontroller Features
        • 2. GPT Hardware Module Details
      • Software Architecture
        • 1. RT-Thread Device Framework
        • 2. Driver Architecture
      • Usage Examples
      • Configuration Instructions
      • Running Effect Example
    • RTC Driver Example Guide
      • Introduction
        • Main Features
      • Hardware Introduction - RA8P1 RTC Features
        • 1. Overview
        • 2. RA8P1 RTC Main Features
        • 3. RA8P1 RTC Technical Parameters
      • Software Architecture - RT-Thread RTC Device Framework
        • 1. RT-Thread Device Architecture
        • 2. RTC Device Type
        • 3. Device Management Interface
        • 4. RT-Thread RTC API
      • Usage Example
        • 1. Time Setting and Reading
        • 2. Alarm Configuration
      • Configuration Instructions
      • Running Effect Example
        • 1. Console Output
    • SD Card File System Example Guide
      • Introduction
      • SD Card Introduction
        • 1. Overview
        • 2. SD Card Types
        • 3. SD Card Interfaces
        • 4. Working Principle
        • 5. SD Card Performance Specifications
        • 6. SD Card Application Scenarios
      • RA8 Series SDHI Module Overview
        • 1. General Features
        • 2. SDHI Module Architecture
        • 3. SDHI Working Principle
      • FSP Configuration
      • RT-Thread Settings Configuration
      • Example Project Description
      • Compilation & Download
      • Run Effect
    • SDRAM Driver Example Guide
      • Introduction
        • Key Features
        • Technical Architecture
      • Hardware Introduction
        • 2.1 RA8P1 External Memory Interface Features
        • 2.2 Supported SDRAM Types
        • 2.3 Hardware Connection
      • Software Architecture
        • 3.1 SDRAM Driver Initialization Flow
        • 3.2 Memory Management Mechanism
        • 3.3 BSP Layer Abstraction
      • Usage Examples
        • 4.1 Basic Read/Write Operations
      • Run Effect
    • SPI Driver Example Guide
      • Project Introduction
        • Key Features
      • Directory Structure
      • 1. Hardware Introduction - RA8P1 SPI Features
        • 1.1 RA8P1 Microcontroller Overview
        • 1.2 SPI Hardware Features
        • 1.3 SPI Pin Mapping
      • 2. Software Architecture - RT-Thread SPI Device Framework
        • 2.1 RT-Thread SPI Architecture Overview
        • 2.2 Main Data Structures
        • 2.3 SPI Operation Modes
        • 2.4 Core API Interfaces
      • 3. Running Effect Example
    • WDT Driver Example Guide
      • Overview
      • Directory Structure
      • 1. Hardware Introduction - RA8P1 WDT Features
        • 1.1 Watchdog Overview
        • 1.2 RA8P1 WDT Main Features
        • 1.3 Hardware Parameter Configuration
      • 2. Software Architecture - RT-Thread Watchdog Device Framework
        • 2.1 RT-Thread Watchdog Driver Architecture
        • 2.2 FSP Integration
        • 2.3 RT-Thread Device Configuration
      • 3. Usage Example - Watchdog Initialization and Feeding Based on Actual Code
        • 3.1 Main Function Analysis
        • 3.2 Watchdog Test Function (wdt_sample)
        • 3.3 RT-Thread Watchdog API
      • 4. Configuration Description - Timeout Period, Reset Mode
        • 4.1 Timeout Period Configuration
        • 4.2 Reset Mode Configuration
      • 5. WDT Project Configuration
      • 5. Running Effect Example
        • 5.1 Normal Running Process
      • Conclusion
  • Components
    • QSPI Flash File System Example Guide
      • Introduction
      • Hardware Introduction
        • 1. W25Q64 QSPI Flash
        • 2. QSPI Interface Features
      • Flash Partition Plan
      • Software Architecture
        • 1. Layered Design
        • 2. Core Components
        • 3. Project Structure
      • Usage Examples
        • 1. Initialization Flow
        • 2. File Operation Examples
      • Running Results
        • 1. Terminal Output
        • 2. File System Testing
      • Notes
        • 1. Flash Usage Limitations
        • 2. File System Recommendations
        • 3. Performance Optimization
      • Extended Applications
      • Related Resources
  • Multimedia Display
    • LVGL Example Guide
      • Instruction
      • LVGL Instruction
        • Key Features
        • Application Scenarios
        • Ecosystem and Community
        • I2C0 Configuration
        • Touch Interrupt Configuration
      • RT-Thread Settings Configuration
      • Software Description
      • Compilation & Download
      • Run Effect
    • MIPI CSI Camera Example Guide
      • Introduction
      • RA8 Series MIPI CSI Features
        • 1. Hardware Interface Features
        • 2. Image Formats and Processing Capabilities
        • 3. DMA Support and Buffering
        • 4. Interrupt Mechanism
        • 5. Timing and Synchronization Features
        • 6. Performance Optimization
        • 7. Application Scenarios
      • RA8 Series MCU GLCDC (Graphics LCD Controller) Features
        • 1. Hardware Features
        • 2. Layers and Display Modes
        • 3. DMA and Frame Buffer
        • 4. Hardware Graphics Functions
        • 5. Interrupt Mechanism
        • 6. Performance Optimization
      • RT-Thread Settings Configuration
      • Compilation & Download
      • Run Effect
  • Peripherals
    • IMU Sensor Example Guide
      • Introduction
      • Hardware Overview
        • 1. LSM6DS3TR-C IMU Sensor
        • 2. Accelerometer Features
        • 3. Gyroscope Features
        • 4. Main Features
      • Software Architecture
        • 1. Layered Design
        • 2. Core Components
        • 3. Project Structure
      • Usage Guide
        • 1. Initialization Flow
        • 2. I2C Platform Interface Implementation
        • 3. Data Format Conversion
      • Configuration Guide
        • 1. Kconfig Configuration
        • 2. RT-Thread Settings
      • Running Results
        • 1. Terminal Output
      • Related Resources
    • RGB LCD Example Guide
      • Introduction
      • RA8 Series GLCDC Module
        • 1. Overview
        • 2. Module Architecture
        • 3. GLCDC Working Principle
        • 4. GLCDC Supported Features
      • RT-Thread LCD Driver Framework
        • Main Interfaces
      • Hardware Description
      • FSP Configuration
        • HyperRAM Configuration
        • RGB LCD Configuration
        • LCD Backlight Configuration
        • D/AVE 2D Configuration
      • RT-Thread Settings Configuration
      • Compilation & Download
      • Run Effect
    • USB PCDC Driver Example Guide
      • Introduction
      • USB PCDC Instructions
        • 1. Overview
        • 2. PCDC Protocol Features
        • 3. Typical Application Architecture
        • 4. Advantages
      • RA8 Series USB PCDC Module (r_usb_pcdc) Overview
        • 1. Module Functionality
        • 2. Supported Features
        • 3. Module Architecture
        • 4. Workflow
      • FSP Configuration Configuration
      • RT-Thread Settings Configuration
      • Compilation & Download
      • Running Effect
    • WAV Audio Player Example Guide
      • Introduction
      • Hardware Introduction
        • 1. ES8156 Audio Codec
        • 2. ES8156 Key Features
        • 3. SSI (Synchronous Serial Interface)
      • Software Architecture
        • 1. Layered Design
        • 2. Core Components
        • 3. Project Structure
      • Usage
        • 1. Initialization Flow
        • 2. Playing WAV Files
        • 3. WAV File Format Requirements
      • Configuration
        • 1. Kconfig Configuration
        • 2. RT-Thread Settings
        • 3. Hardware Connections
      • Run Effect
      • Further Reading
Titan-Board-Mini SDK
  • Basics
  • LED Blink Example

LED Blink Example

English | 中文

Introduction

This example is the simplest and most basic example in the SDK, similar to the “Hello World” program that programmers encounter as their first program. The main function of this example is to make the onboard RGB LED blink periodically.

GPIO Introduction

1. Overview

GPIO (General Purpose Input/Output) is one of the most commonly used peripheral interfaces of an MCU. It can be configured under software control as either input mode or output mode:

  • Input mode: Used to read external voltage levels, such as button inputs.

  • Output mode: Used to control peripheral voltage levels, such as lighting up an LED or driving a buzzer.

2. RA8 Series GPIO Features

  • Rich pin resources: Each port can be independently configured as input/output/multiplexed function.

  • Multi-function multiplexing: In addition to GPIO functionality, the same pin can also serve as a signal line for peripherals such as UART, SPI, or I2C.

  • Level control: In output mode, pins can drive either high or low levels; some pins support open-drain mode.

  • Direction control: Input/output direction can be dynamically switched.

3. RT-Thread PIN Framework

RT-Thread provides a PIN device driver framework, which offers a unified interface to shield hardware differences:

  • rt_pin_mode() - Set the working mode of a pin (input/output/pull-up/pull-down, etc.)

  • rt_pin_write() - Output a voltage level (high/low)

  • rt_pin_read() - Read an input voltage level

This way, developers don’t need to directly manipulate registers; GPIO control can be achieved through RT-Thread’s API.

In this example, the LED pin is configured as output mode, and the software continuously toggles between high and low levels to make the LED blink.

Hardware Description

Titan Board Mini provides three user LEDs: LED_R (RED), LED_B (BLUE), LED_G (GREEN). The LED corresponds to specific pins on the MCU. To turn on the LED, a low level signal is output from the MCU pin, and to turn it off, a high level signal is output.

Software Description

The source code for this example is located in src/hal_entry.c. The MCU pin definitions for the LEDs and the LED control logic can be found in the source file.

/* Configure LED pins */
rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT);

/* Control LED */
rt_pin_write(LED_PIN, LED_ON);  // Turn on
rt_pin_write(LED_PIN, LED_OFF); // Turn off

Compilation & Download

  1. Open the project in RT-Thread Studio

  2. Build the project using the build button

  3. Connect the debug probe to the development board

  4. Download the firmware to the board

Run Effect

After pressing the reset button to restart the development board, observe the LED blinking effect. The RGB LEDs will change periodically.

Further Reading

  • RT-Thread PIN Device

Previous Next

© Copyright Copyright (c) 2006-2025, RT-Thread Development Team.

Titan-Board-Mini SDK • 版本:1.0.0
构建时间: