本文整理汇总了C++中GET32函数的典型用法代码示例。如果您正苦于以下问题:C++ GET32函数的具体用法?C++ GET32怎么用?C++ GET32使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GET32函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: uart_init
//------------------------------------------------------------------------
void uart_init ( void )
{
unsigned int ra;
PUT32(AUX_ENABLES,1);
PUT32(AUX_MU_IER_REG,0);
PUT32(AUX_MU_CNTL_REG,0);
PUT32(AUX_MU_LCR_REG,3);
PUT32(AUX_MU_MCR_REG,0);
PUT32(AUX_MU_IER_REG,0);
PUT32(AUX_MU_IIR_REG,0xC6);
PUT32(AUX_MU_BAUD_REG,270);
ra=GET32(GPFSEL1);
ra&=~(7<<12); //gpio14
ra|=2<<12; //alt5
ra&=~(7<<15); //gpio15
ra|=2<<15; //alt5
PUT32(GPFSEL1,ra);
PUT32(GPPUD,0);
for(ra=0;ra<150;ra++) dummy(ra);
PUT32(GPPUDCLK0,(1<<14)|(1<<15));
for(ra=0;ra<150;ra++) dummy(ra);
PUT32(GPPUDCLK0,0);
PUT32(AUX_MU_CNTL_REG,3);
}
开发者ID:GreenYo0413,项目名称:raspberrypi,代码行数:26,代码来源:periph.c
示例2: uart_flush
//------------------------------------------------------------------------
void uart_flush ( void )
{
while(1)
{
if((GET32(AUX_MU_LSR_REG)&0x100)==0) break;
}
}
开发者ID:GreenYo0413,项目名称:raspberrypi,代码行数:8,代码来源:periph.c
示例3: audio1575_write_ac97
/*
* audio1575_write_ac97()
*
* Description:
* Set the specific AC97 Codec register.
*
* Arguments:
* void *arg The device's state structure
* uint8_t reg AC97 register number
* uint16_t data The data want to be set
*/
static void
audio1575_write_ac97(void *arg, uint8_t reg, uint16_t data)
{
audio1575_state_t *statep = arg;
int i;
if (audio1575_codec_sync(statep) != DDI_SUCCESS) {
return;
}
/* write the data to WRITE to the lo word of the CPR register */
PUT16(M1575_CPR_REG, data);
/* write the address to WRITE to the hi word of the CPR register */
PUT16(M1575_CPR_REG+2, reg);
/* wait until command is completed sucessfully */
for (i = 0; i < M1575_LOOP_CTR; i++) {
/* Wait for Write Ready 0x01 */
if (GET32(M1575_CSPSR_REG) & M1575_CSPSR_WRRDY) {
break;
}
drv_usecwait(1);
}
if (i < M1575_LOOP_CTR) {
(void) audio1575_read_ac97(statep, reg);
}
}
开发者ID:apprisi,项目名称:illumos-gate,代码行数:40,代码来源:audio1575.c
示例4: uart_putc
int uart_putc (uint32_t c, ...) {
while(1) {
if(GET32(AUX_MU_LSR_REG)&0x20) break;
}
PUT32(AUX_MU_IO_REG,c);
return c;
}
开发者ID:EQ4,项目名称:pixperiments,代码行数:7,代码来源:uart.c
示例5: notmain
//-------------------------------------------------------------------
void notmain ( void )
{
unsigned int lastcount;
unsigned int nowcount;
unsigned int timeout;
pll_init(); //run clock at 60MHz.
PUT32(APBDIV,1); //run peripherals at 60MHz
uart_init();
hexstring(0x12345678,1);
//zero bits 30 and 31 (connect pin to GPIO)
PUT32(PINSEL0,GET32(PINSEL0)&(~(3<<(LEDBIT<<1))));
//make the pin an output
PUT32(IO0DIR,GET32(IO0DIR)|(1<<LEDBIT));
PUT32(T0CR,2); //reset timer
PUT32(T0CR,0); //reset timer
PUT32(T0PR,(1000000-1)); //divide by 1 million
PUT32(T0CR,1); //enable timer
timeout=60*3; //10 seconds
lastcount=GET32(T0TC);
while(1)
{
PUT32(IO0SET,(1<<LEDBIT));
//not too fast if you are just jamming these in
PUT32(U0THR,0x31);
while(1)
{
nowcount=GET32(T0TC);
nowcount-=lastcount; //upcounter
if(nowcount>=timeout) break;
}
lastcount+=timeout;
PUT32(IO0CLR,(1<<LEDBIT));
//not too fast if you are just jamming these in
PUT32(U0THR,0x30);
while(1)
{
nowcount=GET32(T0TC);
nowcount-=lastcount; //upcounter
if(nowcount>=timeout) break;
}
lastcount+=timeout;
}
}
开发者ID:dwelch67,项目名称:armmite_samples,代码行数:48,代码来源:uart02.c
示例6: swf_ReadSWF2
/*--------------------------------------------------------------------------------*
* Reads SWF to memory
*--------------------------------------------------------------------------------*/
int swf_ReadSWF2(reader_t* reader, SWF* swf)
{
char b[32];
int len;
int tc; /* tag counter */
TAG* t;
TAG t1;
reader_t zreader;
if(NULL == swf) return -1;
memset(swf, 0x00, sizeof(SWF));
len = reader->read(reader, b, 8);
if(len < 8) return -1;
if(b[0] != 'F' && b[0] != 'C') return -1;
if(b[1] != 'W') return -1;
if(b[2] != 'S') return -1;
swf->fileVersion = b[3];
swf->compressed = (b[0]=='C') ? 1 : 0;
swf->fileSize = GET32(&b[4]);
if(swf->compressed)
{
/* at first, we do not care about SWC */
return -1;
}
swf->compressed = 0;
reader_GetRect(reader, &swf->movieSize);
reader->read(reader, &swf->frameRate, 2);
swf->frameRate = LE_16_TO_NATIVE(swf->frameRate);
reader->read(reader, &swf->frameCount, 2);
swf->frameCount = LE_16_TO_NATIVE(swf->frameCount);
/* read tags and connect to list */
t1.next = 0;
t = &t1;
tc = 0;
while (t)
{
t = swf_ReadTag(reader, t);
if(NULL == t) break;
tc++;
if(t->id == ST_FILEATTRIBUTES)
{
swf->fileAttributes = swf_GetU32(t);
swf_ResetReadBits(t);
}
}
/*
printf("swf->frameCount:%d <--> tag count:%d\n", swf->frameCount, tc);
*/
swf->firstTag = t1.next;
if(t1.next)
t1.next->prev = NULL;
return reader->pos;
}
开发者ID:charlessoft,项目名称:myboo,代码行数:62,代码来源:swflib.c
示例7: raspi_okled_reset
void raspi_okled_reset(doorid_t id) {
doors[id].status = DOOR_STATUS_BUSY;
uint32_t sel = GET32(GPFSEL1);
sel &= ~(0b111 << 18);
sel |= (0b001 << 18);
PUT32(GPFSEL1,sel);
doors[id].status = DOOR_STATUS_READY;
}
开发者ID:raspberry-alpha-omega,项目名称:cornelius,代码行数:8,代码来源:corn.c
示例8: disable_system_timer_interrupt
int disable_system_timer_interrupt(void)
{
Interrupt_IRQ_Disable1_Reg_t intrbasdisable;
intrbasdisable = (Interrupt_IRQ_Disable1_Reg_t) GET32(INTERRUPT_DISABLE_IRQ1);
intrbasdisable.mBits.irq1 = 1;
PUT32(INTERRUPT_DISABLE_IRQ1,intrbasdisable.mAsU32);
return 0;
}
开发者ID:arjunhary,项目名称:Raspberry_pi_baremetal_arjun,代码行数:8,代码来源:Interrupt_handler.c
示例9: switch_init
void switch_init() {
// set GPIO1 as an input
unsigned int ra;
ra = GET32(GPFSEL1);
ra &= ~(7<<3);
ra |= 0 << 0;
PUT32(GPFSEL1, ra);
}
开发者ID:EQ4,项目名称:pixperiments,代码行数:8,代码来源:hardware.c
示例10: sda_read
//------------------------------------------------------------------------
static unsigned int sda_read ( void )
{
unsigned int ra;
ra=GET32(IO0PIN);
ra&=(1<<SDA);
return(ra);
}
开发者ID:dwelch67,项目名称:lpc-h2148_samples,代码行数:9,代码来源:ssd1306b.c
示例11: stop_spi_transfer
void stop_spi_transfer(void)
{
//Set TA = 0 and clear the fifo
volatile SPI_control_Reg_t spictrlreg;
spictrlreg = (SPI_control_Reg_t) GET32(SPI_CONTROL_STATUS_REGISTER);
spictrlreg.mAsU32 = 0x00000000;
PUT32(SPI_CONTROL_STATUS_REGISTER,spictrlreg.mAsU32);
}
开发者ID:arjunhary,项目名称:Raspberry_pi_baremetal_arjun,代码行数:8,代码来源:SPI.c
示例12: uart_send
//------------------------------------------------------------------------
void uart_send ( unsigned int c )
{
while(1)
{
if(GET32(AUX_MU_LSR_REG)&0x20) break;
}
PUT32(AUX_MU_IO_REG,c);
}
开发者ID:3100102709,项目名称:raspberrypi,代码行数:9,代码来源:periph.c
示例13: uart_putc
//------------------------------------------------------------------------
void uart_putc ( unsigned int c )
{
while(1)
{
if((GET32(UART0_FR)&0x20)==0) break;
}
PUT32(UART0_DR,c);
}
开发者ID:optixx,项目名称:raspberrypi,代码行数:9,代码来源:uartx01.c
示例14: uart_send
//------------------------------------------------------------------------
static void uart_send ( unsigned int x )
{
while(1)
{
if(GET32(UARTFR)&0x80) break;
}
PUT32(UARTDR,x);
}
开发者ID:dwelch67,项目名称:tivac_launchpad,代码行数:9,代码来源:uart07.c
示例15: dowait
void dowait ( void )
{
unsigned int ra;
unsigned int rb;
unsigned int rc;
rb=GET32(TMR1)&0xFFFF;
for(ra=24414;ra;ra--)
{
while(1)
{
rc=GET32(TMR1)&0xFFFF;
if((rc-rb)>=0x4000) break;
}
rb=rc;
}
}
开发者ID:DIYzzuzpb,项目名称:pic32_samples,代码行数:17,代码来源:blinker03.c
示例16: gpio_pin_read
unsigned int gpio_pin_read(unsigned int pin) {
unsigned int reg = gpio_pin_to_input_register(pin);
system_memory_read_barrier();
unsigned int val = GET32(reg);
val = val >> gpio_pin_to_input_offset(pin);
val = val & 1;
return val;
}
开发者ID:cvphelps,项目名称:courseware,代码行数:8,代码来源:gpio.c
示例17: ClockInit
void ClockInit ( void )
{
unsigned int ra;
//enable HSE
ra=GET32(RCC_CR);
ra&=~(0xF<<16);
PUT32(RCC_CR,ra);
ra|=1<<16;
PUT32(RCC_CR,ra);
while(1)
{
if(GET32(RCC_CR)&(1<<17)) break;
}
PUT32(RCC_CFGR,0x00009401); //PPRE2 /2 PPRE1 /4 sw=hse
//slow flash accesses down otherwise it will crash
PUT32(FLASH_ACR,0x00000105);
//8MHz HSE, 168MHz pllgen 48MHz pll usb
//Q 7 P 2 N 210 M 5 vcoin 1 pllvco 336 pllgen 168 pllusb 48
ra=(7<<24)|(1<<22)|(((2>>1)-1)<<16)|(210<<6)|(5<<0);
PUT32(RCC_PLLCFGR,ra);
// enable pll
ra=GET32(RCC_CR);
ra|=(1<<24);
PUT32(RCC_CR,ra);
//wait for pll lock
while(1)
{
if(GET32(RCC_CR)&(1<<25)) break;
}
//select pll
PUT32(RCC_CFGR,0x00009402); //PPRE2 /2 PPRE1 /4 sw=pllclk
//if you didnt set the flash wait states you may crash here
//wait for it to use the pll
while(1)
{
if((GET32(RCC_CFGR)&0xC)==0x8) break;
}
}
开发者ID:Qbicz,项目名称:stm32f4d,代码行数:46,代码来源:blinker04.c
示例18: sda_input
//------------------------------------------------------------------------
static void sda_input ( void )
{
unsigned int ra;
ra=GET32(IO0DIR);
ra&=~(1<<SDA);
PUT32(IO0DIR,ra);
}
开发者ID:dwelch67,项目名称:lpc-h2148_samples,代码行数:9,代码来源:ssd1306b.c
示例19: start_spi_transfer
void start_spi_transfer(void)
{
//Set the control register . Clear the fifo bits and set TA =1. Assumes chip select 0
volatile SPI_control_Reg_t spictrlreg;
spictrlreg = (SPI_control_Reg_t) GET32(SPI_CONTROL_STATUS_REGISTER);
spictrlreg.mAsU32 = 0x000000B0;
PUT32(SPI_CONTROL_STATUS_REGISTER,spictrlreg.mAsU32);
}
开发者ID:arjunhary,项目名称:Raspberry_pi_baremetal_arjun,代码行数:8,代码来源:SPI.c
示例20: set_DC_low_for_command
void set_DC_low_for_command(void)
{
//Clear GPI0 25.Sending a command
volatile GPIO_Output_Clear_Register0_t GPIOClearReg0;
GPIOClearReg0 = (GPIO_Output_Clear_Register0_t)GET32(GPIO_REG_GPCLR0);
GPIOClearReg0.mBits.ClearGPIO25 = 1;
PUT32(GPIO_REG_GPCLR0,GPIOClearReg0.mAsU32);
}
开发者ID:arjunhary,项目名称:Raspberry_pi_baremetal_arjun,代码行数:8,代码来源:SPI.c
注:本文中的GET32函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论