/** Performs any post configuration tasks after the attached Bluetooth adapter has been successfully enumerated.
 *
 *  \return Boolean true if no Bluetooth adapter attached or if all post-configuration tasks complete without error, false otherwise
 */
bool BluetoothAdapter_PostConfiguration(void)
{
	if (!(BluetoothAdapter_IsActive))
	  return true;
	  
	Bluetooth_Init(&BluetoothAdapter_Stack);
	return true;
}
Example #2
0
void Inicia_Tiva() {
	// Configura o clock para 50MHz
	SysCtlClockSet(SYSCTL_SYSDIV_2 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ| SYSCTL_OSC_MAIN);
	LCD_Init();
	ADC_Init();
	Bluetooth_Init();
	I2C_Init();
	Valvula_Init();
	Timer_Init();
}
Example #3
0
int main( void )
{
	unsigned long * ptr;
	unsigned char aux;
	unsigned int tempo = 500;

	IO_Init();
	SysTick_Init_ms( tempo );
	UART_Init_16MHz();
	Nokia5110_Init();
	Bluetooth_Init();
	
  Nokia5110_OutString("SENAI");	

	for(;;)
	{
		if( UART_InCharAvailable() )
			Bluetooth_OutChar( UART_InChar() );
		
		if( Bluetooth_InCharAvailable() )
		  UART_OutChar ( aux = Bluetooth_InChar() );


		if( SysTickRun() )
		{
			if( *ptr )
		    *ptr = 0x00; 
			else
			  *ptr = 0xFF; 
		}

			switch( aux )
			{
				case 0:
				case 'R': 	*ptr = 0x00; ptr = (unsigned long *)&LED_RED;				break;
				case 'B': 	*ptr = 0x00; ptr = (unsigned long *)&LED_BLUE;			break;
				case 'G': 	*ptr = 0x00; ptr = (unsigned long *)&LED_GREEN;			break;
				case 'Y': 	*ptr = 0x00; ptr = (unsigned long *)&LED_YELLOW;		break;
				case 'P': 	*ptr = 0x00; ptr = (unsigned long *)&LED_PINK;			break;
				case 'S': 	*ptr = 0x00; ptr = (unsigned long *)&LED_SKYBLUE;		break;
				case 'W':   *ptr = 0x00; ptr = (unsigned long *)&LED_WHITE;			break;
				case 'D':   *ptr = 0x00; ptr = (unsigned long *)&LED_DARK;			break;
				case 'T': 	DHT11_In( (unsigned long *) &sensor );
										UART_OutString( "Temp: " );
										UART_OutUDec( (unsigned long)sensor.temperatura );
										UART_OutString( "\r\n" );
										Bluetooth_OutString( "Temp: " );
										Bluetooth_OutUDec( (unsigned long)sensor.temperatura ); 		
										Bluetooth_OutString( "\r\n" );
										SysTick_Init_ms( tempo );
										break;
				case 'U': 	DHT11_In( (unsigned long *) &sensor );
										UART_OutString( "Umidade: " );
										UART_OutUDec( (unsigned long)sensor.umidade );
										UART_OutString( "\r\n" );
										Bluetooth_OutString( "Umidade: " );
										Bluetooth_OutUDec( (unsigned long)sensor.umidade ); 
										Bluetooth_OutString( "\r\n" );
										SysTick_Init_ms( tempo );
										break;
			}


	} //for(;;)	
} //int main( void )