Longan Nano
Longan Nano Demo
main.cpp File Reference
#include <random>
#include <gd32vf103.h>
#include "longan_nano_led.hpp"
#include "longan_nano_chrono.hpp"
#include "longan_nano_screen.hpp"
Include dependency graph for main.cpp:

Classes

struct  _Scheduler
 

Macros

#define EVER   (;;)
 

Typedefs

typedef enum _Config Config
 
typedef enum _Demo Demo
 
typedef struct _Scheduler Scheduler
 

Enumerations

enum  _Config {
  SCREEN_US = 100, LED_BLINK_US = 250000, SLOW_DEMO_US = 750000, MEDIUM_DEMO_US = 50000,
  FAST_DEMO_US = 2000
}
 
enum  _Demo {
  TEST_CLEAR_BLINK, TEST_CHAR_CONSOLE, TEST_CHAR_CONSOLE_COLOR, TEST_STRING_CONSOLE,
  TEST_STRING_CONSOLE_COLOR, TEST_NUMBERS, TEST_ENG_NUMBERS, TEST_PENDING,
  TEST_CHANGE_COLORS, TEST_WORKLOAD, NUM_DEMOS, MAX_STR_LEN = 25
}
 

Functions

void init_pa8_button_interrupt (void)
 
std::uniform_int_distribution< uint8_t > g_rng_char (' ', '~')
 
std::uniform_int_distribution< int > g_rng_height (0, Longan_nano::Screen::Config::FRAME_BUFFER_HEIGHT -1)
 
std::uniform_int_distribution< int > g_rng_width (0, Longan_nano::Screen::Config::FRAME_BUFFER_WIDTH -1)
 
std::uniform_int_distribution< uint8_t > g_rng_color (0, Longan_nano::Screen::Config::PALETTE_SIZE -1)
 
std::uniform_int_distribution< uint8_t > g_rng_length (0, MAX_STR_LEN)
 
int main (void)
 
void EXTI5_9_IRQHandler (void)
 

Variables

volatile bool g_rtc_flag = false
 
std::default_random_engine g_rng_engine
 
Scheduler g_scheduler = { 0 }
 
volatile bool g_f_pa8_button_up = false
 

Macro Definition Documentation

◆ EVER

#define EVER   (;;)

Typedef Documentation

◆ Config

typedef enum _Config Config

◆ Demo

typedef enum _Demo Demo

◆ Scheduler

typedef struct _Scheduler Scheduler

Enumeration Type Documentation

◆ _Config

enum _Config
Enumerator
SCREEN_US 
LED_BLINK_US 
SLOW_DEMO_US 
MEDIUM_DEMO_US 
FAST_DEMO_US 

◆ _Demo

enum _Demo
Enumerator
TEST_CLEAR_BLINK 
TEST_CHAR_CONSOLE 
TEST_CHAR_CONSOLE_COLOR 
TEST_STRING_CONSOLE 
TEST_STRING_CONSOLE_COLOR 
TEST_NUMBERS 
TEST_ENG_NUMBERS 
TEST_PENDING 
TEST_CHANGE_COLORS 
TEST_WORKLOAD 
NUM_DEMOS 
MAX_STR_LEN 

Function Documentation

◆ EXTI5_9_IRQHandler()

void EXTI5_9_IRQHandler ( void  )

User clicked the PA8 boot button This button is used to switch between demos

◆ g_rng_char()

std::uniform_int_distribution<uint8_t> g_rng_char ( ' '  ,
'~'   
)
Here is the caller graph for this function:

◆ g_rng_color()

std::uniform_int_distribution<uint8_t> g_rng_color ( ,
Longan_nano::Screen::Config::PALETTE_SIZE 1 
)
Here is the caller graph for this function:

◆ g_rng_height()

std::uniform_int_distribution<int> g_rng_height ( ,
Longan_nano::Screen::Config::FRAME_BUFFER_HEIGHT 1 
)
Here is the caller graph for this function:

◆ g_rng_length()

std::uniform_int_distribution<uint8_t> g_rng_length ( ,
MAX_STR_LEN   
)
Here is the caller graph for this function:

◆ g_rng_width()

std::uniform_int_distribution<int> g_rng_width ( ,
Longan_nano::Screen::Config::FRAME_BUFFER_WIDTH 1 
)
Here is the caller graph for this function:

◆ init_pa8_button_interrupt()

void init_pa8_button_interrupt ( void  )

User clicked the PA8 boot button This button is used to switch between demos

Here is the caller graph for this function:

◆ main()

int main ( void  )
Returns
int |

Entry point of program

Here is the call graph for this function:

Variable Documentation

◆ g_f_pa8_button_up

volatile bool g_f_pa8_button_up = false

◆ g_rng_engine

std::default_random_engine g_rng_engine

◆ g_rtc_flag

volatile bool g_rtc_flag = false

◆ g_scheduler

Scheduler g_scheduler = { 0 }