summaryrefslogtreecommitdiff
path: root/raspberrypi/test/test.c
diff options
context:
space:
mode:
authorDave2013-03-04 22:28:03 +0100
committernotaz2013-03-07 23:16:38 +0200
commitffa573f88020e4de9300a013721068672c923f33 (patch)
tree48bdc5b166e0211b24155b77fe28075e3c258135 /raspberrypi/test/test.c
parent6a298de4811066eb3cd2fadfd78970281ed30074 (diff)
downloadpicogpsp-ffa573f88020e4de9300a013721068672c923f33.tar.gz
picogpsp-ffa573f88020e4de9300a013721068672c923f33.tar.bz2
picogpsp-ffa573f88020e4de9300a013721068672c923f33.zip
raspberry pi port
Diffstat (limited to 'raspberrypi/test/test.c')
-rw-r--r--raspberrypi/test/test.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/raspberrypi/test/test.c b/raspberrypi/test/test.c
new file mode 100644
index 0000000..17e3d13
--- /dev/null
+++ b/raspberrypi/test/test.c
@@ -0,0 +1,48 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+
+#define RGB15(r, g, b) (((r) << (5+6)) | ((g) << 6) | (b))
+
+void video_init(uint32_t width,uint32_t height, uint32_t f);
+void video_close();
+void video_draw(uint16_t *pixels);
+
+
+
+void showbitmap( uint32_t wd, uint32_t ht, uint32_t f) {
+int index;
+uint16_t j,k;
+uint8_t r,g,b;
+uint16_t * bitmap;
+
+ bitmap=malloc(wd*ht*sizeof(uint16_t));
+
+ b=16;
+ index=0;
+ for (j=0;j<ht;j++) {
+ r=(j*31)/(ht-1);
+ for (k=0; k<wd ; k++) {
+ g=(k*31)/(wd-1);
+ bitmap[index++]=RGB15(r,g,b);
+ }
+ }
+bitmap[0]=0;
+
+video_init(wd,ht,f);
+video_draw(bitmap);
+sleep(5);
+video_close();
+free(bitmap);
+}
+
+int main(void) {
+
+showbitmap( 320, 240,0);
+showbitmap( 320, 240,1);
+showbitmap( 320, 240,2);
+showbitmap( 240, 160,0);
+showbitmap( 400, 272,0);
+
+return 0;
+} \ No newline at end of file