Skip to content

Speedup and new boards #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions examples/LAN8651-iperf/LAN8651-iperf.ino
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,19 @@ static T1SMacSettings const t1s_mac_settings{MAC_PROMISCUOUS_MODE, MAC_TX_CUT_TH
* GLOBAL VARIABLES
**************************************************************************************/

#ifdef ARDUINO_GIGA
auto const tc6_io = new TC6::TC6_Io
( SPI1
, CS_PIN
, RESET_PIN
, IRQ_PIN);
#else
auto const tc6_io = new TC6::TC6_Io
( SPI
, CS_PIN
, RESET_PIN
, IRQ_PIN);
#endif
auto const tc6_inst = new TC6::TC6_Arduino_10BASE_T1S(tc6_io);

/**************************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ sentence=Generic library for providing IP based 10BASE-T1S communication.
paragraph=This Arduino library provides both low-level drivers and high-level abstractions to perform real-time communication via 10BASE-T1S, a multi-drop capable Ethernet standard.
category=Communication
url=https://github.com/arduino-libraries/Arduino_10BASE_T1S
architectures=samd,renesas_uno
architectures=samd,renesas_uno,mbed_giga
2 changes: 1 addition & 1 deletion src/Arduino_10BASE_T1S.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
static int const CS_PIN = 10;
static int const RESET_PIN = 9;
static int const IRQ_PIN = 2;
#elif defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_MINIMA) || defined(ARDUINO_UNOWIFIR4) || defined(ARDUINO_AVR_UNO_WIFI_REV2)
#elif defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_MINIMA) || defined(ARDUINO_UNOWIFIR4) || defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_GIGA)
/* Those are all boards with the Arduino Uno form factor for the T1S shield. */
static int const CS_PIN = 9;
static int const RESET_PIN = 4;
Expand Down
6 changes: 6 additions & 0 deletions src/MacAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ size_t MacAddress::printTo(Print & p) const
/**************************************************************************************
* FUNCTION DEFINITION
**************************************************************************************/
#include "Arduino.h"

void get_unique_chip_id_3(uint8_t * uid)
{
Expand Down Expand Up @@ -100,6 +101,11 @@ void get_unique_chip_id_3(uint8_t * uid)
bsp_unique_id_t const * renesas_unique_id = (bsp_unique_id_t *) BSP_FEATURE_BSP_UNIQUE_ID_POINTER;
memcpy(uid, renesas_unique_id->unique_id_bytes, 3);
}
#elif defined(ARDUINO_GIGA)
{
auto stm32_uid = HAL_GetUIDw2();
memcpy(uid, &stm32_uid, 3);
}
#else
# error "Retrieving a unique chip ID for MAC generation is not supported on this platform."
#endif
Expand Down
5 changes: 3 additions & 2 deletions src/microchip/TC6_Arduino_10BASE_T1S.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ bool TC6_Arduino_10BASE_T1S::begin(IPAddress const ip_addr,
memcpy(_lw.ip.mac, mac_addr.data(), sizeof(_lw.ip.mac));

/* Initialize the TC6 library and pass a global tag. */
if (_lw.tc.tc6 = TC6_Init(&_lw);
_lw.tc.tc6 == NULL)
_lw.tc.tc6 = TC6_Init(&_lw);
if (_lw.tc.tc6 == NULL) {
return false;
}

TC6ListNode * ptr = tc6_lwip_instance_list_head;
while (ptr != nullptr) ptr = ptr->next;
Expand Down
6 changes: 3 additions & 3 deletions src/microchip/TC6_Io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace TC6
* CONSTANTS
**************************************************************************************/

static SPISettings const LAN865x_SPI_SETTING{8 * 1000 * 1000UL, MSBFIRST, SPI_MODE0};
static SPISettings const LAN865x_SPI_SETTING{24 * 1000 * 1000UL, MSBFIRST, SPI_MODE0};

/**************************************************************************************
* STATIC MEMBER DEFINITION
Expand Down Expand Up @@ -90,8 +90,8 @@ bool TC6_Io::spi_transaction(uint8_t const *pTx, uint8_t *pRx, uint16_t const le
digitalWrite(_cs_pin, LOW);
_spi.beginTransaction(LAN865x_SPI_SETTING);

for (size_t b = 0; b < len; b++)
pRx[b] = _spi.transfer(pTx[b]);
memcpy(pRx, pTx, len);
_spi.transfer(pRx, len);

_spi.endTransaction();
digitalWrite(_cs_pin, HIGH);
Expand Down
Loading