Electrum Examples
From Manuals
| Line 3: | Line 3: | ||
Since Linux implements virtual memory, there is no direct access to processor registers. One popular alternative to access processor registers in user space is to open a handle to /dev/mem and then use mmap() to map a virtual memory address to a physical memory address. These examples use this approach to access processor registers. The peripheral code is adapted from the [http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4343 Atmel AT91 Softpack library]. | Since Linux implements virtual memory, there is no direct access to processor registers. One popular alternative to access processor registers in user space is to open a handle to /dev/mem and then use mmap() to map a virtual memory address to a physical memory address. These examples use this approach to access processor registers. The peripheral code is adapted from the [http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4343 Atmel AT91 Softpack library]. | ||
| - | The default compiler is the EmDebian cross-compiler. For details on the toolchain installation, please refer to the [[Electrum-100_Manual/2#Toolchain_installation|manual]. You can choose another compiler by specifying a COMPILER variable in the Makefile. | + | The default compiler is the EmDebian cross-compiler. For details on the toolchain installation, please refer to the [[Electrum-100_Manual/2#Toolchain_installation|manual]]. You can choose another compiler by specifying a COMPILER variable in the Makefile. |
# On-board gcc COMPILER=gcc | # On-board gcc COMPILER=gcc | ||
Revision as of 18:08, 5 January 2011
These code examples will help you get started with your user space applications on the Micromint Electrum. Our support staff (support@micromint.com) can assist you with questions on specific functions.
Since Linux implements virtual memory, there is no direct access to processor registers. One popular alternative to access processor registers in user space is to open a handle to /dev/mem and then use mmap() to map a virtual memory address to a physical memory address. These examples use this approach to access processor registers. The peripheral code is adapted from the Atmel AT91 Softpack library.
The default compiler is the EmDebian cross-compiler. For details on the toolchain installation, please refer to the manual. You can choose another compiler by specifying a COMPILER variable in the Makefile.
# On-board gcc COMPILER=gcc # EmDebian (default) COMPILER=emdebian # Sourcery G++ Lite COMPILER=sourcerygxx
| Example | Description | Electrum 100 |
|---|---|---|
| adc | Test processor ADCs | |
| blinky | Blinks user LED | |
| button | Uses button to set LED | |
| dac_spi | Test SPI DACs (requires I/O option) | |
| hello | Simple console output | |
| littlec | Little C interpreter | |
| minibasic | Simple BASIC interpreter | |
Interrupt handlers and other applications that require full control of timing or preemption should implement device drivers or modules in kernel space. The Linux Device Drivers (LDD) book covers most concepts required for device driver development. Note that a free online version of the LDD book is available. The kernel source code also contains device drivers for Atmel processors.
