MT_Open

■Description

In order to access hardware (SIO, microcomputer, etc.), first call this function and obtain the handle.

■Synopsis

int MT_Open(void *pv)

■Argument

void *pv
  It is a reserved argument. Please specify NULL.

■RETURN VALUE

If the function succeeds, a valid bundle is returned.
For other functions, device control is performed using the handle acquired by this function.
If the function fails, -1 is returned.
The other errors : Error code details

■Note

For BX-220 Series and BX-830 Series, use "void *pv".

Example) Set the information of i2c to be used for pv.
  sprintf(i2c_info.uI2C_DeviceName,"/dev/i2c-%d",bus);
  i2c_info.uI2C_SlaveAddress = 0x22;
  i2c_info.iSize = sizeof(I2C_INFO);
  fd = MT_Open((void *)&i2c_info);

reference)
  typedef struct {
    char	uI2C_DeviceName[64];
    char	uI2C_SlaveAddress;
    char	uI2C_Ext[2];
    int		iSize;
  } I2C_INFO, *PI2C_INFO;



Function List