- #include <core.h>
- #include <gpio.h>
- int main() {
- // Init the microcontroller
- Core::init();
- // Define the pin on which the LED is connected
- // On Carbide, this is the red LED
- GPIO::Pin led = GPIO::PA00;
- // Enable this pin in output to a HIGH state
- GPIO::enableOutput(led, GPIO::HIGH);
- while (1) {
- // Turn the LED on
- GPIO::setLow(led);
- // Wait for half a second
- Core::sleep(500);
- // Turn the LED off
- GPIO::setHigh(led);
- // Wait for half a second
- Core::sleep(500);
- }
- }
- NAME=blink
- # Available modules : adc dac eic gloc i2c spi tc trng usart.
- # Some modules such as gpio and flash are already compiled by default
- # and must not be added here.
- MODULES=
- # User-defined modules to compile with your project
- USER_MODULES=
- # The toolchain's bin/ path, don't forget to customize it.
- # If this directory is already in your PATH, comment this line.
- TOOLCHAIN_PATH=/opt/arm-none-eabi/bin/
- # Include the main lib makefile
- include libtungsten/Makefile