spynnaker.pyNN.protocols package

Module contents

class spynnaker.pyNN.protocols.MUNICH_MODES(value)

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]
Returns:

Command to disable the motor.

static disable_retina() bytes[source]
Returns:

Command to disable the retina.

static enable_motor() bytes[source]
Returns:

Command to enable the motor.

static enable_retina() bytes[source]
Returns:

Command to enable the retina.

static laser_active_time(active_time: int) bytes[source]
Parameters:

active_time

Returns:

Command to set the laser active time

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

frequency

Returns:

Command to set the laser periods based on the frequency.

static laser_total_period(total_period: int) bytes[source]
Parameters:

total_period

Returns:

Command to set the laser total period

static led_back_active_time(active_time: int) bytes[source]
Parameters:

active_time

Returns:

Command to set the led back time

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

frequency

Returns:

Command to set the led times based on frequency

static led_front_active_time(active_time: int) bytes[source]
Parameters:

active_time

Returns:

Command to set the led front time

static led_total_period(total_period: int) bytes[source]
Parameters:

total_period

:returns:Command to set the led total time

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

Returns:

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

Returns:

Command to set the motor 0 permanent velocity

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

Returns:

Command to set the motor 1 leaky velocity.

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

Returns:

Command to set the motor 1 permanent velocity.

static set_retina_transmission(event_format: int) bytes[source]
Parameters:

event_format

Returns:

Command to set the retina transmission.

static speaker_active_time(active_time: int) bytes[source]
Parameters:

active_time

Returns:

Command to set the speaker active time.

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

frequency

Returns:

Command to set the speaker times based on frequency.

static speaker_total_period(total_period: int) bytes[source]
Parameters:

total_period

Returns:

Command to set the speaker total time.

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 – The mode of operation of the protocol

  • instance_key – The optional instance key to use

  • uart_id – The ID of the UART when needed

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

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

Returns:

Command to add payload logic to current output.

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

  • bias_value

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

Returns:

Command to bias level.

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

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

Returns:

Command to configure master key.

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

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

Returns:

Command to disable retina.

property disable_retina_key: int

Key to disable the retina.

property enable_disable_motor_key: int

Get key to disable motor.

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

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

Returns:

Command to set generic motor 0 raw output leak to 0.

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

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

Returns:

Command to set generic motor 0 raw output permanent.

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

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

Returns:

Command to set generic motor 1 raw output leak to 0.

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

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

Returns:

Command to set generic motor 1 raw output permanent.

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

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

Returns:

Command to disable motor.

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

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

Returns:

Command to enable motor.

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

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

Returns:

Command to set motor total period.

property instance_key: int

The instance key to use

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

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

Returns:

Command to set master clock active.

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

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

Returns:

Command to set master clock active.

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

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

Returns:

Command to set slave.

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

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

Returns:

Command to set internal counter used.

property mode: MUNICH_MODES

spynnaker.pyNN.protocols.MUNICH_MODES

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

  • time_in_ms – time to sensor

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

Returns:

Command to sensor continuously.

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

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

Returns:

Command to poll sensor once.

push_bot_laser_config_active_time(active_time: int, time: int | None = None) MultiCastCommand[source]
Parameters:
  • active_time – The time for the laser

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

Returns:

Command to set the laser active time.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_laser_config_active_time_key: int

The key to set the laser active time.

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

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

Returns:

Command to set the laser total period.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_laser_config_total_period_key: int

The key to set the laser total period.

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

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

Returns:

Command to set the laser frequency.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_laser_set_frequency_key: int

The key to set the frequency.

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

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

Returns:

Command to set the back led active time.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_led_back_active_time_key: int

The key to set the back led active time.

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

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

Returns:

Command to set the front led active time.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_led_front_active_time_key: int

The key to set the front led active time.

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

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

Returns:

Command to set the led frequency.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_led_set_frequency_key: int

The key to set the led frequency.

push_bot_led_total_period(total_period: int, time: int | None = None) MultiCastCommand[source]
Parameters:
  • total_period – total period for the LED

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

Returns:

Command to set the total led period.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_led_total_period_key: int

The key to set the total led period.

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

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

Returns:

Command to change motor 0 towards zero.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_motor_0_leaking_towards_zero_key: int

The key for the change motor 0 towards zero.

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

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

Returns:

Command to change motor 0 permanently.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_motor_0_permanent_key: int

The key for the change motor 0 permanently.

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

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

Returns:

Command to change motor 1 towards zero.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_motor_1_leaking_towards_zero_key: int

The key for the change motor 1 towards zero.

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

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

Returns:

Command to change motor 1 permanently.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_motor_1_permanent_key: int

The key for the change motor 1 permanently.

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

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

Returns:

Command to set the speaker active time.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_speaker_config_active_time_key: int

The key to set the speaker active time.

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

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

Returns:

Command to set the speaker total period.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_speaker_config_total_period_key: int

The key to set the speaker total period.

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

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

Returns:

Command to set the melody.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_speaker_set_melody_key: int

The key to set the melody.

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

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

Returns:

Command to set the tone.

Raises:

ConfigurationException – If the mode is not PUSH_BOT

property push_bot_speaker_set_tone_key: int

The key to set the tone.

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

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

Returns:

Command to set a channel 0 output timer.

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

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

Returns:

Command to set a channel 1 output timer.

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

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

Returns:

Command to set a output timer duration.

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

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

Returns:

Command to set b channel 0 output timer.

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

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

Returns:

Command to set b channel 1 output timer.

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

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

Returns:

Command to set b output timer duration.

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

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

Returns:

Command to set c channel 0 output timer.

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

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

Returns:

Command to set c channel 1 output timer.

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

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

Returns:

Command to set c output timer duration.

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

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

Returns:

Command to query state of io lines.

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

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

Returns:

Command to remove payload logic to current output.

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

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

Returns:

Command to reset retina.

sensor_transmission_key(sensor_id: int) int[source]
Parameters:

sensor_id

Returns:

The transmission key to this sensor id.

static sent_mode_command() bool[source]
Returns:

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

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

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

Returns:

The set mode. And records it was provided.

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

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

Returns:

Command to set output pattern for payload.

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

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

Returns:

Command to set the payload pins to high impedance.

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

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

Returns:

Command to set retina key.

property set_retina_key_key: int

Key to set retina key.

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

Set the retina transmission key.

Parameters:
  • retina_key – the new key for the retina

  • retina_payload – the new payload for the set retina key command packet

  • time – when to transmit this packet

Returns:

the command to send

property set_retina_transmission_key: int

The key to set the retina_transmission.

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

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

Returns:

Command to turn off sensor reporting.

property uart_id: int

The ID of the UART when needed

class spynnaker.pyNN.protocols.RetinaKey(value)

Bases: Enum

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

Parameters:
  • ident – The ID of the enum

  • pixels – number of pixels per retina dimension

  • bits_per_coordinate – number of bits per retina dimension

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

The bits per coordinate passed into the init.

property ident: int

The identification passed into the init.

property n_neurons: int

The number of neurons passed into the init.

property pixels: int

The pixels passed into the init.

class spynnaker.pyNN.protocols.RetinaPayload(value)

Bases: Enum

The indent and number of payload bytes for retina actions.

Parameters:
  • ident – ID for the enum

  • n_payload_bytes – 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

The indent passed into the init.

property n_payload_bytes: int

The n_payload_bytes passed into the init.