How to implement the Serial IrDA on LM3S6965
Hi, I am not familiar to SIR IrDA and have a question regarding the Serial (or Slow) IrDA implementation over the LM3S6965 or any Cortex-M3 architecture. Current I worked on a project that has two infrared serial devices to connect to the UART1 and UART2 (or the IrDA port 1 & 2) on the LM3S6965, but I could not get them to Tx/Rx through a interrupt service routine. If someone has an idea how to configure and implement this UART port and can share a sample code with me, it will be greatly appreciated. The following code is configuration of SIR1 and SIR2.
/* Enable the UART and IrDA. GPIOA has already been initialised. */
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART2);
/* Set GPIO A0 and A1 as peripheral function. They are used to output the
UART signals. D2/D3 and G0/G1 for IrDA */
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
GPIOPinTypeUART(GPIO_PORTD_BASE, GPIO_PIN_2 | GPIO_PIN_3);
GPIOPinTypeUART(GPIO_PORTG_BASE, GPIO_PIN_0 | GPIO_PIN_1);
/* Configure the UART to 115200 for 8-N-1 operation. */
UARTConfigSet( UART0_BASE, mainBAUD_RATE, UART_CONFIG_WLEN_8 | UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE );
UARTConfigSet( UART1_BASE, mainBAUD_RATE, UART_CONFIG_WLEN_8 | UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE );
UARTConfigSet( UART2_BASE, mainBAUD_RATE, UART_CONFIG_WLEN_8 | UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE );
/* We dont want to use the fifo. */
HWREG( UART0_BASE + UART_O_LCR_H ) &= ~mainFIFO_SET;
/* Enable the SIR1 and SIR2 */
UARTEnableSIR(UART1_BASE, (tBoolean) false);
UARTEnableSIR(UART2_BASE, (tBoolean) false);
/* Enable both Rx and Tx interrupts. */
HWREG( UART0_BASE + UART_O_IM ) |= ( /*UART_INT_TX |*/ UART_INT_RX );
IntEnable( INT_UART0 );
/* Enable IrDA1 and IrDA2 interrupt */
HWREG( UART1_BASE + UART_O_IM ) |= ( /*UART_INT_TX |*/ UART_INT_RX );
IntEnable( INT_UART1 );
HWREG( UART2_BASE + UART_O_IM ) |= ( /*UART_INT_TX |*/ UART_INT_RX );
IntEnable( INT_UART2 );
thanks,
Byang
How to implement the Serial IrDA on LM3S6965
Try the Luminary Micro driver library, or the Luminary Micro support desk. Please keep to FreeRTOS questions here.