33 lines
652 B
C
33 lines
652 B
C
|
#include <wizHelper.h>
|
||
|
|
||
|
#include <stdint.h>
|
||
|
#include <main2.h>
|
||
|
#include <spi.h>
|
||
|
|
||
|
|
||
|
|
||
|
void wizchip_cs_select(void) {
|
||
|
HAL_GPIO_WritePin(ETHER_CS_GPIO_Port, ETHER_CS_Pin, GPIO_PIN_RESET);
|
||
|
}
|
||
|
|
||
|
void wizchip_cs_deselect(void) {
|
||
|
HAL_GPIO_WritePin(ETHER_CS_GPIO_Port, ETHER_CS_Pin, GPIO_PIN_SET);
|
||
|
}
|
||
|
|
||
|
uint8_t wizchip_spi_readbyte(void) {
|
||
|
uint8_t rbuf;
|
||
|
HAL_SPI_Receive(ðerSpi, &rbuf, 1, HAL_MAX_DELAY);
|
||
|
return rbuf;
|
||
|
}
|
||
|
|
||
|
void wizchip_spi_writebyte(uint8_t wb) {
|
||
|
HAL_SPI_Transmit(ðerSpi, &wb, 1, HAL_MAX_DELAY);
|
||
|
}
|
||
|
|
||
|
void wizchip_spi_readburst(uint8_t* pBuf, uint16_t len) {
|
||
|
|
||
|
}
|
||
|
|
||
|
void wizchip_spi_writeburst(uint8_t* pBuf, uint16_t len) {
|
||
|
|
||
|
}
|