pynq.lib.rpi Package

The pynq.lib.rpi package is a collection of drivers for controlling peripherals attached to a RPi interface. The RPi interface can control Raspberry Pi peripherals.

pynq.lib.rpi Module

class pynq.lib.rpi.rpi.Rpi(mb_info, mb_program)[source]

Bases: pynq.lib.pynqmicroblaze.pynqmicroblaze.PynqMicroblaze

This class controls the Raspberry Pi Microblaze instances in the system.

This class inherits from the PynqMicroblaze class. It extends PynqMicroblaze with capability to control Raspberry Pi devices.

ip_name

The name of the IP corresponding to the Microblaze.

Type:str
rst_name

The name of the reset pin for the Microblaze.

Type:str
mb_program

The absolute path of the Microblaze program.

Type:str
state

The status (IDLE, RUNNING, or STOPPED) of the Microblaze.

Type:str
reset_pin

The reset pin associated with the Microblaze.

Type:GPIO
mmio

The MMIO instance associated with the Microblaze.

Type:MMIO
interrupt

An asyncio.Event-like class for waiting on and clearing interrupts.

Type:Event
read_mailbox(data_offset, num_words=1)[source]

This method reads mailbox data from the Microblaze.

Parameters:
  • data_offset (int) – The offset for mailbox data, 0,4,… for MAILBOX 0,1,…
  • num_words (int) – Number of 32b words to read from Microblaze mailbox.
Returns:

An int of a list of data read from the mailbox.

Return type:

int/list

write_blocking_command(command)[source]

This method writes a blocking command to the Microblaze.

The program waits in the loop until the command is cleared by the Microblaze.

Parameters:command (int) – The command to write to the Microblaze.
Returns:
Return type:None
write_mailbox(data_offset, data)[source]

This method write data into the mailbox of the Microblaze.

Parameters:
  • data_offset (int) – The offset for mailbox data, 0,4,… for MAILBOX 0,1,…
  • data (int/list) – A list of 32b words to be written into the mailbox.
Returns:

Return type:

None

write_non_blocking_command(command)[source]

This method writes a non-blocking command to the Microblaze.

The program will just send the command and returns the control immediately.

Parameters:command (int) – The command to write to the Microblaze.
Returns:
Return type:None