Skip to content

aldrinrebellow7/Nextion-Library-Ported-For-STM32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

📟 Nextion Library Ported for STM32

A lightweight and efficient port of the popular ITEAD Nextion Display Library, tailored for STM32 microcontrollers using HAL drivers and C++ support. This library simplifies serial communication between STM32 and Nextion HMI displays, enabling seamless GUI integration in embedded systems.


🚀 Features

  • 🔌 UART-based communication via STM32 HAL
  • 🧾 Control pages, text fields, buttons, variables and more
  • 🔁 Simple API to send/receive Nextion commands
  • 💡 Designed for STM32CubeIDE with C++ enabled
  • ⚡ Compatible with STM32F1, F4, and other STM32 families

⚠️ Note: This library is written in C++. Make sure your STM32 project is configured to support C++ (.cpp files, proper C++ toolchain, and extern "C" where needed for HAL compatibility).


🧰 Getting Started

✅ Prerequisites

  • STM32CubeIDE or STM32CubeMX
  • STM32 HAL UART enabled
  • C++ toolchain support in your STM32 project
  • Nextion HMI display & Nextion Editor

📁 Folder Structure

├── Core
│   ├── Inc
│   │   └── nextion.h        # C++ class interface
│   └── Src
│       └── nextion.cpp      # Class implementation
├── README.md

⚙️ Basic Usage

  1. Include the header in your .cpp file:

    #include "nextion.h"
  2. Create a Nextion instance and initialize:

    extern UART_HandleTypeDef huart1;
    Nextion nex(&huart1);
  3. Send commands to the Nextion display:

    nex.sendCommand("page 0");
    nex.setText("t0", "Hello World!");
  4. Read response (if needed):

    std::string result = nex.receive();

🔧 Configuration Tips

  • Use .cpp files for all your logic using this library.
  • Wrap C headers like main.h or HAL includes in extern "C" if included in .cpp files.
  • Ensure STM32CubeIDE is set to compile C++ files (rename main.c to main.cpp if needed).
  • Disable unused C++ features (like RTTI/exceptions) in project settings for smaller binaries.

📚 References


🤝 Contributing

Contributions are welcome! Please feel free to fork this project, submit pull requests, or open issues to improve the library.


📄 License

This project is licensed under the MIT License.


👤 Author

Developed by Aldrin Rebellow
🔗 LinkedIn

About

Nexiton HMI display library for ardunio is ported to be used with STM32

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors