first commit
This commit is contained in:
commit
c591b2c272
50 changed files with 2650 additions and 0 deletions
123
Wrapper-Project/src/library/arduboy/arduboy.cpp
Normal file
123
Wrapper-Project/src/library/arduboy/arduboy.cpp
Normal file
|
@ -0,0 +1,123 @@
|
|||
#include "arduboy.h"
|
||||
extern Arduboy2 arduboy;
|
||||
|
||||
void arduboy_begin(void)
|
||||
{
|
||||
arduboy.begin();
|
||||
}
|
||||
void arduboy_clear(void)
|
||||
{
|
||||
arduboy.clear();
|
||||
}
|
||||
void arduboy_display(void)
|
||||
{
|
||||
arduboy.display();
|
||||
}
|
||||
void arduboy_display_and_clear_buffer(void)
|
||||
{
|
||||
arduboy.display(CLEAR_BUFFER);
|
||||
}
|
||||
void arduboy_draw_fast_hline(int16_t x, int16_t y, uint8_t w, uint8_t color)
|
||||
{
|
||||
arduboy.drawFastHLine(x, y, w, color);
|
||||
}
|
||||
void arduboy_draw_fast_vline(int16_t x, int16_t y, uint8_t h, uint8_t color)
|
||||
{
|
||||
arduboy.drawFastVLine(x, y, h, color);
|
||||
}
|
||||
void arduboy_draw_pixel(int16_t x, int16_t y, uint8_t color)
|
||||
{
|
||||
arduboy.drawPixel(x, y, color);
|
||||
}
|
||||
void arduboy_draw_circle(int16_t x, int16_t y, uint8_t r, uint8_t color)
|
||||
{
|
||||
arduboy.drawCircle(x, y, r, color);
|
||||
}
|
||||
void arduboy_fill_circle(int16_t x, int16_t y, uint8_t r, uint8_t color)
|
||||
{
|
||||
arduboy.fillCircle(x, y, r, color);
|
||||
}
|
||||
void arduboy_fill_rect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color)
|
||||
{
|
||||
arduboy.fillRect(x, y, w, h, color);
|
||||
}
|
||||
unsigned long arduboy_generate_random_seed()
|
||||
{
|
||||
return arduboy.generateRandomSeed();
|
||||
}
|
||||
uint8_t arduboy_get_pixel(uint8_t x, uint8_t y)
|
||||
{
|
||||
return arduboy.getPixel(x, y);
|
||||
}
|
||||
void arduboy_init_random_seed(void)
|
||||
{
|
||||
arduboy.initRandomSeed();
|
||||
}
|
||||
bool arduboy_just_pressed(uint8_t button)
|
||||
{
|
||||
return arduboy.justPressed(button);
|
||||
}
|
||||
bool arduboy_just_released(uint8_t button)
|
||||
{
|
||||
return arduboy.justReleased(button);
|
||||
}
|
||||
bool arduboy_next_frame(void)
|
||||
{
|
||||
return arduboy.nextFrame();
|
||||
}
|
||||
void arduboy_poll_buttons()
|
||||
{
|
||||
arduboy.pollButtons();
|
||||
}
|
||||
bool arduboy_pressed(uint8_t buttons)
|
||||
{
|
||||
return arduboy.pressed(buttons);
|
||||
}
|
||||
void arduboy_print_chars(const char *cstr)
|
||||
{
|
||||
arduboy.print(cstr);
|
||||
}
|
||||
size_t arduboy_print_char(char c)
|
||||
{
|
||||
return arduboy.print(c);
|
||||
}
|
||||
size_t arduboy_print_int(int n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
size_t arduboy_print_long(long n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
size_t arduboy_print_unsigned_char(unsigned char n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
size_t arduboy_print_unsigned_int(unsigned int n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
size_t arduboy_print_unsigned_long(unsigned long n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
void arduboy_set_cursor(int16_t x, int16_t y)
|
||||
{
|
||||
arduboy.setCursor(x, y);
|
||||
}
|
||||
void arduboy_set_frame_rate(uint8_t rate)
|
||||
{
|
||||
arduboy.setFrameRate(rate);
|
||||
}
|
||||
bool arduboy_not_pressed(uint8_t button)
|
||||
{
|
||||
arduboy.notPressed(button);
|
||||
}
|
||||
void arduboy_set_text_size(uint8_t s)
|
||||
{
|
||||
arduboy.setTextSize(s);
|
||||
}
|
||||
void arduboy_invert(bool inverse)
|
||||
{
|
||||
arduboy.invert(inverse);
|
||||
}
|
36
Wrapper-Project/src/library/arduboy/arduboy.h
Normal file
36
Wrapper-Project/src/library/arduboy/arduboy.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
#pragma once
|
||||
#include <Arduboy2.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void arduboy_begin(void);
|
||||
void arduboy_clear(void);
|
||||
void arduboy_display(void);
|
||||
void arduboy_display_and_clear_buffer(void);
|
||||
void arduboy_draw_fast_hline(int16_t x, int16_t y, uint8_t w, uint8_t color);
|
||||
void arduboy_draw_fast_vline(int16_t x, int16_t y, uint8_t h, uint8_t color);
|
||||
void arduboy_draw_pixel(int16_t x, int16_t y, uint8_t color);
|
||||
void arduboy_draw_circle(int16_t x, int16_t y, uint8_t r, uint8_t color);
|
||||
void arduboy_fill_circle(int16_t x, int16_t y, uint8_t r, uint8_t color);
|
||||
void arduboy_fill_rect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color);
|
||||
unsigned long arduboy_generate_random_seed();
|
||||
uint8_t arduboy_get_pixel(uint8_t x, uint8_t y);
|
||||
void arduboy_init_random_seed(void);
|
||||
bool arduboy_just_pressed(uint8_t button);
|
||||
bool arduboy_just_released(uint8_t button);
|
||||
bool arduboy_next_frame(void);
|
||||
void arduboy_poll_buttons();
|
||||
bool arduboy_pressed(uint8_t buttons);
|
||||
void arduboy_print_chars(const char *cstr);
|
||||
size_t arduboy_print_char(char c);
|
||||
size_t arduboy_print_int(int n, int base);
|
||||
size_t arduboy_print_long(long n, int base);
|
||||
size_t arduboy_print_unsigned_char(unsigned char n, int base);
|
||||
size_t arduboy_print_unsigned_int(unsigned int n, int base);
|
||||
size_t arduboy_print_unsigned_long(unsigned long n, int base);
|
||||
void arduboy_set_cursor(int16_t x, int16_t y);
|
||||
void arduboy_set_frame_rate(uint8_t rate);
|
||||
bool arduboy_not_pressed(uint8_t button);
|
||||
void arduboy_set_text_size(uint8_t s);
|
||||
void arduboy_invert(bool inverse);
|
||||
}
|
46
Wrapper-Project/src/library/arduboy/arduboy_tones.cpp
Normal file
46
Wrapper-Project/src/library/arduboy/arduboy_tones.cpp
Normal file
|
@ -0,0 +1,46 @@
|
|||
#include "arduboy_tones.h"
|
||||
|
||||
void arduboy_audio_on()
|
||||
{
|
||||
arduboy.audio.on();
|
||||
}
|
||||
void arduboy_audio_off()
|
||||
{
|
||||
arduboy.audio.off();
|
||||
}
|
||||
bool arduboy_audio_enabled()
|
||||
{
|
||||
return arduboy.audio.enabled();
|
||||
}
|
||||
void sound_tone(unsigned int frequency, unsigned long duration)
|
||||
{
|
||||
sound.tone(frequency, duration);
|
||||
}
|
||||
void sound_tone2(unsigned int frequency1, unsigned long duration1, unsigned int frequency2, unsigned long duration2)
|
||||
{
|
||||
sound.tone(frequency1, duration1, frequency2, duration2);
|
||||
}
|
||||
void sound_tone3(unsigned int frequency1, unsigned long duration1, unsigned int frequency2, unsigned long duration2, unsigned int frequency3, unsigned long duration3)
|
||||
{
|
||||
sound.tone(frequency1, duration1, frequency2, duration2, frequency3, duration3);
|
||||
}
|
||||
void sound_tones(const uint16_t *tones)
|
||||
{
|
||||
sound.tones(tones);
|
||||
}
|
||||
void sound_no_tone()
|
||||
{
|
||||
sound.noTone();
|
||||
}
|
||||
bool sound_playing()
|
||||
{
|
||||
sound.playing();
|
||||
}
|
||||
void sound_tones_in_ram(uint16_t *tones)
|
||||
{
|
||||
sound.tonesInRAM(tones);
|
||||
}
|
||||
void sound_volume_mode(uint8_t mode)
|
||||
{
|
||||
sound.volumeMode(mode);
|
||||
}
|
21
Wrapper-Project/src/library/arduboy/arduboy_tones.h
Normal file
21
Wrapper-Project/src/library/arduboy/arduboy_tones.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
|
||||
#include <ArduboyTones.h>
|
||||
#include <Arduboy2.h>
|
||||
extern ArduboyTones sound;
|
||||
extern Arduboy2 arduboy;
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void arduboy_audio_on();
|
||||
void arduboy_audio_off();
|
||||
bool arduboy_audio_enabled();
|
||||
void sound_tone(unsigned int frequency, unsigned long duration);
|
||||
void sound_tone2(unsigned int frequency1, unsigned long duration1, unsigned int frequency2, unsigned long duration2);
|
||||
void sound_tone3(unsigned int frequency1, unsigned long duration1, unsigned int frequency2, unsigned long duration2, unsigned int frequency3, unsigned long duration3);
|
||||
void sound_tones(const uint16_t *tones);
|
||||
void sound_no_tone();
|
||||
bool sound_playing();
|
||||
void sound_tones_in_ram(uint16_t *tones);
|
||||
void sound_volume_mode(uint8_t mode);
|
||||
}
|
6
Wrapper-Project/src/library/arduboy/sprites.cpp
Normal file
6
Wrapper-Project/src/library/arduboy/sprites.cpp
Normal file
|
@ -0,0 +1,6 @@
|
|||
#include "sprites.h"
|
||||
|
||||
void arduino_draw_override(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame)
|
||||
{
|
||||
Sprites::drawOverwrite(x, y, bitmap, frame);
|
||||
}
|
7
Wrapper-Project/src/library/arduboy/sprites.h
Normal file
7
Wrapper-Project/src/library/arduboy/sprites.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
#pragma once
|
||||
#include <Sprites.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void arduino_draw_override(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue