MNT Reform: Open Source Portable Computer https://mntre.com/reform
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
mntmn c1847294b3
add WALLPOWER_DETECT_VOLTAGE and lower it to 24V
5 months ago
..
boards add WALLPOWER_DETECT_VOLTAGE and lower it to 24V 5 months ago
cli WIP add reform2-lpc-fw based on microbuilder 1 year ago
core LPC: WIP: some more replacements to fix build 10 months ago
drivers WIP add reform2-lpc-fw based on microbuilder 1 year ago
localisation WIP add reform2-lpc-fw based on microbuilder 1 year ago
protocol WIP add reform2-lpc-fw based on microbuilder 1 year ago
GPATH WIP add reform2-lpc-fw based on microbuilder 1 year ago
GRTAGS WIP add reform2-lpc-fw based on microbuilder 1 year ago
GTAGS WIP add reform2-lpc-fw based on microbuilder 1 year ago
README.md WIP add reform2-lpc-fw based on microbuilder 1 year ago
asserts.h WIP add reform2-lpc-fw based on microbuilder 1 year ago
binary.h WIP add reform2-lpc-fw based on microbuilder 1 year ago
errors.h WIP add reform2-lpc-fw based on microbuilder 1 year ago
fixed.h WIP add reform2-lpc-fw based on microbuilder 1 year ago
log.h WIP add reform2-lpc-fw based on microbuilder 1 year ago
printf-retarget.c WIP add reform2-lpc-fw based on microbuilder 1 year ago
projectconfig.h WIP add reform2-lpc-fw based on microbuilder 1 year ago
sysdefs.h WIP add reform2-lpc-fw based on microbuilder 1 year ago

README.md

Where’s main.c ?

To make it easier to use the code base across a number of projects, the ‘int main(void)’ function is placed inside a board-specific file in ‘/src/boards/board_name/', along with a header file containing all of the configuration flags for that project.

You select a target board by adding a single #define somewhere in your project (this should already be done for you in the LPCXpresso and Crossworks project files, as well as in the Makefile), and projectconfig.h in the root src folder will point the code base to the right board file based on this define:

    #if defined(CFG_BRD_LPCXPRESSO_LPC1347)
      #include "boards/lpcxpresso1347/board_lpcxpresso1347.h"
    #elif defined(CFG_BRD_RF1GHZNODE)
       #include "boards/rf1ghznode/board_rf1ghznode.h"
    #elif defined(CFG_BRD_RF1GHZUSB)
      #include "boards/rf1ghzusb/board_rf1ghzusb.h"
    #elif defined (CFG_BRD_LPCNFC)
      #include "boards/lpcnfc/board_lpcnfc.h"
    #elif defined (CFG_BRD_LPCSTEPPER)
      #include "boards/lpcstepper/board_lpcstepper.h"
    #elif defined (CFG_BRD_SIMULATOR)
      #include "boards/simulator/board_simulator.h"
    #else
      #error "No CFG_BRD_* has been defined"
    #endif

Source Code Organisation

To maintain a basic structure in the code base, the code is divided into several folders:

###src/boards### Board or project-specific code, including the board-specific ‘main’ function that serves as the entry point for your projects, and any board/project-specific config settings. See projectconfig.h for more information on selecting a target board.

###src/cli###

Core code for the text-based command-line interface. This is only used if CFG_INTERFACE is enabled in your board config file, in combination with either CFG_PRINTF_USBCDC or CFG_PRINTF_UART.

###src/core### Drivers for the core peripherals on the MCU, such as GPIO, USB, ADC, the delay timer, etc.

###src/drivers### Drivers for any HW other than the core MCU peripherals, such as various sensors or displays, and some helper functions like code to bit-bang SPI, simple DSP filters, etc.

###src/localisation### A rudimentary attempt at providing localised text to allow multiple languages in one firmware build (experimental code, and likely to change in future releases)

###src/protocol### A simple binary protocol to handle commands via binary serial buses like USB, SPI or I2C. This is still in development and should be considered experimental code, but the goal is to eventually provide an easy way to interact with a PC via USB using a class like USB HID or via another MCU with SPI.