# zephyr_prj_template **Repository Path**: Ethan-ZYS/zephyr_prj_template ## Basic Information - **Project Name**: zephyr_prj_template - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-30 - **Last Updated**: 2026-07-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### Embedded Project Template #### Introduction This embedded project template is constructed based on Zephyr RTOS and Pigweed components. The objective is to combine these two components to formulate a universal template applicable to general embedded projects in the medical device domain. Its intention is to assist developers in reusing this template during the process of conducting embedded development related to medical devices, thereby enhancing development efficiency and guaranteeing the standardization and rationality of the project structure. #### Guidelines for Developing New Modules To adhere to the principle of reusability, this project adopts a component-based development methodology. The component software generated during the project execution is stored in the "module" folder. Essentially, each "module" ought to possess a bottom-layer driver layer and an upper-layer application layer, and is uniformly managed via CMake files, leveraging the encapsulated APIs furnished by Pigweed to implement corresponding functions. The specific CMake file examples and associated explanations are presented as follows: ```cmake # Incorporate the Pigweed's CMake configuration file. The path of this file is designated through the environment variable PW_ROOT. include($ENV{PW_ROOT}/pw_build/pigweed.cmake) # Add a static library named module_name (module library) pw_add_library(module_name STATIC # Define the module library HEADERS include/module_name.h # The path and file name of the header file encompassed in this module. Other code files can utilize the interfaces and other elements defined in this module by including this header file. SOURCES src/module_name.cc # The path and file name of the source file corresponding to the module. This file houses the specific implementation code logic. PUBLIC_INCLUDES # These header files can be referenced by other modules to streamline interaction and cooperation among modules. include PRIVATE_INCLUDES # Private header files typically contain some internal definitions that are not meant to be directly accessed by external modules and are solely utilized within this module. prv_include PUBLIC_DEPS # Library dependencies, signifying other libraries or modules on which this module library depends. module_name.driver pw_lib # The Pigweed library being referenced. zephyr_interface # Referencing Zephyr-related interfaces or functions. ) # Add a static library named module_name.driver (module driver library) which is employed to manage the functional logic related to hardware device drivers. pw_add_library(module_name.driver STATIC # Define the module driver library HEADERS include/module_name_driver.h # The path and file name of the header file incorporated in the driver module. SOURCES src/module_name_driver.cc # The path and file name of the source file corresponding to the driver module. This file contains the specific code implementation related to the driver. PUBLIC_INCLUDES include PUBLIC_DEPS # Library dependencies, specifying the other libraries or modules on which this driver library depends. pw_lib # The Pigweed library being referenced. zephyr_interface # Referencing Zephyr-related interfaces or functions. ) ``` All tasks.json files have been completed for the convenience of building targets. The shortcut shif + 1 is for task labels and shit + 2 is for running the last task. **Author**: Zhang Yisong(zhangyisong@sonosemi.com) Copyright (c) Sonosemi Medical Co., Ltd. All rights reserved.