1
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
2
ARM Processors / Re: Getting started with TouchGFX || STM32F750
« 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 ถูกหมุน.
ข้างล่างคือ 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
« 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.

• 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
« 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 ด้วย.

ที่นี่ 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
« 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.

• 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
« 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
ดังที่ฉันได้กล่าวถึงในบทช่วยสอนนี้ เราจะสุ่มตัวอย่างจาก 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
« 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.

The ADC3 channel 0 ได้รับการกำหนดค่าด้วยความละเอียด 12 บิต. ทุกสิ่งทุกอย่างจะถูกเก็บไว้เป็นค่าเริ่มต้นใน the ADC configuration. เราจะใช้ the poll method เพื่ออ่าน the ADC values.
8
ARM Processors / Re: Getting started with TouchGFX || STM32F750
« 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.
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.