aardvark
Description
An aardvark
object represents a connection to a Total Phase®
Aardvark I2C/SPI™ Host Adapter. The Aardvark™ controller can have one or more I2C peripheral devices
connected to it. To configure and communicate with a peripheral device on the Aardvark controller, you must first create an
aardvark
object and then use the device
function. You can connect to multiple peripheral devices with a single
aardvark
object. The aardvark
object in MATLAB® always has the I2C controller role and cannot be used in the peripheral
role.
Note
To use the aardvark
interface, you must have the Instrument Control Toolbox™ Support Package for Total Phase
Aardvark I2C/SPI Interface installed. For more information, see Install Instrument Control Toolbox Support Package for Total Phase Aardvark I2C/SPI Interface.
Creation
Syntax
Description
controller = aardvark(
creates
a connection to the Total Phase
Aardvark I2C/SPI Host Adapter specified by the serial
number serialNumber
)serialNumber
. You can find the serial number for your
Aardvark controller by calling the
aardvarklist
function.
The input serialNumber
sets the SerialNumber property.
controller = aardvark(
creates a connection to the Aardvark controller board
and sets properties using one or more name-value arguments, where serialNumber
,Name=Value
)Name
is the property name and Value
is the corresponding value. Set the
EnablePullupResistors and EnableTargetPower properties using name-value arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is the
property name and Value
is the corresponding value. Name-value
arguments must appear after other arguments, but the order of the arguments does not
matter.
controller = aardvark
, without arguments, attempts to create a
connection to the last successfully connected Aardvark controller board. If you have not previously connected to an
Aardvark controller, using this syntax creates a
connection to the first available controller in the aardvarklist
output.
Properties
Object Functions
configureDigitalPin | Set digital pin mode on controller |
readDigitalPin | Read logic level value of digital pin on controller |
writeDigitalPin | Write logic level value to digital pin on controller |
scanI2CBus | Scan for I2C peripheral devices connected to controller board |
Examples
Version History
Introduced in R2023aSee Also
aardvarklist
| aardvarkfind
| ni845x
| scanI2CBus
| device