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); }
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); }
//Função para liberar a porta serial void uart2_release(void) { // Libera o recurso da porta serial OSMutexRelease(SerialResource2); }
//Função para liberar a porta serial void UART_release(void) { // Libera o recurso da porta serial OSMutexRelease(SerialResource); }