Open-source, hacker-friendly, education-oriented library
for Atmel's ATSAM4L ARM microcontrollers
Overview Getting started
(   This website is currently under construction, feel free to look around but be aware that some pages might be missing!)
Atmel's ATSAM4L
  • 32-bit ARM architecture
  • Up to 48MHz
  • Up to 64Kb RAM and 512Kb Flash
  • Multiple USART, I2C and SPI controllers
  • Native USB (Device and Host)
  • DMA
  • ADCs, DAC, timers, touchscreen controller, random number generator, and a lot more...
Modules reference
Open the box
  • Really open-source : please come in!
  • Permissive Apache 2.0 license
  • Hackers-friendly : well-commented modules and datasheet references to help tinkering
  • Beginners-friendly : in-depth tutorials and documentation to learn how it works inside
  • Designed for learning, prototyping, and overall, building cool stuff
  • Keep It Super Simple : pure C++11, no complicated dependencies, no compilation hacks, no obscure preprocessor nonsense
Philosophy
Go further
GDB tutorial
Hello World!
blink.cpp
  1. #include <core.h>
  2. #include <gpio.h>
  3.  
  4. int main() {
  5. // Init the microcontroller
  6. Core::init();
  7.  
  8. // Define the pin on which the LED is connected
  9. // On Carbide, this is the red LED
  10. GPIO::Pin led = GPIO::PA00;
  11.  
  12. // Enable this pin in output to a HIGH state
  13. GPIO::enableOutput(led, GPIO::HIGH);
  14.  
  15. while (1) {
  16. // Turn the LED on
  17. GPIO::setLow(led);
  18.  
  19. // Wait for half a second
  20. Core::sleep(500);
  21.  
  22. // Turn the LED off
  23. GPIO::setHigh(led);
  24.  
  25. // Wait for half a second
  26. Core::sleep(500);
  27. }
  28. }
Makefile
  1. NAME=blink
  2.  
  3. # Available modules : adc dac eic gloc i2c spi tc trng usart.
  4. # Some modules such as gpio and flash are already compiled by default
  5. # and must not be added here.
  6. MODULES=
  7.  
  8. # User-defined modules to compile with your project
  9. USER_MODULES=
  10.  
  11. # The toolchain's bin/ path, don't forget to customize it.
  12. # If this directory is already in your PATH, comment this line.
  13. TOOLCHAIN_PATH=/opt/arm-none-eabi/bin/
  14.  
  15. # Include the main lib makefile
  16. include libtungsten/Makefile
In a (nut)shell :
  • mkdir blink
  • cd blink
  • git clone git@github.com:Foalyy/libtungsten.git
  • wget http://libtungsten.io/static/code/examples/blink/blink.cpp
  • wget http://libtungsten.io/static/code/examples/blink/Makefile
  • vim Makefile # Check TOOLCHAIN_PATH
  • make upload # Or make autoflash with a JTAG/SWD adapter
Looks interesting?