2016-11-01 05:01 AM
.ExternalClassAC1DB71309B940C5BD54EFEF317A9B2C pre.cjk {font-family:'Courier New',monospace;} .ExternalClassAC1DB71309B940C5BD54EFEF317A9B2C p {margin-bottom:0.1in;line-height:120%;}
What I want to implement is to use I2C for communication between processors.
To simplify, one processor be I2C master and another be slave; I2C master sends command by I2C Master transmit and checks state by I2C Master receive. I want to setup the I2C slave to be ready to I2C slave transmit and I2C slave receive at the same time, in another word, be read for I2C master to either issue command or check status. I thought I can use
HAL_I2C_Slave_
Receive
_IT(�
)
and
HAL_I2C_Slave_Transmit_IT(�
),
but it seems like the second function
call will supersede the previous one, which leave the I2C slave be ready to either transmit or receive but not both.I use a STM32F0 for the I2C slave implementation.
#no-hablo-hal #i2c-slave #hal-i2c #i2c-slave-transmitter2016-11-02 06:28 PM
.ExternalClass6AFB6B8A8D014AC0B561B4F44BE2CAE8 pre.cjk {font-family:'Courier New',monospace;} .ExternalClass6AFB6B8A8D014AC0B561B4F44BE2CAE8 p {margin-bottom:0.1in;line-height:120%;}
Hello, Could someone help on this? What I want to do is to prepare a STM32F0 on I2C slave interface to be ready for I2C write and read. I thought that could be done by call HAL i2c function of theHAL_Stattus = (HAL_I2C_Slave_Receive_IT(&I2CInterface, (uint8_t *)coI2CSlaveRxBuffer, COI2C_SLAVE_RXBUFFSIZE); and then theHAL_Stattus = HAL_I2C_Slave_Transmit_IT(&I2CInterface, (uint8_t*)coI2CSlaveTxBuffer, COI2C_SLAVE_TXBUFFSIZE); Actually the order shouldn’t be matter, but the problem is that the second call always failed while get returned status of HAL_BUSY instead of HAL_OK. I’m be wondering that should I use HAL i2c functions other than HAL_I2C_Slave_XXX_IT() ?
2016-11-02 07:12 PM
Could someone help on this?
The roster of contributing HAL talent here is pretty shallow. Perhaps some of the FAEs can step up?2016-11-03 09:02 AM
.ExternalClass76539F173F7F4818AF5F265855EA369A pre.cjk {font-family:'Courier New',monospace;} .ExternalClass76539F173F7F4818AF5F265855EA369A p {margin-bottom:0.1in;line-height:120%;}
Just realized my second post was formatted so badly. Here I try to format it batter. Could someone help on this? What I want to do is to prepare a STM32F0 on I2C slave interface to be ready for I2C write and read. I thought that could be done by call HAL i2c function of
theHAL_Stattus = (HAL_I2C_Slave_Receive_IT(&I2CInterface, (uint8_t *)coI2CSlaveRxBuffer, COI2C_SLAVE_RXBUFFSIZE);
and then
theHAL_Stattus = HAL_I2C_Slave_Transmit_IT(&I2CInterface,(uint8_t*)coI2CSlaveTxBuffer, COI2C_SLAVE_TXBUFFSIZE);
Actually the order shouldn’t be matter, but the problem is that the second call always failed while get returned status of HAL_BUSY instead of HAL_OK. I’m be wondering that should I use HAL i2c functions other than HAL_I2C_Slave_***_IT() ?
2017-08-30 05:12 PM
In a word,the HAL drivers are set to not allow this. The chip itself probably can. If you wish the chip to be transparent (slave receive to master transmit on another interface) the best way would be to pass a message between the two interfaces with your own software. HAL would work in that case