I have started the port of the existing Slave I2C LIbrary to the K42 range of chips. The K42 range of chips use a different I2C module - hence , the new piece of work. We have a working library of 'legacy I2C' so this should not take too long. :-)
Essentially the incoming I2C messages are exposed in the Message Queue. The Message Queue is a buffer.
The size of the buffer is user determined but this will be based on the maxiumum I2C message to be communicated. The methods expose the buffer and with very simple GCB logic users can respond to the specifics of the I2C message.
The supporting libraries hide the complexities of the state engine, and the buffer is intended to make things easy.
This is a GCB implementation of Microchip Application Note AN734.
This library provides an message interface to i2c hardware slave.
The user needs to supply a procedure to process the received message.
Basically, this i2c slave waits for a full message to arrive. Then it calls the user procedure to process the message and (optional) prepare a response. Subsequently, this lib will pass the response data over to the master, if
it wants to have them. '
There two Callbacks exposed to the user HI2C_Process_In_Message( HI2CIndex as byte )
called when i2c a master starts a talk. HI2CIndex is the length of the incoming packet
HI2C_Process_Outgoing_Message
called when i2c a master needs a response
HI2CBUFFER should be populated with the data to be sent.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have started the port of the existing Slave I2C LIbrary to the K42 range of chips. The K42 range of chips use a different I2C module - hence , the new piece of work. We have a working library of 'legacy I2C' so this should not take too long. :-)
Essentially the incoming I2C messages are exposed in the Message Queue. The Message Queue is a buffer.
The size of the buffer is user determined but this will be based on the maxiumum I2C message to be communicated. The methods expose the buffer and with very simple GCB logic users can respond to the specifics of the I2C message.
The supporting libraries hide the complexities of the state engine, and the buffer is intended to make things easy.
This is a GCB implementation of Microchip Application Note AN734.
This library provides an message interface to i2c hardware slave.
The user needs to supply a procedure to process the received message.
Basically, this i2c slave waits for a full message to arrive. Then it calls the user procedure to process the message and (optional) prepare a response. Subsequently, this lib will pass the response data over to the master, if
it wants to have them. '
There two Callbacks exposed to the user
HI2C_Process_In_Message( HI2CIndex as byte )
called when i2c a master starts a talk. HI2CIndex is the length of the incoming packet
HI2C_Process_Outgoing_Message
called when i2c a master needs a response
HI2CBUFFER should be populated with the data to be sent.
Hit first problem about 30 seconds in.
The chip data file for the 18FxxK42s needs updating - there is an error. :-(
I will release new chip files when I have completed this project.