[En-Nut-Discussion] Missing TWI Functions TwMasterRegRead and TwMasterRegWrite in NutOs 4.8.9
ulrich.prinz at googlemail.com
Fri Dec 9 19:07:39 CET 2011
I wrote these additional driver entries as most time of life you have to
read and write from addressable devices. As the AT91 handles addresses
in devices automatically without generating additional interrupts, I
Instead of having to assemble address + data to write into a
helper-buffer or calling twmastertransact multiple times with addresses
and data, you simply call twregread and twrewrite with the address and
the buffer. That's all.
Makes buffer management obsolete, saves some interrupts, makes life easier.
I had an application that uses I2C a lot for multiple different chips
like EEPROM, I2C-USART bridge and I2C-Port expanders, so it was very
handy for me as all of them need addresses first before writing/reading
If the headers got lost, I am pretty sure I submitted them. And yes,
that feature is only available for AT91 for now. AVR doesn't support it
and for STM32 I actually don't remember, I think I emulated it.
Am 07.12.2011 11:13, schrieb Uwe Bonnes:
>>>>>> "Wiegelmann," == Wiegelmann, Jörg <Joerg.Wiegelmann at ces-tronics.de> writes:
> Wiegelmann,> Hi folk, We are using the twi functions of the driver
> Wiegelmann,> extern int TwMasterRegRead(uint8_t sla, uint32_t iadr,
> Wiegelmann,> uint8_t iadrlen, void *rxdata, uint16_t rxsiz, uint32_t
> Wiegelmann,> tmo);
> Wiegelmann,> extern int TwMasterRegWrite(uint8_t sla, uint32_t iadr,
> Wiegelmann,> uint8_t iadrlen, CONST void *txdata, uint16_t txsiz,
> Wiegelmann,> uint32_t tmo);
> Wiegelmann,> In the new OS-version (4.8.9) both functions are missing. I
> Wiegelmann,> would suggest implementing the prototypes in twif.h again,
> Wiegelmann,> because our software (and perhaps other software?) is using
> Wiegelmann,> the functions. Downward compatibly is always a good
> Wiegelmann,> thing...
> It seems, only the at91_twi.c driver implements this function. In my AVR
> user code, I have TwMasterTransact. What is the policy with
> TwMasterTransact and TwMasterRegxx?
More information about the En-Nut-Discussion