Recent Posts

Pages: [1] 2 3 ... 10
1
ARM Processors / Re: Getting started with TouchGFX || STM32F750
« Last post by tha on May 25, 2023, 11:54:54 am »
<a href="https://www.youtube.com/v/Y7d6-59YQu8" target="_blank" class="new_win">https://www.youtube.com/v/Y7d6-59YQu8</a>
2
ARM Processors / Re: Getting started with TouchGFX || STM32F750
« Last post by tha on May 25, 2023, 11:52:56 am »
                                                                                 Result

ข้างล่างคือ the gifs ที่แสดง the results.



คุณจะเห็น the UI แสดง the Light ถูก turned on เมื่อไรก็ตามที่ the button ถูกกด.



นอกจากนี้ the ADC values กำลังอัฟเดตเมื่อ the potentiometer ถูกหมุน.
3
ARM Processors / Re: Getting started with TouchGFX || STM32F750
« Last post by tha on May 25, 2023, 11:44:40 am »
ข้างล่างคือ the view source file.



•   The setLight function จะเซ็ต the visibility ของ the lightON image. The visibility จะเปลี่ยนขึ้นอยู่กับ the data ที่รับจาก
     the presenter.
•   หลังจากการเปลี่ยน the visibility, เราต้อง invalidate the image เพื่อให้การเปลี่ยนมีผล.
•   ก่อนอื่น The setADC function จะแปลงค่า, ที่รับจาก the presenter, ไปเป็น the characters.
•   เราจะ invalidate the textArea อีกครั้งเพื่อให้ค่าเหล่านี้ถูกแสดงบน the UI.

โปรดทราบว่าฟังชั่นเหล่านี้ต้องถูกกำหนดไว้ก่อนแล้วใน the Screen1View header file.
4
ARM Processors / Re: Getting started with TouchGFX || STM32F750
« Last post by tha on May 25, 2023, 11:17:58 am »
ข้างล่างคือ the presenter source file, ซึ่งจะรับ the data จาก the model.



ที่นี่ the functions setLight และ setADC ถูกเรียกโดย the modelListener. The presenter เรียก the same functions ใน the view และส่งผ่าน the data ที่รับจาก the model ไปยัง the view.

โปรดทราบว่าฟังชั่นเหล่านี้ต้องถูกกำหนดใน the presenter header files ด้วย.
5
ARM Processors / Re: Getting started with TouchGFX || STM32F750
« Last post by tha on May 25, 2023, 11:08:36 am »
เราจะใช้ the MVP design pattern เพื่อส่ง the data ไปยัง the UI. The design ถูกแสดงข้างล่าง.



•   The model อย่างใดอย่างหนึง สุ่มตัวอย่าง the data จาก the backend module, หรือรับ data นี้ผ่านทาง task อื่น.
•   The model ส่ง the data ไปยัง the presenter.
•   The presenter ส่ง data นี้ต่อไปไปยัง the view.
•   The view อัฟเดต the data บน the UI.
6
ARM Processors / Re: Getting started with TouchGFX || STM32F750
« Last post by tha on May 25, 2023, 10:32:34 am »
                                                                             Some Insight into the code

ดังที่ฉันได้กล่าวถึงในบทช่วยสอนนี้ เราจะสุ่มตัวอย่างจาก the GUI task ของมันเอง, ตัวอย่างเช่น การสุ่มตัวอย่างภายใน the Model::tick() function. The model source file ถูกแสดงไว้ข้างล่าง.



•   ฉันได้รวมบาง definition จาก line 2-11.
        •   The main.h บรรจุ the necessary headers ทั้งหมดสำหรับส่วนประกอบที่เราใช้ใน project นี้.
        •   ฉันได้กำหนด the ADC handler, ADC_HandleTypeDef hadc3, สำหรับให้ the ADC ทำงาน.
        •   นอกจากนี้ยังมี a map function (จาก Arduino source code), ดังนั้นเพื่อแมป the ADC values ภายในช่วงที่กำหนด.
•   Line no 13 เริ่มต้นตัวแปร Button_State และ ADC_VAL, ซึ่งถูกประกาศไว้ใน the model header file.
•   Lines 21-25 ถูกใช้เพื่ออ่าน the button state.
        •   ถ้า the button ถูกกด, ตัวแปรนี้จะถูกเซ็ตเป็น true และถ้า the button ถูกปล่อย, ตัวแปรนี้จะถูกเซ็ตเป็น false.
•   Lines 27-31 ถูกใช้เพื่ออ่าน  the ADC values จาก the potentiometer.
        •   ที่นี่ฉันใช้ the Poll method เพื่ออ่าน the values.
        •   จากนั้น The 12 bit ADC values จะถูกแม็ปกับช่วง 0 ถึง 100. ค่าที่ถูกแปลงเหล่านี้จะถูกเก็บไว้ใน the ADC_VAL variable.
•   Lines 34 and 35 ถูกใช้เพื่อส่ง the button state และ the ADC values ไปยัง the presenter.
        •   The modelListener คือ the pointer ไปยัง the active presenter และถูกใช้เพื่อส่ง the data ไปยัง the presenter
7
ARM Processors / Re: Getting started with TouchGFX || STM32F750
« Last post by tha on May 25, 2023, 09:24:12 am »
ฉันจะแสดง the potentiometer values บน the UI. This potentiometer ถูกต่อทาง the ADC.



The ADC3 channel 0 ได้รับการกำหนดค่าด้วยความละเอียด 12 บิต. ทุกสิ่งทุกอย่างจะถูกเก็บไว้เป็นค่าเริ่มต้นใน the ADC configuration. เราจะใช้ the poll method เพื่ออ่าน the ADC values.
8
ARM Processors / Re: Getting started with TouchGFX || STM32F750
« Last post by tha on May 25, 2023, 09:11:59 am »
                                                                                     CubeMX Setup

The F750 discovery board มี a user button, ซึ่งถูกต่อกับ the pin PI11. ฉันได้เปิดใช้งาน the pin PI11 เป็น the input pin.



The pin ถูกกำหนดค่าใน the input mode พร้อมกับ the pull down. เมื่อ the button ถูกกด pin นี้จะถูก pulled high.
9
ARM Processors / Re: Getting started with TouchGFX || STM32F750
« Last post by tha on May 24, 2023, 04:12:46 pm »
                                                                                    TouchGFX Setup



ดังที่แสดงไว้ด้านบน, ฉันได้เพิ่ม an image icon ที่แสดงว่า the light ปิด(OFF) อยู่. The image name ถูกเปลี่ยนเป็น lightOFF ด้วย. โปรดทราบว่า the visibility ถูกเปิดใช้งานสำหรับ image นี้ด้วย.



มีอีกหนึ่ง image ที่แสดงให้เห็นว่า the light เปิดอยู่. image นี้ซ้อนทับกับภาพแรกเพื่อให้เกิดผลของ the light ที่กำลังถูกเปิดอยู่.
โปรดทราบว่า the visibility ของ image นี้ถูกปิดใช้งาน.
นี่คือสิ่งที่เราจะควบคุมโดยใช้ the button. เมื่อ the button ถูกกด, image นี้จะถูกตั้งค่าให้มองเห็นได้ซึ่งแสดงให้เห็นว่า the light ถูกเปิดแล้ว ในทำนองเดียวกัน, เมื่อ the button ถูกปล่อย, the image นี้จะมองไม่เห็น และเราจะเห็น the light OFF image.



ฉันได้เพิ่ม a text area เพื่อดูค่า ADC The text area ถูกตั้งค่าด้วย a wildcard. เนื่องจากฉันต้องการแสดงค่าระหว่าง 0 ถึง 100, ดังนั้น 3 ไบต์จึงเพียงพอที่จะเก็บค่าเหล่านี้ (1 byteต่ออักขระ) The wildcard buffer ต้องถูกกำหนดด้วย 1 ไบต์พิเศษ นั่นคือ 4 ไบต์

เราจำเป็นต้องตั้งค่า the wildcard range สำหรับค่าเหล่านี้ด้วย. The wildcard range ถูกตั้งค่าข้างล่าง.



ฉันได้ตั้งค่า the range จาก 0x20 ถึง 0x7E เนื่องจากสิ่งนี้รวม the useful characters ทั้งหมดใน the ascii table.
10
ARM Processors / Re: Getting started with TouchGFX || STM32F750
« Last post by tha on May 24, 2023, 10:31:33 am »
https://controllerstech.com/touchgfx-3-sending-data-to-ui-mvp/

How to send data to UI || sample from GUI task

นี้คือ the 3rd tutorial ใน the STM32 Touch GFX series, และวันนี้เราจะมาดูวิธีการส่งข้อมูลจาก MCU ไปยัง UI ตามแนวทางของ ST มี 2 วิธีที่จะทำ เราสามารถสุ่มตัวอย่างข้อมูลจาก the GUI task เอง หรือสร้าง task อื่นเพื่อทำการสุ่มตัวอย่าง

บทช่วยสอนนี้จะครอบคลุมถึงวิธีแรก ซึ่งเราจะสุ่มตัวอย่างข้อมูลจาก GUI task, ในการทำเช่นนั้นฉันจะใช้ a physical button, และ the potentiometer ที่ต่อผ่านทาง ADC
เมื่อใดก็ตามที่ the button ถูกกด, จะมีการแสดงบน UI. นอกจากนี้ ฉันจะแสดงค่า ADC ในพื้นที่ข้อความที่แยกต่างหากบน UI.

เราจะใช้ 2 จุดสำคัญของข้อมูลที่จัดให้มีใน the TouchGFX documentation.
1.  The Model class มี a tick() function ซึ่งจะถูกเรียกทุกเฟรมและสามารถถูกนำมาใช้เพื่อมองหาสำหรับและการตอบโต้ต่อ events จาก
     โมดูลย่อยอื่น
2.  The Model class มี a pointer ถึง active Presenter ปัจจุบันของคุณ. เพื่อที่จะสามารถแจ้งให้ทราบต่อ UI ของ events ที่เข้ามา.

เราจะเห็นพวกมันใน tutorial นี้
Pages: [1] 2 3 ... 10