To change the timeout for operations, call I2CMaster_SetTimeout.To change the bus speed for operations on the master interface, call I2CMaster_SetBusSpeed.Update the settings for an I2C master interfaceĪfter you open the master interface, you can change the settings: The following excerpt shows how to specify the same I2C master interfaces in an application that targets the Avnet MT3620 Starter Kit: "I2cMaster": īefore you perform operations on an I2C master interface, you must open it by calling the I2CMaster_Open function. The compiler will translate these values to raw values when you build the app.įor example, here's an excerpt from an application manifest that targets an MT3620 reference development board (RDB) and configures two I2C master interfaces: "I2cMaster": , In your code, use the constants that are defined for your hardware to identify the I2C interfaces. Azure Sphere application manifest has more details about the application manifest. This enables the application to access the interface. To use the I2C APIs, you must add the I2cMaster capability to the application manifest, and then add each I2C master interface to the capability. Replace "path-to-your-target-hardware.h" with the path to the header file for your hardware. This specifies the struct version that is used by the application. #include "path-to-your-target-hardware.h"ĭeclare the I2C_STRUCTS_VERSION preprocessor definition before including the header file. Header Files #define I2C_STRUCTS_VERSION 1 I2C RequirementsĪpplications that use I2C must include the appropriate header files for I2C, and add I2C settings to the application manifest.Īll applications must set their target hardware and include the corresponding hardware definition header file. The LSM6DS3 I2C sample describes how to configure the hardware for I2C on an MT3620 device and use I2C in an application. I2C is often used with peripherals that only require simple lightweight communication with a microcontroller, such as setting controls, power switches, and sensors.Īpplications can access peripherals through I2C by calling Applibs I2C APIs to perform operations on an I2C master interface. I2C uses a multi-master/multi-subordinate model where a master device controls a set of subordinate devices. I2C is a serial bus that connects lower-speed peripherals to microcontrollers. Azure Sphere supports Inter-Integrated Circuit (I2C) in master mode.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |