Giter Club home page Giter Club logo

mcu-zhishan-iot / hml_fwlib_stc10 Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 6.0 2.48 MB

A lite firmware library for STC micro STC10 series MCU based on SDCC complier | 基於SDCC編譯器實現的針對宏晶微电子(STC Micro)STC10系列單晶片的輕量級固件庫

Home Page: https://hw.zhishan-iot.tk/page/hml/detail/fwlib_stc10.html

License: Do What The F*ck You Want To Public License

C 83.83% Makefile 8.59% CMake 7.58%
sdcc stc-mcu 8051 stc10

hml_fwlib_stc10's Introduction

HML_FwLib_STC10

Jenkins GitHub repo size GitHub GitHub tag (latest by date)

What is HML_FwLib_STC10

HML_FwLib_STC10 is a member component of HML firmware library, providing a group of interface functions for users to operate on-chip resource of STC10 MCUs, including GPIO, IAP, timer, UART, external interrupt, power management and watchdog. The STC10 MCU is a kind of Intel MCS-51 based MCU which released by STC Micro(宏晶). This series MCU have more on-chip resource and higher running speed. There is a document record difference STC10 & MCS-51 under doc directory.

We intend to provide a lite and easy-use firmware library that can help future developers to complete projects based on STC10 MCUs more easily and quickly. All source codes are written in C language and for SDCC compiler, i.e., it can only be compiled by SDCC. This choice is motivated by the fact that SDCC is free and highly efficient, while there are very few examples of application about SDCC on the Internet. We hope that, as one of the early attempts to develop MCU projects using SDCC, this work will make SDCC become more popular among MCU developers.

Please visit detail page for more information to get started it!

Feature

  • 🎯Based on SDCC compiler.
  • Cover all on-chip resource of STC10 series MCUs.
  • Open all source code on Github and licensed under the WTFPL2.
  • Readable code and provide examples to help you get started it.

What's working

Here is a list of the all on-chip peripheral drivers and examples that need to be ported.

Peripheral Description Status
extended bus Intel 8080 bus receiver/transmitter supported
EXTI extern interrupt supported
GPIO I/O peripheral supported
IAP in application programming supported
PWR power management supported
RCC reset & clock control supported
TIM timer supported
UART universal asynchronous receiver/transmitter supported
WDT watchdog supported

Config

There are several parameters need to be configured by user manually.

__CONF_COMPILE_xxx (for conditional compilation)

In order to ensure the projects based on HML_FwLib_STC10 can be downloaded into the limited on-chip flash space of STC10 MCUs, the developers can modify the macro definition named __CONF_COMPILE_xxx in conf.h to specify which piece of codewill take part in compilation, then it will reduce size of final .hex file. If user only use GPIO module, then user just need to enable __CONF_COMPILE_GPIO macro in conf.h. Some macros for conditional compilation rely on others. For example, before you define the macro definition __CONF_COMPILE_RCC, the macro __CONF_COMPILE_UTIL should be defined, otherwise the compilation would be failed.

__CONF_FRE_CLKIN

The macro mark frequency of clock source, including extern crystal oscillator or internal RC oscillating circuit, and it's defined in hml/conf.h.

__CONF_HML_POW

Enable function pow() which provided by HML. SDCC builtin library doesn't have this function.

__CONF_MCU_MODEL

The macro mark the model of target MCU and is defined in hml/conf.h.

Building

We provide two kinds of build system support:

  • cmake
  • gmake

cmake

Run this command for initialization. Add option -GNinja if you expect to build project via Ninja.

$ cmake -S . -B build

Run this command for building project. Add option --clean-first if you want to execute clean operation before building.

$ cmake --build build -j$(nproc)

You can execute command cmake --build build -t usage for usage. If you want to adjust build details, please modify cmake/config.cmake.

gmake

Execute this command for building HML_FwLib_STC10 with GNU Make.

$ make -j$(nproc)

You can execute command make help for usage. If you want to adjust build details, please modify mk/config.mk.

Contributing

Welcome suggestions and contribution from you! You can fork it or contact us via [email protected].

License

HML_FwLib_STC10 is licensed under the WTFPL2.

Team

member role e-mail
Amy Chung Testing [email protected]
Jiabin Hsu MCU developer [email protected]
Weilun Fong Director [email protected]

hml_fwlib_stc10's People

Contributors

mcu-zhishan-iot avatar weilunfong avatar zhongliguo avatar zsiothsu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.