pynq.lib.rgbled Module

The pynq.lib.rgbled module is a driver for controlling onboard Red-Green-Blue (RGB) Light Emitting Diodes (LEDs).

class pynq.lib.rgbled.RGBLED(index, ip_name='rgbleds_gpio', start_index=inf, device=None)[source]

Bases: object

This class controls the onboard RGB LEDs.

index

The index of the RGB LED. Can be an arbitrary value.

Type:

int

_mmio

Shared memory map for the RGBLED GPIO controller.

Type:

MMIO

_rgbleds_val

Global value of the RGBLED GPIO pins.

Type:

int

_rgbleds_start_index

Global value representing the lowest index for RGB LEDs

Type:

int

off()[source]

Turn off a single RGBLED.

Return type:

None

on(color)[source]

Turn on a single RGB LED with a color value (see color constants).

Parameters:

color (int) – Color of RGB specified by a 3-bit RGB integer value.

Return type:

None

read()[source]

Retrieve the RGBLED state.

Returns:

The color value stored in the RGBLED.

Return type:

int

write(color)[source]

Set the RGBLED state according to the input value.

Parameters:

color (int) – Color of RGB specified by a 3-bit RGB integer value.

Return type:

None