konashi package
Subpackages
- konashi.Builtin package
- konashi.Io package
- Submodules
- konashi.Io.AIO module
ADCRefAIOPinConfigAIOPinControlAIOPinDirectionIDACRangeVDACRef_AIO_AIO._calc_voltage_for_value()_AIO._ntf_cb_config()_AIO._ntf_cb_input()_AIO._ntf_cb_output()_AIO._on_connect()_AIO.calc_control_value_for_current()_AIO.calc_control_value_for_voltage()_AIO.config_adc_period()_AIO.config_adc_ref()_AIO.config_idac_range()_AIO.config_pins()_AIO.config_vdac_ref()_AIO.control_pins()_AIO.get_analog_config()_AIO.get_pins_config()_AIO.get_pins_control()_AIO.read_pins()_AIO.set_input_cb()
_AIOAllConfig_AIOConfig_AIOPinIn_AIOPinOut_AIOPinsIn_AIOPinsOut
- konashi.Io.GPIO module
- konashi.Io.HardPWM module
HardPWMClockHardPWMConfigHardPWMPinControlHardPWMPrescale_Config_HardPWM_HardPWM._calc_duty_for_control_value()_HardPWM._calc_pwm_config_for_period()_HardPWM._ntf_cb_config()_HardPWM._ntf_cb_output()_HardPWM._on_connect()_HardPWM.calc_control_value_for_duty()_HardPWM.config_pins()_HardPWM.config_pwm()_HardPWM.control_pins()_HardPWM.get_pins_config()_HardPWM.get_pins_control()_HardPWM.get_pwm_config()_HardPWM.set_transition_end_cb()
_HardPWMPinConfig_PinsControl
- konashi.Io.I2C module
- konashi.Io.SPI module
- konashi.Io.SoftPWM module
- konashi.Io.UART module
- Module contents
- konashi.Settings package
- Submodules
- konashi.Settings.Bluetooth module
BluetoothSettingsConnectionPhyBluetoothSettingsExAdvertiseContentsBluetoothSettingsExAdvertiseContents.AIO0_INBluetoothSettingsExAdvertiseContents.AIO1_INBluetoothSettingsExAdvertiseContents.AIO2_INBluetoothSettingsExAdvertiseContents.AIO_IN_ALLBluetoothSettingsExAdvertiseContents.BLE_ALLBluetoothSettingsExAdvertiseContents.DEVICE_NAMEBluetoothSettingsExAdvertiseContents.GPIO0_INBluetoothSettingsExAdvertiseContents.GPIO1_INBluetoothSettingsExAdvertiseContents.GPIO2_INBluetoothSettingsExAdvertiseContents.GPIO3_INBluetoothSettingsExAdvertiseContents.GPIO4_INBluetoothSettingsExAdvertiseContents.GPIO5_INBluetoothSettingsExAdvertiseContents.GPIO6_INBluetoothSettingsExAdvertiseContents.GPIO7_INBluetoothSettingsExAdvertiseContents.GPIO_IN_ALLBluetoothSettingsExAdvertiseContents.MANUF_DATABluetoothSettingsExAdvertiseContents.NONEBluetoothSettingsExAdvertiseContents.UUID128
BluetoothSettingsExAdvertiseStatusBluetoothSettingsFunctionBluetoothSettingsPrimaryPhyBluetoothSettingsSecondaryPhy_Bluetooth_BluetoothSettings_BluetoothSettings._fields__BluetoothSettings._pack__BluetoothSettings.enabled_functions_BluetoothSettings.ex_adv_contents_BluetoothSettings.ex_adv_prim_phy_BluetoothSettings.ex_adv_sec_phy_BluetoothSettings.ex_adv_status_BluetoothSettings.main_adv_sec_phy_BluetoothSettings.main_conn_pref_phy
- konashi.Settings.System module
- Module contents
Submodules
konashi.Errors module
- exception konashi.Errors.InvalidDeviceError
Bases:
Exception
- exception konashi.Errors.KonashiConnectionError
Bases:
Exception
- exception konashi.Errors.KonashiDisabledError
Bases:
Exception
- exception konashi.Errors.KonashiError
Bases:
Exception
- exception konashi.Errors.KonashiInvalidError
Bases:
Exception
- exception konashi.Errors.NotFoundError
Bases:
Exception
- exception konashi.Errors.PinInvalidError
Bases:
Exception
Bases:
Exception
konashi.Konashi module
- class konashi.Konashi.Konashi(name: str)
Bases:
objectThis class represents a single Konashi device.
- Parameters
name (str) – The name (BLE advertising name) of this Konashi device.
- async connect(timeout: float = 0.0) None
Connect to this Konashi device.
If the Konashi class instance was created directly by the user and not returned from a KonashiScanner,
KonashiScanner.find()will be called internally before the connection takes place. In this case, the passed timeout value is also used forKonashiScanner.find().- Parameters
timeout (float, optional) – The connection timeout in seconds. Defaults to 0.0.
- Raises
KonashiConnectionError – The Konashi device was found but the connection failed.
NotFoundError – The Konashi device was not found within the timeout time.
InvalidDeviceError – The specified device name was found but it does not appear to be a valid Konashi device.
- async disconnect() None
Disconnect from this Konashi device.
- property name: str
The name (Bluetooth advertising name) of this Konashi device.
- Returns
The Konashi device name.
- Return type
str
- class konashi.Konashi.KonashiScanner
Bases:
objectThis class represents a Konashi scanner.
- async static find(name: str, timeout: float = 0.0) Konashi
Find the Konashi device specified by name. This is a static method. If the timeout expires, NotFoundError is raised. If the timeout is 0.0, the search continues indefinitely.
- Parameters
name (str) – The Konashi device name to search for.
timeout (float, optional) – The search timeout in seconds. Defaults to 0.0.
- Raises
NotFoundError – The Konashi device was not found within the timeout time.
InvalidDeviceError – The specified device name was found but it does not appear to be a valid Konashi device.
- Returns
The found Konashi device.
- Return type
- property is_scanning: bool
Indicates if this scanner instance is currently scanning.
- Returns
True is the scanner is scanning, otherwise False.
- Return type
bool
- async scan_start(cb: Callable[[Konashi], None]) None
Start scanning for Konashi devices. The search continues until cancelled and the callback is called when a device is discovered.
- async scan_stop() None
- async static search(timeout: float = 10.0) List[Konashi]
Search for Konashi devices. The search continues for the specified timeout and a list of found devices is returned.
- Parameters
timeout (float, optional) – The search timeout in seconds, has to be longer than 0s. Defaults to 10.0.
- Raises
ValueError – The timeout value is invalid.
- Returns
A list of discovered Konashi devices.
- Return type
List[Konashi]