Skip to content

Hardware CS handling #13

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

Open
wants to merge 2 commits into
base: v2
Choose a base branch
from
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