Image scroll Sample. This program uses GraphicsFramework library and Si1143 sensor.
Dependencies: GR-PEACH_video GraphicsFramework R_BSP SI1143 mbed-rtos mbed
Fork of RGA_HelloWorld by
About Si1143
Si1143 is a gesture sensor and can be controlled by using the I2C.
This can be detected from the shortest 1cm up to 200cm.
Si1143 emits three infrared LED that is mounted on a substrate, and detects the movement by measuring the reflected light from the external object.
- Datasheet of Si1143
http://www.silabs.com/Support%20Documents/TechnicalDocs/Si114x.pdf
About wiring
| VDD | 3.3V |
| SCL | D15 |
| SDA | D14 |
| GND | GND |
Diff: rga_func.h
- Revision:
- 4:2318f8bee89c
- Parent:
- 3:841987280a7f
--- a/rga_func.h Thu Jan 21 10:21:28 2016 +0000
+++ b/rga_func.h Mon May 30 04:55:35 2016 +0000
@@ -23,41 +23,25 @@
#include "RGA.h"
-typedef struct {
- char * style;
- int x;
- int y;
- int w;
- int h;
-} draw_rectangle_pos_t;
-
#define IMG_DRAW_WIDTH (241)
#define IMG_DRAW_HEIGHT (180)
#define IMAGE_WIDTH_SCROLL_FUNC (352) // Image width of Scroll function
#define IMAGE_HEIGHT_SCROLL_FUNC (233) // Image height of Scroll function
-#define IMAGE_WIDTH_ZOOM_FUNC (352) // Image width of Zoom function
-#define IMAGE_HEIGHT_ZOOM_FUNC (233) // Image height of Zoom function
+
+#define SCROLL_STEP_NUM (30) // minimum 1
-#define DISSOLVE_MAX_NUM (256)
-#define SCROLL_MAX_NUM (IMAGE_WIDTH_SCROLL_FUNC - IMG_DRAW_WIDTH)
-#define ZOOM_MAX_NUM (IMAGE_HEIGHT_ZOOM_FUNC / 2)
-#define ROTATION_MAX_NUM (360)
-#define ACCELERATE_MAX_NUM (256)
+enum {
+ DIREC_NON,
+ DIREC_UP,
+ DIREC_DOWN,
+ DIREC_LEFT,
+ DIREC_RIGHT
+};
-#define ANIMATION_TIMING_EASE (0)
-#define ANIMATION_TIMING_LINEAR (1)
-#define ANIMATION_TIMING_EASE_IN (2)
-#define ANIMATION_TIMING_EASE_OUT (3)
-#define ANIMATION_TIMING_EASE_IN_OUT (4)
extern void Set_RGAObject(frame_buffer_t* frmbuf_info);
-extern void RGA_Func_DrawTopScreen(frame_buffer_t* frmbuf_info);
-extern void RGA_Func_DrawRectangle(frame_buffer_t* frmbuf_info, draw_rectangle_pos_t * pos, int pos_num);
-extern void RGA_Func_DrawImage(frame_buffer_t* frmbuf_info, int x, int y);
-extern void RGA_Func_Dissolve(frame_buffer_t* frmbuf_info, float32_t global_alpha);
-extern void RGA_Func_Scroll(frame_buffer_t* frmbuf_info, int src_width_pos);
-extern void RGA_Func_Zoom(frame_buffer_t* frmbuf_info, int src_height_pos);
-extern void RGA_Func_Rotation(frame_buffer_t* frmbuf_info, graphics_matrix_float_t image_angle);
-extern void RGA_Func_Accelerate(frame_buffer_t* frmbuf_info, int animation_timing, float32_t relative_pos);
+void RGA_Func_DrawTopScreen(frame_buffer_t* frmbuf_info, const graphics_image_t* image);
+void RGA_Func_Scroll(frame_buffer_t* frmbuf_info, const graphics_image_t* image_old, const graphics_image_t* image_new,
+ int direction, float32_t scroll);
#endif
