Time of Update: 2018-12-04
1.SD卡命令 static int mmc_test_set_blksize(struct mmc_test_card *test, unsigned size){ struct mmc_command cmd; int ret; cmd.opcode = MMC_SET_BLOCKLEN; //命令 cmd.arg = size; //參數 cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; //命令類型 ret =
Time of Update: 2018-12-04
<1>Download mtd-utils(v1.4.1)http://git.infradead.org/mtd-utils.gitgit clone git://git.infradead.org/mtd-utils.git<2>Compile mtd_debug:arm-none-linux-gnueabi-gcc -static mtd_debug.c -o mtd_debug -I./includenanddump:arm-none-linux-gnueabi-
Time of Update: 2018-12-04
電路模擬與分析設計PWM波RC濾波電路時,應根據回應時間要求,確定時間常數,並且使RC時間常數遠大於PWM周期。RC充放電時間常數應盡量相等。此外還應根據電壓精度要求確定RC參數。輸出電壓 = PWM電壓 *占空比如 1.49v = 5v * 30%在分析幅頻響應是,電路中應包含一個AC訊號源。
Time of Update: 2018-12-04
SD卡座資料(帶檢測引腳) 可將CD引腳通過上拉電阻接到VDD用於SD的插入和拔出檢測:當拔出SD時,CD引腳的電壓為VDD,否則為GND。 ------------------------------------------ void mmc_rescan(struct work_struct *work){ struct mmc_host *host = container_of(work, struct mmc_host, detect.work); u32 ocr; int
Time of Update: 2018-12-04
Linux記憶體 Clerk分析1) bootmem_init();初始化bootmem記憶體 Clerktypedef struct bootmem_data { unsigned long node_min_pfn; unsigned long node_low_pfn; void *node_bootmem_map; //用於表示物理頁框的使用方式,“1”表示該頁框已用 unsigned long last_end_off; unsigned
Time of Update: 2018-12-04
衰減器衰減器用來衰減大幅度的輸入訊號,以保證放大電路輸出不產生失真。對衰減器的主要要求是:頻帶要足夠寬,輸入阻抗要足夠高。由於衰減器輸出所接的放大電路的輸入阻抗是容性的,因此衰減器通常採用RC衰減器,其原理:
Time of Update: 2018-12-04
kernel代碼/* * To test kernel's scheduler * Date:2011/8/8 13:04 * ### wait queue ### */#include <linux/init.h>#include <linux/list.h>#include <linux/module.h>#include <linux/kmod.h>#include <linux/kernel.h>#include
Time of Update: 2018-12-04
<1>填充塊裝置資料結構static void mtd_blktrans_request(struct request_queue *rq){ struct mtd_blktrans_ops *tr = rq->queuedata; wake_up_process(tr->blkcore_priv->thread);} tr->blkcore_priv->rq = blk_init_queue(mtd_blktrans_request, &tr-
Time of Update: 2018-12-04
1 i2c_board_info資料結構的定義 static struct i2c_board_info __initdata stargate2_i2c_board_info[] = {/* Techically this a pca9500 - but it's compatible with the 8574 * for gpio expansion and the 24c02 for eeprom access. */{.type = "pcf8574",.addr =
Time of Update: 2018-12-04
1 bootmem_init分析檔案:arch/arm/mm/mmu.cpaging_init -> bootmem_init 1) 為pgdat = NODE_DATA(node),pgda->bdata->node_bootmem_map分配記憶體空間,起始地址為_end(即kernel的最後地址)。注:node_bootmem_map佔有的頁框數= [( (memsize)>>12 ) / 8 ]>>12 2)
Time of Update: 2018-12-04
wait_queue_head_t & wait_queue_t使用 檔案:Linux/drivers/mtd/mtdchar.c +526 case MEMERASE: //Nand擦除IOCTL case MEMERASE64: { struct erase_info *erase; if(!(file->f_mode & FMODE_WRITE)) return
Time of Update: 2018-12-04
Kernel常見錯誤類型總結1) ENOMEMdev->base = ioremap(mem->start, resource_size(mem)); if (!dev->base) { r = -ENOMEM; goto err_free_mem; } dev = kzalloc(sizeof(struct omap_i2c_dev), GFP_KERNEL); if (!dev) { r = -ENOMEM; /* 記憶體配置失敗
Time of Update: 2018-12-04
1. Install the skyeye on the ubuntu8.04 (1).apt-get install skyeye (2).Download skyeye testsuite:skyeye-testsuite-1.3.0_rc1 (3).Download the Busybox & Linux source code. Cross compile tools :arm-linux-gcc 3.4.1Busybox :busybox-1
Time of Update: 2018-12-04
C語言中的.c和.h檔案2009-06-29 09:30簡單的說其實要理解C檔案與標頭檔(即.h)有什麼不同之處,首先需要弄明白編譯器的工作過程,一般說來編譯器會做以下幾個過程:1.預先處理階段 2.詞法與文法分析階段 3.編譯階段,首先編譯成純彙編語句,再將之彙編成跟CPU相關的二進位碼,產生各個目標檔案
Time of Update: 2018-12-04
1 資源定義 static struct resource res[] = {[0] = {.start = 1,.end = 5,},[1] = {.start = 7.end = 11,},[2] = {.start = 15,.end = 30,},};request_mem_region(res[0]->start, 4, "res0");request_mem_region(res[2]->start, 4,
Time of Update: 2018-12-04
vmalloc中物理地址重新對應函數分析 Figure 1:Vmalloc Areas Figure 2:將非連續3個物理pages映射到連續虛擬位址 註:圖片來至《Professional Linux kernel architecture》函數調用關係:1) vmap_page_range(unsigned long start, unsigned long end,
Time of Update: 2018-12-04
經常見到嵌入式設計中,將某一程式段的入口地址轉換為一個函數,我們來分析一下它的成分: 如在bootloader的0x00000020地址上的雙字單元中有這樣一條語句:@Address is 0x00000020 b powerdown @Jump to the flag "powerdown"......powerdown:...... 然後在某一C標頭檔中可以見到這樣的宏聲明:#define EnterPWDN(clkcon) ((void (*
Time of Update: 2018-12-04
Digital Oscilloscope GUI base on SDL.1.soure code: /* Bring up a window and play with it */#include <stdlib.h>#include <stdio.h>#include <string.h>#include <math.h>#include "SDL.h"uint32_t wavetab[64];void
Time of Update: 2018-12-04
使用alsa的工具aplay錄音./arecord -f S16_LE -c 2 -r 8000 -d 20 8k.wav #錄音:16bit 小端,立體聲,採樣率8K,時間20s註:將aplay命名為arecord,或者使用aplay -C{"help", 0, 0, 'h'},{"version", 0, 0, OPT_VERSION},{"list-devices", 0, 0, 'l'},{"list-pcms", 0, 0, 'L'},{"device", 1, 0,
Time of Update: 2018-12-04
1 mm_init分析file:init/main.cstart_kernel函數{ ... setup_arch(&command_line);//處理器相關的初始化代碼,paging_init,詳細見bootmem_init分析 mm_init_owner(&init_mm,