Skip to content

Commit

Permalink
Merge pull request #172 from CytronTechnologies/add_baudrate_option
Browse files Browse the repository at this point in the history
Added option to set the SPI baudrate.
  • Loading branch information
tannewt authored Oct 22, 2024
2 parents 9000b5a + 064947c commit 109f664
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion adafruit_wiznet5k/adafruit_wiznet5k.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def __init__(
mac: Union[MacAddressRaw, str] = _DEFAULT_MAC,
hostname: Optional[str] = None,
debug: bool = False,
spi_baudrate: int = 8000000,
) -> None:
"""
:param busio.SPI spi_bus: The SPI bus the Wiznet module is connected to.
Expand All @@ -207,10 +208,14 @@ def __init__(
:param str hostname: The desired hostname, with optional {} to fill in the MAC
address, defaults to None.
:param bool debug: Enable debugging output, defaults to False.
:param int spi_baudrate: The SPI clock frequency, defaults to 8MHz.
Might not be the actual baudrate, dependent on the hardware.
"""
self._debug = debug
self._chip_type = None
self._device = SPIDevice(spi_bus, cs, baudrate=8000000, polarity=0, phase=0)
self._device = SPIDevice(
spi_bus, cs, baudrate=spi_baudrate, polarity=0, phase=0
)
# init c.s.
self._cs = cs

Expand Down

0 comments on commit 109f664

Please sign in to comment.