From cf5e6acc9abbad7e883fb8b726304351732a7786 Mon Sep 17 00:00:00 2001 From: ayabusa Date: Thu, 25 Apr 2024 17:52:09 +0200 Subject: [PATCH] implemented some stuff for LCD, for now the screen is set OFF --- build/Laplace/lcd.o | Bin 2280 -> 5400 bytes build/main.bin | Bin 68049 -> 68519 bytes build/main.elf | Bin 281772 -> 283740 bytes src/Laplace/lcd.c | 48 +++++++++++++++++++++++++++++++++++++------- src/Laplace/lcd.h | 16 +++++++++++++-- 5 files changed, 55 insertions(+), 9 deletions(-) diff --git a/build/Laplace/lcd.o b/build/Laplace/lcd.o index f583644228b579c43d8d00757e53ca7afed7529b..edcc1e9be6be349908b6fa10d8dc5ec1598ffca5 100644 GIT binary patch literal 5400 zcma)AZERcB8Gf&?ukFN%W5;Qlj}}Y`5NQ38G;L@@O5LPsKASEnj1)He#=eQo{5AW! zq?C#bs!`Sstpja{cKnz$35jW|*pSc|YLO-(@n_Y9CQX|(Z9gU?CdMYVp+%#6-gD1Q zZVE^{>ABB&pZDW@-uGPh$-~oQilUHR6zZi7iRgMrXtV(Vy|jheX!Z58SLmk)|FLg= zE!`Wr@$XM>cqfOpfA@Wro<<$o{yd({($(PLTVtzl`QU5$42=nkG23F7@ILsjUxnAc zvG(lG{`vT9@739lA0N5&TGtrerj9$K&{ZD7>d&7>-|E=f>g-3?4y~OFuhP{f^zxNY z+@~u?Hni@^n|18(O0T~D6#T7m>=nI}c-|wPL+831FTK_=#{CYR`~7Qn`%MS`ri0%p zyiPl`rybfg2fyav>8ekxi#6Jnw0~@^5*`~`-9B|Gw{41cyp-;qdMVd6(KQtwIiK#D zdN|h!_C$K?)QQ~Cx%P?h$W*!wwqar03ft4UAlUQimZ|PsVDk2lsTNMJtpFO*Eisx&vbGfu`2DkPwgHK~Wm*U$FGj)KezRm?u?s4W_-YMqim>=l;I`e7f-QEk} zT|V!J0L`uCOD2E?CzXZ|VC5Z|BXwE{70@Q%dmL!SlHA^7N$8GRlF#=H>t-#f z$=8nF)MJ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m@3oc*pFwV z%KV7IGQ|Yl_c-i#6$rUI89bptBFBA+(US^A+|vwJC{XAg<*`>Pfc9r*l>+_Uz6@#< z80h*L)MmVh;)l3V&q9c4Uh8OQ$JMh%cIPzoxjnl6<$xtDck(^ja!4hp^)X2CyFfK4Q5Z1EHSVT^W zV){o3PdhbRkH}De?CL)#q^YvDh~~`gWyhu4dmzz8=fR>xqWDtfJD0dH};v%tP z$R93n37^hM=lProK5c@I-Yq4m&$DEEDZQrG+sSQr(nL*fwUbwd(RGqlcTtwR z@Oz8baFm7BtE$&Ye;GY%tw+-iziVOgg);huPtKe`Ims~-XoptF3$q)G>`hHPgPzsm z8KJmqRmcMqsd&JDz5d^S;p6^OU8$-OU4&qRg6l_ z?P!a7TfP#bzDnL>%MW8T!nE-ww%SsUL(ekWc#tQrab#7Tp3ma%K8D0(p>J@tIPzMY z&SmkJLn)xog>c+SUYtaK(e!t5Y$~U>D{7$R5>rN|crzuaUlN~pGS5YNd=`XLJuvfU zRrW!+Ky|KsF0wp?Gikb60|X z!Njp1cnk24Fd&~b*nb=Fmz3Iy8Ser9rHD81=AI=Irf7n2%!oH^Pdgk3?ykrYmx1~G zj15L5&<4!^1pp#pTYLk|C-)Q%2n(J14Vr-85gsrX7og^KZ622?Y!8Mu2% zKJWYuu;3>mLlG+?9@Ex5@A|m_Dp?;CG`1dEH IM>d}Lf96rjd;kCd diff --git a/src/Laplace/lcd.c b/src/Laplace/lcd.c index dfa300d..831b889 100644 --- a/src/Laplace/lcd.c +++ b/src/Laplace/lcd.c @@ -1,15 +1,24 @@ #include "lcd.h" +uint16_t volatile * const COMMAND_ADDRESS = (uint16_t *) 0x60000000; +uint16_t volatile * const DATA_ADDRESS = (uint16_t *) 0x60020000; + /* This should be called before accessing any other led related feature as it sets up all led related peripherals */ void lcd_init(){ int _var = 1336+1; + send_command(DISPLAY_OFF); //init_DMA(); - draw_screen(); + struct LCD_rectangle r = {50,50,100,100}; + draw_color_rectangle(r); } -void draw_screen(){ - +void draw_color_rectangle(struct LCD_rectangle r){ + set_drawing_area(r); + send_command(MEMORY_WRITE); + static uint16_t purple_color = (uint16_t)0b1111110000000011010000000000000000000011; + uint16_t numberOfPixels = 50*50; + start_DMA_upload(&purple_color, false, (numberOfPixels > 64000 ? 64000 : numberOfPixels)); } // send command to the LCD @@ -23,19 +32,44 @@ void send_data(uint16_t data){ } // we assume orientations is portrait -void set_drawing_area(r/*TODO*/){ +void set_drawing_area(struct LCD_rectangle r){ send_command(MEMORY_ACCESS_CONTROL); send_data(0x00); send_command(COLUMN_ADDRESS_SET); - send_data(); + send_data((r.x_start >> 8)); + send_data((r.x_start & 0xFF)); + send_data((r.x_end >> 8)); + send_data((r.x_end & 0xFF)); send_command(PAGE_ADDRESS_SET); - send_data(); + send_data((r.y_start >> 8)); + send_data((r.y_start & 0xFF)); + send_data((r.y_end >> 8)); + send_data((r.y_end & 0xFF)); } -void start_DMA_upload(){ +void start_DMA_upload(uint16_t * src, bool incrementSrc, uint16_t length){ + // clear + DMA2->LIFCR &= ~(0b11111111111111111111111111111111); + // value from upsilon + DMA2->LIFCR |= 0b00001111011111010000111101111101; + // set the length + DMA2_Stream0->NDTR &= ~(0b11111111111111111111111111111111); + DMA2_Stream0->NDTR |= length; + + // set the memory location of the color/pixels + DMA2_Stream0->PAR &= ~(0b11111111111111111111111111111111); + DMA2_Stream0->PAR |= (uint32_t)src; + + // set PINC + DMA2_Stream0->CR &= ~(0b00000000000000000000001000000000); + if(incrementSrc){ + DMA2_Stream0->CR |= 0b00000000000000000000001000000000; + } + // set EN + DMA2_Stream0->CR |= 0b00000000000000000000000000000001; } /*void init_DMA(){ diff --git a/src/Laplace/lcd.h b/src/Laplace/lcd.h index d148df7..c117c51 100644 --- a/src/Laplace/lcd.h +++ b/src/Laplace/lcd.h @@ -8,10 +8,9 @@ #define LCD_H #include +#include #include "../device/stm32f730xx.h" -uint16_t volatile * const COMMAND_ADDRESS = (uint16_t *) 0x60000000; -uint16_t volatile * const DATA_ADDRESS = (uint16_t *) 0x60020000; // to set them use : *COMMAND_ADDRESS = 0x1234; // define the differents command @@ -35,6 +34,19 @@ uint16_t volatile * const DATA_ADDRESS = (uint16_t *) 0x60020000; #define POSITIVE_VOLTAGE_GAMMA_CONTROL 0xE0 #define NEGATIVE_VOLTAGE_GAMMA_CONTROL 0xE1 +// rectangle frame from the LCD +struct LCD_rectangle { + uint16_t x_start; + uint16_t y_start; + uint16_t x_end; + uint16_t y_end; +}; + void lcd_init(); +void draw_color_rectangle(struct LCD_rectangle r); +void send_command(uint16_t command); +void send_data(uint16_t data); +void set_drawing_area(struct LCD_rectangle r); +void start_DMA_upload(uint16_t * src, bool incrementSrc, uint16_t length); #endif \ No newline at end of file