本文整理汇总了C++中GET32函数的典型用法代码示例。如果您正苦于以下问题:C++ GET32函数的具体用法?C++ GET32怎么用?C++ GET32使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GET32函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: uart_flush
//------------------------------------------------------------------------
void uart_flush ( void )
{
while(1)
{
if((GET32(AUX_MU_LSR_REG)&0x100)==0) break;
}
}
示例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);
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例10: sda_read
//------------------------------------------------------------------------
static unsigned int sda_read ( void )
{
unsigned int ra;
ra=GET32(IO0PIN);
ra&=(1<<SDA);
return(ra);
}
示例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);
}
示例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);
}
示例13: uart_putc
//------------------------------------------------------------------------
void uart_putc ( unsigned int c )
{
while(1)
{
if((GET32(UART0_FR)&0x20)==0) break;
}
PUT32(UART0_DR,c);
}
示例14: uart_send
//------------------------------------------------------------------------
static void uart_send ( unsigned int x )
{
while(1)
{
if(GET32(UARTFR)&0x80) break;
}
PUT32(UARTDR,x);
}
示例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;
}
}