Skip to content
Open
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
11 changes: 8 additions & 3 deletions inc/enc28j60.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,19 @@ static inline void uDelay(uint32_t useconds) {
# define ETHERNET_CS_DELAY_PROC Delay(ETHERNET_CS_DELAY)
#endif

/** if software chip select is wanted **/
#define disableChip ETHERNET_CS_GPIO->BSRR = ETHERNET_CS_PIN;\
ETHERNET_LED_GPIO->BSRR = ETHERNET_LED_PIN << 16;\
ETHERNET_CS_DELAY_PROC;
#define enableChip ETHERNET_CS_GPIO->BSRR = ETHERNET_CS_PIN<<16;\
ETHERNET_LED_GPIO->BSRR = ETHERNET_LED_PIN;\
ETHERNET_CS_DELAY_PROC;
//#define disableChip {}
//#define enableChip {}

/** if hardware chip select is wanted
* (don't forget to use "Hardware NSS Output Signal" in .ioc and define ETHERNET_CS_PIN and ETHERNET_CS_GPIO to the right pin)
* (ETHERNET_CS_DELAY becomes unused)
*/
//#define disableChip __HAL_SPI_DISABLE(hspi);
//#define enableChip ;


// ENC28J60 Control Registers
Expand Down