EasyMCP2221
Device
EasyMCP2221.Device.set_pin_function
EasyMCP2221.Device.save_config
EasyMCP2221.Device.GPIO_read
EasyMCP2221.Device.GPIO_write
EasyMCP2221.Device.ADC_read
EasyMCP2221.Device.ADC_config
EasyMCP2221.Device.DAC_write
EasyMCP2221.Device.DAC_config
EasyMCP2221.Device.IOC_config
EasyMCP2221.Device.IOC_read
EasyMCP2221.Device.IOC_clear
EasyMCP2221.Device.clock_config
EasyMCP2221.Device.I2C_Slave
EasyMCP2221.Device.I2C_write
EasyMCP2221.Device.I2C_read
EasyMCP2221.Device.I2C_speed
EasyMCP2221.Device.enable_power_management
EasyMCP2221.Device.reset
EasyMCP2221.Device.read_flash_info
EasyMCP2221.Device.revision
EasyMCP2221.Device.SRAM_config
EasyMCP2221.Device.send_cmd
EasyMCP2221.Device._i2c_release
EasyMCP2221.Device._i2c_status
EasyMCP2221.Device.cmd_retries
EasyMCP2221.Device.debug_messages
EasyMCP2221.Device.trace_packets
To capture EasyMCP2221.exceptions you must qualify them as EasyMCP2221.exceptions
:
try:
mcp.I2C_read(0x51, 1)
except EasyMCP2221.exceptions.NotAckError:
print("No device")
exit()
except EasyMCP2221.exceptions.LowSCLError:
print("SCL low")
or import them explicitly:
from EasyMCP2221.exceptions import *
...
try:
mcp.I2C_read(0x51, 1)
except NotAckError:
print("No device")
exit()
except LowSCLError:
print("SCL low")
EasyMCP2221.exceptions.NotAckError
EasyMCP2221.exceptions.TimeoutError
EasyMCP2221.exceptions.LowSCLError
EasyMCP2221.exceptions.LowSDAError