Menu

configuration

Majenko Technologies

Configuration File

The configuration file is actually more akin to a script file. The file is parsed line by line and actions are taken depending on what is found.

The general format of the file is:

;a comment
command argument arguement...

Note that comments cannot (yet) occur on a line with a command.

Commands

  • bus

Format: bus name

Create a new bus with the name name

  • device

Format: device name module

Create a new device with name name and load the module module for it. If module does not exist then an error is raised and loading fails.

  • config

Format: config device key value

Configure a device. The device is selected using the name provided when creating the device. See the individual device pages for the available configuration keys and their values.

  • connect

Format: connect device io-port bus direction

Connect the io-port on device to the bus specified by bus. The direction is one of in, out or inout.

  • start

Format: start device

Start the core of device running. Device has to be capable of running (not all are "active"). Typically used for things like microcontrollers and processors.

  • set

Format: set bus value

Set the bus to the specified value. Useful for setting a starting value on a bus, or raising a reset line to start a processor running at the end of the configuration.

Example

; Busses (these are basically wires)
bus red
bus green
bus blue

; Plug in a PIC10 microcontroller and wire it up
device pic10 ../devices/microcontrollers/microchip/pic10/pic10.so
    config pic10 flash test.hex
    config pic10 frequency 100000
    connect pic10 GPIO0 red out
    connect pic10 GPIO1 green out
    connect pic10 GPIO2 blue out

; Wire in an RGB LED
device led ../devices/support/led/led.so
    connect led red red in
    connect led green green in
    connect led blue blue in

; Run the system
start pic10

Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.