The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled C Code
Posted by: julien | July 4, 2008 @ 8:06am
C Code
[
Download
]
arch/avr32/mach-at32ap/pio.c /* Pin multiplexing API */ void __init at32_select_periph(unsigned int port, u32 pin_mask, unsigned int periph, unsigned long flags) { int i; struct pio_device *pio; for(i = 0; i < 32; i++) { unsigned int pin = port + i; unsigned int pin_index = pin & 0x1f; u32 mask = 1 << pin_index; if(!((1 << i) & pin_mask)) continue; ... } arch/avr32/boards/hammerhead/setup.c static u32 get_pin_mask(unsigned int port); struct atmel_lcdfb_info __initdata hammerhead_lcdc_data = { .default_bpp = 24, .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN, .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT | ATMEL_LCDC_INVCLK | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE | ATMEL_LCDC_MEMOR_BIG), .default_monspecs = &hammerhead_hda350t_monspecs, .guard_time = 2, .get_pin_mask = get_pin_mask, }; static u32 get_pin_mask(unsigned int port) { u32 pin_mask = 0; switch(port) { case GPIO_PIOC_BASE: pin_mask = LCD_PERIPH_HSYNC | LCD_PERIPH_PCLK | LCD_PERIPH_VSYNC | LCD_PERIPH_PWR | LCD_PERIPH_DATA0 | LCD_PERIPH_DATA1 | LCD_PERIPH_DATA2 | LCD_PERIPH_DATA3 | LCD_PERIPH_DATA4 | LCD_PERIPH_DATA5; break; case GPIO_PIOD_BASE: pin_mask = LCD_PERIPH_DATA6 | LCD_PERIPH_DATA7 | LCD_PERIPH_DATA8 | LCD_PERIPH_DATA9 | LCD_PERIPH_DATA10 | LCD_PERIPH_DATA11 | LCD_PERIPH_DATA12 | LCD_PERIPH_DATA13 | LCD_PERIPH_DATA14 | LCD_PERIPH_DATA15 | LCD_PERIPH_DATA16 | LCD_PERIPH_DATA17 | LCD_PERIPH_DATA18 | LCD_PERIPH_DATA19 | LCD_PERIPH_DATA20 | LCD_PERIPH_DATA21 | LCD_PERIPH_DATA22 | LCD_PERIPH_DATA23; break; default: printk("Unsupported PORT"); } return pin_mask; } arch/avr32/mach-at32ap/at32ap700x.c if(data->get_pin_mask) { at32_select_periph2(GPIO_PIOC_BASE, data->get_pin_mask(GPIO_PIOC_BASE), GPIO_PERIPH_A, 0); at32_select_periph2(GPIO_PIOD_BASE, data->get_pin_mask(GPIO_PIOD_BASE), GPIO_PERIPH_A, 0); }
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.65 / 8
224 Votes
http://codebin.yi.org/170
page generated in 0.00 seconds