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:
EnumTypes 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:
objectImplementation of the Munich robot IO protocol, communicating over Ethernet.
- static laser_frequency(frequency: int | float) bytes[source]¶
Command to set the laser periods based on the frequency.
- static led_frequency(frequency: int | float) bytes[source]¶
Command to set the led times based on frequency
- 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.
- 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.
- 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.
- 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.
- static set_retina_transmission(event_format: int) bytes[source]¶
Command to set the retina transmission.
- class spynnaker.pyNN.protocols.MunichIoSpiNNakerLinkProtocol(mode: MUNICH_MODES, instance_key: int | None = None, uart_id: int = 0)¶
Bases:
objectProvides 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.
- bias_values(bias_id: int, bias_value: int, time: int | None = None) MultiCastCommand[source]¶
Get command to bias level.
- configure_master_key(new_key: int, time: int | None = None)[source]¶
Get command to configure master key.
- 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
Noneif this is not a timed command- Return type:
MultiCastCommand
- 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
Noneif 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.
- generic_motor0_raw_output_permanent(pwm_signal: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set generic motor 0 raw output permanently.
- 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.
- generic_motor1_raw_output_permanent(pwm_signal: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set generic motor 1 raw output permanently.
- 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
Noneif 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
Noneif 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.
- 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
Noneif 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
Noneif 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
Noneif 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
Noneif this is not a timed command- Return type:
MultiCastCommand
- property mode: MUNICH_MODES¶
- Return type:
- poll_individual_sensor_continuously(sensor_id: int, time_in_ms: int, time: int | None = None) MultiCastCommand[source]¶
Get command to sensor continuously.
- poll_sensors_once(sensor_id: int, time: int | None = None) MultiCastCommand[source]¶
Get command to sensor once.
- push_bot_laser_config_active_time(active_time: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set the laser active time.
- property push_bot_laser_config_active_time_key: int¶
Gets the key to set the laser active time.
- Return type:
- 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
Noneif 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:
- push_bot_laser_set_frequency(frequency: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set the frequency
- push_bot_led_back_active_time(active_time: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set the back led active time.
- property push_bot_led_back_active_time_key: int¶
Gets the key to set the back led active time.
- Return type:
- push_bot_led_front_active_time(active_time: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set the front led active time.
- property push_bot_led_front_active_time_key: int¶
Gets the key to set the front led active time.
- Return type:
- push_bot_led_set_frequency(frequency: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set the led frequency
- push_bot_led_total_period(total_period: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set the total led period.
- push_bot_motor_0_leaking_towards_zero(velocity: int, time: int | None = None) MultiCastCommand[source]¶
Get command to change motor 0 towards zero.
- property push_bot_motor_0_leaking_towards_zero_key: int¶
Gets the key for the change motor 0 towards zero.
- Return type:
- push_bot_motor_0_permanent(velocity: int, time: int | None = None) MultiCastCommand[source]¶
Get command to change motor 0 permanently.
- property push_bot_motor_0_permanent_key: int¶
Gets the key for the change motor 0 permanently.
- Return type:
- push_bot_motor_1_leaking_towards_zero(velocity: int, time: int | None = None) MultiCastCommand[source]¶
Get command to change motor 1 towards zero.
- property push_bot_motor_1_leaking_towards_zero_key: int¶
Gets the key for the change motor 1 towards zero.
- Return type:
- push_bot_motor_1_permanent(velocity: int, time: int | None = None) MultiCastCommand[source]¶
Get command to change motor 1 permanently.
- property push_bot_motor_1_permanent_key: int¶
Gets the key for the change motor 1 permanently.
- Return type:
- push_bot_speaker_config_active_time(active_time: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set the speaker active time.
- property push_bot_speaker_config_active_time_key: int¶
Gets the key to set the speaker active time.
- Return type:
- push_bot_speaker_config_total_period(total_period: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set the speaker total period.
- property push_bot_speaker_config_total_period_key: int¶
Gets the key to set the speaker total period.
- Return type:
- push_bot_speaker_set_melody(melody: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set the melody.
- push_bot_speaker_set_tone(frequency: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set the tone.
- 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.
- 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.
- pwm_pin_output_timer_a_duration(timer_period: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set a output timer duration.
- 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.
- 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.
- pwm_pin_output_timer_b_duration(timer_period: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set b output timer duration.
- 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.
- 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.
- pwm_pin_output_timer_c_duration(timer_period: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set c output timer duration.
- 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
Noneif 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.
- 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
Noneif this is not a timed command- Return type:
MultiCastCommand
- 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
Noneif 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.
- set_payload_pins_to_high_impedance(payload: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set the payload pins to high impedance.
- set_retina_key(new_key: int, time: int | None = None) MultiCastCommand[source]¶
Get command to set retina key.
- 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
- Returns:
the command to send
- Return type:
- class spynnaker.pyNN.protocols.RetinaKey(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
EnumThe 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)¶
- class spynnaker.pyNN.protocols.RetinaPayload(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
EnumThe 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)¶