I need to interface an ARM based microcontroller (STM32F446ZETx) with a Teensy 3.6 via I2C. The ARM controller is to serve as the master, while the Teensy will act as a slave, unifying multiple sensor inputs and passing the data to the master upon request.
The issue that I have encountered is that I am not quite sure how to initiate a request on the ARM side of things, as the developer of this particular controller is quite sparse on details. The have provided the following, publicly available, code snippet as the sole demo of i2c communication (in this case, to read from an EEPROM):
I have attempted to initiate a request to the Teensy slave by using the address defined on the slave (0x66), but I cannot get the Teensy slave to recognize the request. I believe this has to do with the command byte that the mfrg references in the code above, in which case I have no idea what to do with this, as I have never used a non-Teensy master in I2C. Is there a particular command byte that a Teensy expects before recognizing an I2C request?
Any advice on this would be appreciated, Thanks!
The issue that I have encountered is that I am not quite sure how to initiate a request on the ARM side of things, as the developer of this particular controller is quite sparse on details. The have provided the following, publicly available, code snippet as the sole demo of i2c communication (in this case, to read from an EEPROM):
Code:
uint8_t addr = 0b1010000; // 7-bit slave address
ioctl(I2C_USER_FILENO, IOCTL_CMD_RD, &addr);
uint8_t toSend[] = { 0xFA }; // command byte (to send). In this case it is the register address to read
write(I2C_USER_FILENO, (char *)toSend, 1);
// The EEPROM contains an EUI48 MAC address at this location
uint8_t mac[6];
read(I2C_USER_FILENO, (char *)mac, 6);
I have attempted to initiate a request to the Teensy slave by using the address defined on the slave (0x66), but I cannot get the Teensy slave to recognize the request. I believe this has to do with the command byte that the mfrg references in the code above, in which case I have no idea what to do with this, as I have never used a non-Teensy master in I2C. Is there a particular command byte that a Teensy expects before recognizing an I2C request?
Any advice on this would be appreciated, Thanks!