Re: Synchronization between ISR and IST - I2C Based device



Thanks Steve,
There is only one UART driver but 2 instance of the driver are loaded
one for each UART channel.
So there will be 1 IRQ and 2 Logical Interrpt.
Now I need to resolve the interrupt in the ISR. so that the appropriate
locical interrupt is returned and the IST of the corresponding channel
is running to service the interrupt.

1. Is there any example for the Single driver that is used for both the
uarts. How will be the interfaces?? Can i use the normal ReadFile and
Write File for accessing the UART from the application code..
or as we said before

2. Can i write a driver whose IST will resolve the UART interrupt using
the smbus driver .
This will use the existing SMBus driver (with CS so it will wait for
the LeaveCS to happen) to access the IIR of the UART and trigger the
appropriate Event for which the IST of the UART are waiting.
or
3, Disable the UART Interrupt when the SMBus is accessed (read /
write).
SMBusReadData()
{
InterruptDisable(HWINTR_UART);
EnterCS()
Access The SMBus Here
LeaveCS()
InterruptEnable(HWINTR_UART)
}

Will these approaches have any effect on the performance ??

Or there any alternatives to these approached??

Thanks
Mams and Team

Steve Maillet (eMVP) wrote:
This is our Device architecture
Au1200 Processssor->SmbusController->Philips Uart
->Device 2
-> Device 3
The Smbus Controller doesnot int mechism it uses progrmmed IO to read
and write from the SMBus .
The UART is a DUAL channel with single IRQ.

This would be what we call an unfortunate hardware design. But not a
complete show stopper. There is NO way to block and wait for other threads
in an ISR, nor should there be, because ISRs are run outside the context of
any threads. Therefore you MUST have a single IST for the single IRQ and
determine which device it came from at that point. Rather than having a
separate driver for each of the "UART" channels. Use a single driver and a
custom IOCTL code you send to it after opening the device to identify which
channel you want to use. This approach keeps the ISR simple and straight
forward as it should be and puts the work on to the IST and driver where it
belongs.

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com

.



Relevant Pages


Loading