raspi_lcd 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/ext/raspi_lcd/raspi_lcd.c +47 -0
  2. metadata +2 -2
@@ -109,6 +109,45 @@ static VALUE r_LCD_WriteFramebuffer(VALUE self)
109
109
  return Qnil;
110
110
  }
111
111
 
112
+ static VALUE r_RaspiLcdHwInit(VALUE self)
113
+ {
114
+ int i;
115
+ i = RaspiLcdHwInit();
116
+ return INT2FIX(i);
117
+ }
118
+
119
+ static VALUE r_UpdateButtons(VALUE self)
120
+ {
121
+ UpdateButtons();
122
+ return Qnil;
123
+ }
124
+
125
+ static VALUE r_GetRaspberryHwRevision(VALUE self)
126
+ {
127
+ int r;
128
+ r = GetRaspberryHwRevision();
129
+ return INT2FIX(r);
130
+ }
131
+
132
+ static VALUE r_SpiPutc(VALUE self, VALUE d)
133
+ {
134
+ SpiPutc(NUM2CHR(d));
135
+ return Qnil;
136
+ }
137
+
138
+ static VALUE r_SetBacklight(VALUE self, VALUE light)
139
+ {
140
+ SetBacklight(FIX2INT(light));
141
+ return Qnil;
142
+ }
143
+
144
+ static VALUE r_SleepMs(VALUE self, VALUE ms)
145
+ {
146
+ SleepMs(FIX2INT(ms));
147
+ return Qnil;
148
+ }
149
+
150
+
112
151
 
113
152
 
114
153
  /*
@@ -133,5 +172,13 @@ void Init_raspi_lcd() {
133
172
 
134
173
  rb_define_module_function(m,"init",r_LCD_Init, 0);
135
174
  rb_define_module_function(m,"write_framebuffer",r_LCD_WriteFramebuffer, 0);
175
+ rb_define_module_function(m,"raspi_lcd_hw_init",r_RaspiLcdHwInit, 0);
176
+ rb_define_module_function(m,"update_buttons",r_UpdateButtons, 0);
177
+ rb_define_module_function(m,"get_raspberry_hw_revision",r_GetRaspberryHwRevision, 0);
178
+ rb_define_module_function(m,"spi_putc",r_SpiPutc, 1);
179
+ rb_define_module_function(m,"set_backlight",r_SetBacklight, 1);
180
+ rb_define_module_function(m,"sleep_ms",r_SleepMs, 1);
181
+
182
+
136
183
  }
137
184
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raspi_lcd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-03 00:00:00.000000000 Z
12
+ date: 2013-05-13 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Ruby bindings for the Raspberry Pi LCD interface
15
15
  email: till@communtu.org