implement wiz helper functions to access spi
This commit is contained in:
6
cube/User/Inc/wizHelper.h
Normal file
6
cube/User/Inc/wizHelper.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef _WIZHELPER_H_
|
||||
#define _WIZHELPER_H_
|
||||
|
||||
|
||||
|
||||
#endif // _WIZHELPER_H_
|
33
cube/User/Src/wizHelper.c
Normal file
33
cube/User/Src/wizHelper.c
Normal file
@ -0,0 +1,33 @@
|
||||
#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) {
|
||||
|
||||
}
|
Reference in New Issue
Block a user