-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
35 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,13 @@ | ||
/* mruby/c VM */ | ||
#include <mrubyc.h> | ||
#ifndef WS2812_DEFINED_H_ | ||
#define WS2812_DEFINED_H_ | ||
|
||
void c_ws2812_init(mrb_vm *vm, mrb_value *v, int argc); | ||
void c_ws2812_show(mrb_vm *vm, mrb_value *v, int argc); | ||
void c_ws2812_fill(mrb_vm *vm, mrb_value *v, int argc); | ||
void c_ws2812_rand_show(mrb_vm *vm, mrb_value *v, int argc); | ||
void c_ws2812_set_pixel_at(mrb_vm *vm, mrb_value *v, int argc); | ||
void c_ws2812_rotate_swirl(mrb_vm *vm, mrb_value *v, int argc); | ||
void c_ws2812_reset_swirl_index(mrb_vm *vm, mrb_value *v, int argc); | ||
void c_ws2812_circle(mrb_vm *vm, mrb_value *v, int argc); | ||
void c_ws2812_add_matrix_pixel_at(mrb_vm *vm, mrb_value *v, int argc); | ||
void c_ws2812_init_pixel_distance(mrb_vm *vm, mrb_value *v, int argc); | ||
void c_ws2812_circle_set_center(mrb_vm *vm, mrb_value *v, int argc); | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define WS2812_INIT() do { \ | ||
mrbc_class *mrbc_class_RGB = mrbc_define_class(0, "RGB", mrbc_class_object); \ | ||
mrbc_define_method(0, mrbc_class_RGB, "ws2812_init", c_ws2812_init); \ | ||
mrbc_define_method(0, mrbc_class_RGB, "ws2812_show", c_ws2812_show); \ | ||
mrbc_define_method(0, mrbc_class_RGB, "ws2812_fill", c_ws2812_fill); \ | ||
mrbc_define_method(0, mrbc_class_RGB, "ws2812_rand_show", c_ws2812_rand_show); \ | ||
mrbc_define_method(0, mrbc_class_RGB, "ws2812_set_pixel_at", c_ws2812_set_pixel_at); \ | ||
mrbc_define_method(0, mrbc_class_RGB, "ws2812_rotate_swirl", c_ws2812_rotate_swirl); \ | ||
mrbc_define_method(0, mrbc_class_RGB, "ws2812_reset_swirl_index", c_ws2812_reset_swirl_index); \ | ||
mrbc_define_method(0, mrbc_class_RGB, "ws2812_add_matrix_pixel_at", c_ws2812_add_matrix_pixel_at); \ | ||
mrbc_define_method(0, mrbc_class_RGB, "ws2812_init_pixel_distance", c_ws2812_init_pixel_distance); \ | ||
mrbc_define_method(0, mrbc_class_RGB, "ws2812_circle", c_ws2812_circle); \ | ||
mrbc_define_method(0, mrbc_class_RGB, "ws2812_circle_set_center", c_ws2812_circle_set_center); \ | ||
} while (0) | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* WS2812_DEFINED_H_ */ | ||
|
Submodule picoruby
updated
2 files
+19 −0 | mrbgems/picoruby-prk-rgb/include/prk-rgb.h | |
+266 −0 | mrbgems/picoruby-prk-rgb/src/prk-rgb.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters