Пример #1
0
void UARTPutChar(uint32_t ui32Base, char ucData)
{
    OSMutexAcquire(mutexTx,0);
	//
	// Send the char.
	//
	HWREG(ui32Base + UART_O_DR) = ucData;

	//
	// Wait until space is available.
	ROM_UARTIntEnable(UART0_BASE, UART_INT_TX);
	// Wait indefinitely for a UART interrupt
	OSSemPend(sUART,0);
	OSMutexRelease(mutexTx);
}
Пример #2
0
void UARTPutString(uint32_t ui32Base, char *string)
{
    OSMutexAcquire(mutexTx,0);
	while(*string)
	{
		//
		// Send the char.
		//
		HWREG(ui32Base + UART_O_DR) = 0x72;// *string;

		ROM_UARTIntEnable(UART0_BASE, UART_INT_TX);
		// Wait indefinitely for a UART interrupt
		OSSemPend(sUART,0);

		string++;
	}

	OSMutexRelease(mutexTx);
}
Пример #3
0
//Função para liberar a porta serial
void uart2_release(void)
{
	// Libera o recurso da porta serial
	OSMutexRelease(SerialResource2);
}
Пример #4
0
//Função para liberar a porta serial
void UART_release(void)
{
  // Libera o recurso da porta serial
  OSMutexRelease(SerialResource);
}