Code Monkey home page Code Monkey logo

doom's Introduction

libhal-starter

Before getting started, if you haven't used libhal before, follow the Getting Started guide.

To build the project:

conan build . -pr <target_name> -pr <compiler>

For the lpc4078

conan build . -pr lpc4078 -pr arm-gcc-12.3

For the STM32F103 MicroMod V4:

conan build . -pr mod-stm32f1-v4 -pr arm-gcc-12.3

Supported platforms

  • lpc4078
  • lpc4074
  • micromod
    • lpc4078 MicroMod V5
    • stm32f103c8 MicroMod V4
  • stm32f103c8

Installing Platform Profiles

lpc40 profiles:

conan config install -sf conan/profiles/v2 -tf profiles https://github.com/libhal/libhal-lpc40.git

stm32f1 profiles:

conan config install -sf conan/profiles/v2 -tf profiles https://github.com/libhal/libhal-stm32f1.git

micromod profiles:

conan config install -sf conan/profiles/v1 -tf profiles https://github.com/libhal/libhal-micromod.git

Description of Files

  1. main.cpp: It contains the main loop of the application. In this example, it just prints "Hello, World" and toggles an LED on and off.
  2. application.hpp: This file defines the hardware_map_t struct which holds pointers to the led, console, clock interfaces and reset callback. Modify this structure to change the set of required drivers and settings for an application. initialize_platform, and application functions that must be implemented elsewhere.
  3. CMakeLists.txt: This is the build file for the project. It sets the minimum required version of CMake, names the project, and sets the platform library. It also defines the sources to compile and the libraries to link against. Finally, it sets up the post-build steps with libhal_post_build.
  4. platforms/lpc4078.cpp: This file provides an implementation for initialize_platform, for the LPC4078 platform. In initialize_platform, it sets the clock speed, configures a uart peripheral for console output, and sets up an output pin for the led. Each driver is statically allocated. The returned hardware_map_t has the pointers to each statically allocated peripheral and a reset callback that can resets the microcontroller.
  5. platforms/*.cpp: Just like platforms/lpc4078.cpp but for any other platforms. It's important to note that the specifics of the initialize_platform function and the peripherals used will likely vary between different platforms but sometimes they don't. As an example the lpc4074.cpp file just includes directly the lpc4078.cpp because those are identical.

doom's People

Contributors

kammce avatar

Watchers

 avatar

doom's Issues

Investigate using a `hal::pixel_display` for graphics rendering

The hal::pixel_display interface only allows drawing of a single pixel at a time for each call of its draw(pixel_t) API. The idea would be to remove the allocation of the frame buffer and every time doom tries to set a pixel in the frame buffer, it simply calls our display driver to draw to the screen. This would be awfully slow but it would greatly reduce the RAM requirements for MCUs, allowing more devices to be supported.

Even if its unplayable, simply making this work would be a great win.

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.