瀏覽代碼

October 29,2024

xuxinyi 1 年之前
父節點
當前提交
80fe86e53e
共有 1 個文件被更改,包括 15 次插入0 次删除
  1. 15 0
      Diary[October 29,2024].md

+ 15 - 0
Diary[October 29,2024].md

@@ -0,0 +1,15 @@
+[October 29,2024] [Tuesday] [sunny]
+
+Yesterday, I studied Linux drivers. I used Linux drivers to obtain the information in the device tree, including strings, arrays,etc. 
+
+For stings, I used the of_find_property() function. There are two functions to obtain arrays.
+
+The first one is of_property_read_u32_index(). This function is used to obtain the value of a specified element, and there is only one element.
+
+However, I used a for loop to obtain mutiple elements. 
+
+The second one is of_property_read_u32_array(). This function can automatically obtain all the elements in the array.
+
+Today, I will continue to study Linux drivers. I will learn how to register drivers through device tree matching.
+
+Because the previous drivers were all registered through the entry and exit functions.