Ejemplo n.º 1
1
void execute(){
	/* Obtaing the address of the frame buffer structure */
	int fbInfoAddress = InitialiseFrameBuffer(1024, 768, 16);
	/* if GPU has accepted our request to create a frame buffer then*/
	if( fbInfoAddress != 0 ){
		int fbAddr, y=0, x=0, color;
		while( 1 ){
			/* Obtaing the pointer to the frame buffer from the fram buffer structure */
			fbAddr = *((unsigned int*)(fbInfoAddress+32));
			y = 768;
			while( y != 0 ){
				x = 1024;
				while( x != 0 ){
					/* Drwaing the pixel by putting in the color information at location pointed by frame buffer */
					*((unsigned int*)(fbAddr)) = color;
					fbAddr = (fbAddr+2);
					x = x-1;
				}
				y = y-1;
				/* Changing the color */
				color = color+1;
			}
		}
	}
	/* If GPU has denied our request to create a fram buffer then */
	else{
		/* Turn on the ACT LED */
		SetGpioFunction(16,1);
		SetGpio(16, 0);
		while(1);
	}
}
Ejemplo n.º 2
1
static BT_ERROR gpio_set_direction(BT_HANDLE hGPIO, BT_u32 ulGPIO, BT_GPIO_DIRECTION eDirection) {
	switch(eDirection) {
	case BT_GPIO_DIR_OUTPUT: {
		SetGpioFunction(hGPIO, ulGPIO, 1);
		break;
	}

	case BT_GPIO_DIR_INPUT:
		SetGpioFunction(hGPIO, ulGPIO, 0);
		break;

	default:
		return BT_ERR_GENERIC;

	}

	return BT_ERR_NONE;
}
Ejemplo n.º 3
1
void main()
{
  int i;
  SetGpioFunction(16, 1);
  while (1) 
  {
    SetGpio(16, 1);
    for (i=0; i<0x3f0000; i++);
    SetGpio(16, 0);
    for (i=0; i<0x3f0000; i++);
  }
}
Ejemplo n.º 4
1
int main(void)
{
  int pos = 0;
  int value = 0;

  SetGpioFunction(16, 1);
  while (1) 
  {
    value = PATTERN & (1 << pos);
    SetGpio(16, value);
    Wait(50000);
  }
}
Ejemplo n.º 5
1
/**
 *	This is the systems main entry, some call it a boot thread.
 *
 *	-- Absolutely nothing wrong with this being called main(), just it doesn't have
 *	-- the same prototype as you'd see in a linux program.
 **/
void main (void)
{
	SetGpioFunction(16, 1);			// RDY led

	xTaskCreate(task1, "LED_0", 128, NULL, 0, NULL);
	xTaskCreate(task2, "LED_1", 128, NULL, 0, NULL);

	vTaskStartScheduler();

	/*
	 *	We should never get here, but just in case something goes wrong,
	 *	we'll place the CPU into a safe loop.
	 */
	while(1) {
		;
	}
}
Ejemplo n.º 6
1
/* Sets the function of the GPIO register. */
void gpio_enable_function(unsigned int gpio_register, unsigned int function) {
  SetGpioFunction(gpio_register, function);
}
Ejemplo n.º 7
1
void SetGpioDirection(unsigned int pinNum, enum GPIO_DIR dir) {
	SetGpioFunction(pinNum,dir);
}
Ejemplo n.º 8
0
/**
 *	This is the systems main entry, some call it a boot thread.
 *
 *	-- Absolutely nothing wrong with this being called main(), just it doesn't have
 *	-- the same prototype as you'd see in a linux program.
 **/
int main(void) {
	SetGpioFunction(47, 1);			// RDY led

	initFB();
	SetGpio(47, 1);
	videotest();

	DisableInterrupts();
	InitInterruptController();

	xTaskCreate(task1, "LED_0", 128, NULL, 0, NULL);
	xTaskCreate(task2, "LED_1", 128, NULL, 0, NULL);

	vTaskStartScheduler();

	/*
	 *	We should never get here, but just in case something goes wrong,
	 *	we'll place the CPU into a safe loop.
	 */
	while(1) {
		;
	}
}
Ejemplo n.º 9
0
/* Turns the ACT LED off */
void ledoff()
{
	SetGpioFunction(16, 1);
	SetGpio(16, 1);
}
Ejemplo n.º 10
0
/* Turns the ACT LED on */
void ledon()
{
	SetGpioFunction(16, 1);
	SetGpio(16, 0);
}