summaryrefslogtreecommitdiffhomepage
path: root/digital/lcd/src/lcd.hh
diff options
context:
space:
mode:
authorGuillaume Milan2013-05-10 00:20:31 +0200
committerNicolas Schodet2013-05-10 21:53:11 +0200
commit04b3d6d78ab60ab7c15dd9affbef521acf584f1f (patch)
tree22b2e105dbb8ba68d02aafe617fd2249b65e032e /digital/lcd/src/lcd.hh
parent7dd87831f7847fe3c52ece09b3f32429bdbaf41e (diff)
digital/lcd/src: give to the user some information of the robot status
Give the color, the remaining time, the robot position, the robot destination.
Diffstat (limited to 'digital/lcd/src/lcd.hh')
-rw-r--r--digital/lcd/src/lcd.hh21
1 files changed, 20 insertions, 1 deletions
diff --git a/digital/lcd/src/lcd.hh b/digital/lcd/src/lcd.hh
index e054c2e5..5540c179 100644
--- a/digital/lcd/src/lcd.hh
+++ b/digital/lcd/src/lcd.hh
@@ -27,6 +27,13 @@
#include "ucoolib/hal/gpio/gpio.hh"
/// Control LCD.
+
+struct Rect
+{
+ int x;
+ int y;
+};
+
class LCD
{
public:
@@ -47,6 +54,18 @@ class LCD
{
return (r >> 3 << 11) | (g >> 2 << 5) | (b >> 3);
}
+ ///draw a pixel if he belong to the screen
+ void blit_pixel ( uint16_t color , int x , int y);
+ ///make a border of a rectangle
+ void rectangle_empty (uint16_t color,Rect format, Rect pos);
+ ///make a filled rectangle with one color
+ void rectangle_fill (uint16_t color,Rect format, Rect pos);
+ ///draw a circle
+ void circle ( uint16_t color , int radius , Rect pos); //position of the center of the circle
+ ///write a caracter
+ void draw_char( uint16_t color ,char caract, Rect pos);
+ ///write a sentence center on pos
+ void draw_sentence( uint16_t color ,const char *sentence, Rect pos);
private:
void set_cursor (int x, int y);
void write_index (uint16_t index);
@@ -54,8 +73,8 @@ class LCD
uint16_t read_data ();
void write_reg (uint16_t index, uint16_t data);
uint16_t read_reg (uint16_t index);
+ int belong ( int x, int y); //does the point belong to the screen?
private:
ucoo::Gpio cs_, rs_, wr_, rd_, reset_, bl_;
};
-
#endif // lcd_hh