This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ino code convert to nordic code

hi,

I am beginner and I am converting an Arduino library to Nordic library, but I have this part code 

what is mean begin, I am confused on this part , for example , TwoWire is a I2C function  and begin is exclusive for Arduino , I'm going to change TwoWire for nrf_twi function, something like that , but I have no idea what is the similar function for Nordic nrf52840 and I need to convert this library to Nordic 

bool begin(TwoWire &wirePort, uint32_t i2cSpeed, uint8_t i2caddr) {	

  _i2cPort = &wirePort; //Grab which port the user wants us to use

  _i2cPort->begin();
  _i2cPort->setClock(i2cSpeed);

  _i2caddr = i2caddr;

  // Step 1: Initial Communication and Verification
  // Check that a MAX30105 is connected
  if (readPartID() != MAX_30105_EXPECTEDPARTID) {
    // Error -- Part ID read from MAX30105 does not match expected part ID.
    // This may mean there is a physical connectivity problem (broken wire, unpowered, etc).
    return false;
  }

  // Populate revision ID
  readRevisionID();
  
  return true;
}

thanks and regards, sorry , my English is not good 

Parents Reply Children
No Data
Related