konashi package
Subpackages
- konashi.Builtin package
- konashi.Io package
- Submodules
- konashi.Io.AIO module
ADCRef
AIOPinConfig
AIOPinControl
AIOPinDirection
IDACRange
VDACRef
_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
HardPWMClock
HardPWMConfig
HardPWMPinControl
HardPWMPrescale
_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
BluetoothSettingsConnectionPhy
BluetoothSettingsExAdvertiseContents
BluetoothSettingsExAdvertiseContents.AIO0_IN
BluetoothSettingsExAdvertiseContents.AIO1_IN
BluetoothSettingsExAdvertiseContents.AIO2_IN
BluetoothSettingsExAdvertiseContents.AIO_IN_ALL
BluetoothSettingsExAdvertiseContents.BLE_ALL
BluetoothSettingsExAdvertiseContents.DEVICE_NAME
BluetoothSettingsExAdvertiseContents.GPIO0_IN
BluetoothSettingsExAdvertiseContents.GPIO1_IN
BluetoothSettingsExAdvertiseContents.GPIO2_IN
BluetoothSettingsExAdvertiseContents.GPIO3_IN
BluetoothSettingsExAdvertiseContents.GPIO4_IN
BluetoothSettingsExAdvertiseContents.GPIO5_IN
BluetoothSettingsExAdvertiseContents.GPIO6_IN
BluetoothSettingsExAdvertiseContents.GPIO7_IN
BluetoothSettingsExAdvertiseContents.GPIO_IN_ALL
BluetoothSettingsExAdvertiseContents.MANUF_DATA
BluetoothSettingsExAdvertiseContents.NONE
BluetoothSettingsExAdvertiseContents.UUID128
BluetoothSettingsExAdvertiseStatus
BluetoothSettingsFunction
BluetoothSettingsPrimaryPhy
BluetoothSettingsSecondaryPhy
_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:
object
This 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:
object
This 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]
konashi.KonashiElementBase module
- class konashi.KonashiElementBase._KonashiElementBase(konashi)
Bases:
object
- async _disable_notify(uuid: str) None
- async _enable_notify(uuid: str, cb: Callable[[int, bytearray], None]) None
- abstract async _on_connect() None
- async _read(uuid: str) None
- async _write(uuid: str, data: bytes) None