Skip to content

Instantly share code, notes, and snippets.

View OrsoEric's full-sized avatar
💭
Robot Mode: ON

Orso Eric OrsoEric

💭
Robot Mode: ON
View GitHub Profile
@OrsoEric
OrsoEric / main.cpp
Created July 4, 2020 11:28
Longan Nano GD32VF103 Polling Interrupt Flags
#include <gd32vf103.h>
void init()
{
rcu_periph_clock_enable(RCU_GPIOA);
rcu_periph_clock_enable(RCU_GPIOC);
gpio_init(GPIOA, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ,GPIO_PIN_1);
gpio_init(GPIOA, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ,GPIO_PIN_2);
gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ,GPIO_PIN_8);
@OrsoEric
OrsoEric / main.cpp
Created July 4, 2020 11:32
Longan Nano GD32VF103 PA8 Interrupt (Not Working)
#include <gd32vf103.h>
void init()
{
rcu_periph_clock_enable(RCU_GPIOA);
rcu_periph_clock_enable(RCU_GPIOC);
gpio_init(GPIOA, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ,GPIO_PIN_1);
gpio_init(GPIOA, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ,GPIO_PIN_2);
gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ,GPIO_PIN_8);
@OrsoEric
OrsoEric / main.cpp
Created July 5, 2020 07:09
GD32VF103 Longan Nano PA8 interrupt Minimal Example
#include <gd32vf103.h>
#define EVER (;;)
void init()
{
//Clock the GPIO banks
rcu_periph_clock_enable(RCU_GPIOA);
rcu_periph_clock_enable(RCU_GPIOC);
//Setup the R, G and B LEDs
gpio_init(GPIOA, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ,GPIO_PIN_1);
@OrsoEric
OrsoEric / main.cpp
Created August 2, 2020 06:23
Longan Nano RTC PA8 Interrupts
/****************************************************************************
** OrangeBot Project
*****************************************************************************
** /
** /
** /
** ______ \
** \
** \
*****************************************************************************
@OrsoEric
OrsoEric / init.cpp
Created August 2, 2020 06:24
Longan Nano PA8 RTC Interrupt
/****************************************************************************
** init.cpp
*****************************************************************************
** Board initializations
** >GPIO
** >EXTI
** >ECLIC
****************************************************************************/
/****************************************************************************
@OrsoEric
OrsoEric / int.cpp
Created August 2, 2020 06:25
Longan Nano RTC PA8 Interrupt
/****************************************************************************
** int.cpp
*****************************************************************************
** Interrupt Service Routines
** NOTE:
** extern "C" keyword tells the C++ compiler not to mangle the ISR nfunction name
** the Interrupt Vector Table is declared in Start.S and requires special names
** for the ISRs without mangling to link correctly
****************************************************************************/
@OrsoEric
OrsoEric / longan_nano_led.hpp
Created August 2, 2020 06:26
Longan Nano RTC PA8 Interrupt
/**********************************************************************************
** ENVIROMENT VARIABILE
**********************************************************************************/
#ifndef LONGAN_NANO_LED_H_
#define LONGAN_NANO_LED_H_
/**********************************************************************************
** GLOBAL INCLUDES
**********************************************************************************/
@OrsoEric
OrsoEric / longan_nano_chrono.hpp
Created August 2, 2020 09:43
Longan Nano GD32VF103 Chrono Class
/**********************************************************************************
BSD 3-Clause License
Copyright (c) 2020, Orso Eric
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
@OrsoEric
OrsoEric / chrono_scheduler_demo.cpp
Last active August 2, 2020 09:58
Longan Nano GD32VF103 Chrono Scheduler Demo
/****************************************************************************
** OrangeBot Project
*****************************************************************************
** /
** /
** /
** ______ \
** \
** \
*****************************************************************************
@OrsoEric
OrsoEric / longan_nano_screen.hpp
Last active August 8, 2020 08:16
Screen Class. Provide an abstraction layer and asynchronous print methods for the Display Class
/**********************************************************************************
BSD 3-Clause License
Copyright (c) 2020, Orso Eric
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this