spynnaker.pyNN.protocols package

Module contents

class spynnaker.pyNN.protocols.MUNICH_MODES(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Types of modes supported by this protocol.

BALL_BALANCER = 3
FREE = 5
MY_ORO_BOTICS = 4
PUSH_BOT = 1
RESET_TO_DEFAULT = 0
SPOMNIBOT = 2
class spynnaker.pyNN.protocols.MunichIoEthernetProtocol

Bases: object

Implementation of the Munich robot IO protocol, communicating over Ethernet.

static disable_motor() bytes[source]

Command to disable the motor.

Return type:

bytes

static disable_retina() bytes[source]

Command to disable the retina.

Return type:

bytes

static enable_motor() bytes[source]

Command to enable the motor.

Return type:

bytes

static enable_retina() bytes[source]

Command to enable the retina.

Return type:

bytes

static laser_active_time(active_time: int) bytes[source]

Command to set the laser active time

Parameters:

active_time (int)

Return type:

bytes

static laser_frequency(frequency: int | float) bytes[source]

Command to set the laser periods based on the frequency.

Parameters:

frequency (float)

Return type:

bytes

static laser_total_period(total_period: int) bytes[source]

Command to set the laser total period

Parameters:

total_period (int)

Return type:

bytes

static led_back_active_time(active_time: int) bytes[source]

Command to set the led back time

Parameters:

active_time (int)

Return type:

bytes

static led_frequency(frequency: int | float) bytes[source]

Command to set the led times based on frequency

Parameters:

frequency (float)

Return type:

bytes

static led_front_active_time(active_time: int) bytes[source]

Command to set the led front time

Parameters:

active_time (int)

Return type:

bytes

static led_total_period(total_period: int) bytes[source]

Command to set the led total time

Parameters:

total_period (int)

Return type:

bytes

static motor_0_leaky_velocity(velocity: int) bytes[source]

Command to set the motor 0 leaky velocity.

The value will be restricted to be between -100 and 100.

Parameters:

velocity (int)

Return type:

bytes

static motor_0_permanent_velocity(velocity: int) bytes[source]

Command to set the motor 0 permanent velocity.

The value will be restricted to be between -100 and 100.

Parameters:

velocity (int)

Return type:

bytes

static motor_1_leaky_velocity(velocity: int) bytes[source]

Command to set the motor 1 leaky velocity.

The value will be restricted to be between -100 and 100.

Parameters:

velocity (int)

Return type:

bytes

static motor_1_permanent_velocity(velocity: int) bytes[source]

Command to set the motor 1 permanent velocity.

The value will be restricted to be between -100 and 100.

Parameters:

velocity (int)

Return type:

bytes

static set_retina_transmission(event_format: int) bytes[source]

Command to set the retina transmission.

Parameters:

event_format (int)

Return type:

bytes

static speaker_active_time(active_time: int) bytes[source]

Command to set the speaker active time.

Parameters:

active_time (int)

Return type:

bytes

static speaker_frequency(frequency: int | float) bytes[source]

Command to set the speaker times based on frequency.

Parameters:

frequency (float)

Return type:

bytes

static speaker_total_period(total_period: int) bytes[source]

Command to set the speaker total time.

Parameters:

total_period (int)

Return type:

bytes

class spynnaker.pyNN.protocols.MunichIoSpiNNakerLinkProtocol(mode: MUNICH_MODES, instance_key: int | None = None, uart_id: int = 0)

Bases: object

Provides Multicast commands for the Munich SpiNNaker-Link protocol.

Parameters:
  • mode (MUNICH_MODES) – The mode of operation of the protocol

  • instance_key (int or None) – The optional instance key to use

  • uart_id (int) – The ID of the UART when needed

add_payload_logic_to_current_output(payload: int, time: int | None = None) MultiCastCommand[source]

Get command to add payload logic to current output.

Parameters:
  • payload (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

bias_values(bias_id: int, bias_value: int, time: int | None = None) MultiCastCommand[source]

Get command to bias level.

Parameters:
  • bias_id (int)

  • bias_value (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

configure_master_key(new_key: int, time: int | None = None)[source]

Get command to configure master key.

Parameters:
  • new_key (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

disable_retina(time: int | None = None) MultiCastCommand[source]

Get command to disable the retina.

Parameters:

time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

property disable_retina_key: int

Get key to disable the retina.

Return type:

int

property enable_disable_motor_key: int

Get key to disable motor.

Parameters:

time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

generic_motor0_raw_output_leak_to_0(pwm_signal: int, time: int | None = None) MultiCastCommand[source]

Get command to set generic motor 0 raw output leak to 0.

Parameters:
  • pwm_signal (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

generic_motor0_raw_output_permanent(pwm_signal: int, time: int | None = None) MultiCastCommand[source]

Get command to set generic motor 0 raw output permanently.

Parameters:
  • pwm_signal (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

generic_motor1_raw_output_leak_to_0(pwm_signal: int, time: int | None = None) MultiCastCommand[source]

Get command to set generic motor 1 raw output leak to 0.

Parameters:
  • pwm_signal (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

generic_motor1_raw_output_permanent(pwm_signal: int, time: int | None = None) MultiCastCommand[source]

Get command to set generic motor 1 raw output permanently.

Parameters:
  • pwm_signal (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

generic_motor_disable(time: int | None = None) MultiCastCommand[source]

Get command to disable motor.

Parameters:

time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

generic_motor_enable(time: int | None = None) MultiCastCommand[source]

Get command to enable motor.

Parameters:

time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

generic_motor_total_period(time_in_ms: int, time: int | None = None) MultiCastCommand[source]

Get command to set motor total period.

Parameters:
  • time_in_ms (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

property instance_key: int

The key of this instance of the protocol.

Return type:

int

master_slave_set_master_clock_active(time: int | None = None) MultiCastCommand[source]

Get command to set master clock active.

Parameters:

time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

master_slave_set_master_clock_not_started(time: int | None = None) MultiCastCommand[source]

Get command to set master clock active.

Parameters:

time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

master_slave_set_slave(time: int | None = None) MultiCastCommand[source]

Get command to set slave.

Parameters:

time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

master_slave_use_internal_counter(time: int | None = None) MultiCastCommand[source]

Get command to set internal counter used.

Parameters:

time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

property mode: MUNICH_MODES
Return type:

MUNICH_MODES

poll_individual_sensor_continuously(sensor_id: int, time_in_ms: int, time: int | None = None) MultiCastCommand[source]

Get command to sensor continuously.

Parameters:
  • sensor_id (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

poll_sensors_once(sensor_id: int, time: int | None = None) MultiCastCommand[source]

Get command to sensor once.

Parameters:
  • sensor_id (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

push_bot_laser_config_active_time(active_time: int, time: int | None = None) MultiCastCommand[source]

Get command to set the laser active time.

Parameters:
  • frequency (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_laser_config_active_time_key: int

Gets the key to set the laser active time.

Return type:

int

push_bot_laser_config_total_period(total_period: int, time: int | None = None) MultiCastCommand[source]

Get command to set the laser total period.

Parameters:
  • period (int total)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_laser_config_total_period_key: int

Gets the key to set the laser total period.

Return type:

int

push_bot_laser_set_frequency(frequency: int, time: int | None = None) MultiCastCommand[source]

Get command to set the frequency

Parameters:
  • frequency (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_laser_set_frequency_key: int

Gets the key to set the frequency.

Return type:

int

push_bot_led_back_active_time(active_time: int, time: int | None = None) MultiCastCommand[source]

Get command to set the back led active time.

Parameters:
  • active_time (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_led_back_active_time_key: int

Gets the key to set the back led active time.

Return type:

int

push_bot_led_front_active_time(active_time: int, time: int | None = None) MultiCastCommand[source]

Get command to set the front led active time.

Parameters:
  • active_time (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_led_front_active_time_key: int

Gets the key to set the front led active time.

Return type:

int

push_bot_led_set_frequency(frequency: int, time: int | None = None) MultiCastCommand[source]

Get command to set the led frequency

Parameters:
  • frequency (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_led_set_frequency_key: int

Gets the key to set the led frequency.

Return type:

int

push_bot_led_total_period(total_period: int, time: int | None = None) MultiCastCommand[source]

Get command to set the total led period.

Parameters:
  • active_time (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_led_total_period_key: int

Gets the key to set the total led period.

Return type:

int

push_bot_motor_0_leaking_towards_zero(velocity: int, time: int | None = None) MultiCastCommand[source]

Get command to change motor 0 towards zero.

Parameters:
  • velocity (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_motor_0_leaking_towards_zero_key: int

Gets the key for the change motor 0 towards zero.

Return type:

int

push_bot_motor_0_permanent(velocity: int, time: int | None = None) MultiCastCommand[source]

Get command to change motor 0 permanently.

Parameters:
  • velocity (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_motor_0_permanent_key: int

Gets the key for the change motor 0 permanently.

Return type:

int

push_bot_motor_1_leaking_towards_zero(velocity: int, time: int | None = None) MultiCastCommand[source]

Get command to change motor 1 towards zero.

Parameters:
  • velocity (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_motor_1_leaking_towards_zero_key: int

Gets the key for the change motor 1 towards zero.

Return type:

int

push_bot_motor_1_permanent(velocity: int, time: int | None = None) MultiCastCommand[source]

Get command to change motor 1 permanently.

Parameters:
  • velocity (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_motor_1_permanent_key: int

Gets the key for the change motor 1 permanently.

Return type:

int

push_bot_speaker_config_active_time(active_time: int, time: int | None = None) MultiCastCommand[source]

Get command to set the speaker active time.

Parameters:
  • active_time (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_speaker_config_active_time_key: int

Gets the key to set the speaker active time.

Return type:

int

push_bot_speaker_config_total_period(total_period: int, time: int | None = None) MultiCastCommand[source]

Get command to set the speaker total period.

Parameters:
  • total_period (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_speaker_config_total_period_key: int

Gets the key to set the speaker total period.

Return type:

int

push_bot_speaker_set_melody(melody: int, time: int | None = None) MultiCastCommand[source]

Get command to set the melody.

Parameters:
  • melody (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_speaker_set_melody_key: int

Gets the key to set the melody.

Return type:

int

push_bot_speaker_set_tone(frequency: int, time: int | None = None) MultiCastCommand[source]

Get command to set the tone.

Parameters:
  • frequency (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_speaker_set_tone_key: int

Gets the key to set the tone.

Return type:

int

pwm_pin_output_timer_a_channel_0_ratio(timer_period: int, time: int | None = None) MultiCastCommand[source]

Get command to set a channel 0 output timer.

Parameters:
  • timer_period (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

pwm_pin_output_timer_a_channel_1_ratio(timer_period: int, time: int | None = None) MultiCastCommand[source]

Get command to set a channel 1 output timer.

Parameters:
  • timer_period (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

pwm_pin_output_timer_a_duration(timer_period: int, time: int | None = None) MultiCastCommand[source]

Get command to set a output timer duration.

Parameters:
  • timer_period (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

pwm_pin_output_timer_b_channel_0_ratio(timer_period: int, time: int | None = None) MultiCastCommand[source]

Get command to set b channel 0 output timer.

Parameters:
  • timer_period (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

pwm_pin_output_timer_b_channel_1_ratio(timer_period: int, time: int | None = None) MultiCastCommand[source]

Get command to set b channel 1 output timer.

Parameters:
  • timer_period (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

pwm_pin_output_timer_b_duration(timer_period: int, time: int | None = None) MultiCastCommand[source]

Get command to set b output timer duration.

Parameters:
  • timer_period (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

pwm_pin_output_timer_c_channel_0_ratio(timer_period: int, time: int | None = None) MultiCastCommand[source]

Get command to set c channel 0 output timer.

Parameters:
  • timer_period (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

pwm_pin_output_timer_c_channel_1_ratio(timer_period: int, time: int | None = None) MultiCastCommand[source]

Get command to set c channel 1 output timer.

Parameters:
  • timer_period (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

pwm_pin_output_timer_c_duration(timer_period: int, time: int | None = None) MultiCastCommand[source]

Get command to set c output timer duration.

Parameters:
  • timer_period (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

query_state_of_io_lines(time: int | None = None) MultiCastCommand[source]

Get command to query state of io lines.

Parameters:

time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

remove_payload_logic_to_current_output(payload: int, time: int | None = None) MultiCastCommand[source]

Get command to remove payload logic to current output.

Parameters:
  • payload (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

reset_retina(time: int | None = None) MultiCastCommand[source]

Get command to reset retina.

Parameters:

time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

sensor_transmission_key(sensor_id: int) int[source]

Get the transmission key to this sensor id.

Parameters:

sensor_id (int)

Return type:

int

static sent_mode_command() bool[source]

True if the mode command has ever been requested by any instance.

set_mode(time: int | None = None) MultiCastCommand[source]

Gets the set mode. And records it was provided.

Parameters:

time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

set_output_pattern_for_payload(payload: int, time: int | None = None) MultiCastCommand[source]

Get command to set output pattern for payload.

Parameters:
  • payload (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

set_payload_pins_to_high_impedance(payload: int, time: int | None = None) MultiCastCommand[source]

Get command to set the payload pins to high impedance.

Parameters:
  • payload (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

set_retina_key(new_key: int, time: int | None = None) MultiCastCommand[source]

Get command to set retina key.

Parameters:
  • new_key (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

property set_retina_key_key: int

Get key to set retina key.

Return type:

int

set_retina_transmission(retina_key: RetinaKey = RetinaKey.NATIVE_128_X_128, retina_payload: RetinaPayload | None = None, time: int | None = None) MultiCastCommand[source]

Set the retina transmission key.

Parameters:
  • retina_key (RetinaKey) – the new key for the retina

  • retina_payload (RetinaPayload or None) – the new payload for the set retina key command packet

  • time (int or float or None) – when to transmit this packet

Returns:

the command to send

Return type:

MultiCastCommand

property set_retina_transmission_key: int

Get the key to set the retina_transmission.

Return type:

int

turn_off_sensor_reporting(sensor_id: int, time: int | None = None) MultiCastCommand[source]

Get command to turn off sensor reporting.

Parameters:
  • sensor_id (int)

  • time (int or None) – The time within the simulation at which to send the command, or None if this is not a timed command

Return type:

MultiCastCommand

property uart_id: int
Return type:

int

class spynnaker.pyNN.protocols.RetinaKey(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

The identification, pixels and buts per coordinate for each retina action.

DOWNSAMPLE_16_X_16 = (4, 16, 4)
DOWNSAMPLE_32_X_32 = (3, 32, 5)
DOWNSAMPLE_64_X_64 = (2, 64, 6)
FIXED_KEY = (0, 128, 7)
NATIVE_128_X_128 = (1, 128, 7)
property bits_per_coordinate: int

Gets the bits per coordinate passed into the init.

Return type:

int

property ident: int

Gets the identification passed into the init.

Return type:

int

property n_neurons: int

Gets the number or neurons passed into the init.

Return type:

int

property pixels: int

Get the pixels passed into the init.

Return type:

int

class spynnaker.pyNN.protocols.RetinaPayload(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

The indent and number of payload bytes for retina actions.

ABSOLUTE_2_BYTE_TIMESTAMPS = (2, 2)
ABSOLUTE_3_BYTE_TIMESTAMPS = (3, 3)
ABSOLUTE_4_BYTE_TIMESTAMPS = (4, 4)
DELTA_TIMESTAMPS = (1, 4)
EVENTS_IN_PAYLOAD = (0, 4)
NO_PAYLOAD = (0, 0)
property ident: int

Gets the indent passed into the init.

Return type:

int

property n_payload_bytes: int

Gets the n_payload_bytes passed into the init.

Return type:

int