implement wiz helper functions to access spi
This commit is contained in:
parent
3bd79b1741
commit
bd78c7afa1
@ -37,7 +37,7 @@ BUILD_DIR = build
|
||||
######################################
|
||||
# C sources
|
||||
C_SOURCES = \
|
||||
User/Src/eeprom.c User/Src/frontend.c User/Src/logger.c User/Src/loopCtrl.c User/Src/main2.c User/Src/mbusComm.c User/Src/ringbuffer.c User/Src/show.c hottislib/PontCoopScheduler.c \
|
||||
User/Src/wizHelper.c User/Src/eeprom.c User/Src/frontend.c User/Src/logger.c User/Src/loopCtrl.c User/Src/main2.c User/Src/mbusComm.c User/Src/ringbuffer.c User/Src/show.c hottislib/PontCoopScheduler.c \
|
||||
libmbus/mbus/mbus-protocol.c \
|
||||
Core/Src/main.c \
|
||||
Core/Src/gpio.c \
|
||||
|
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) {
|
||||
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
rm w5500/*
|
||||
pushd ioLibrary_Driver
|
||||
for D in Ethernet Ethernet/W5500 Internet/DHCP Internet/DNS Internet/httpServer Internet/MQTT; do
|
||||
cp $D/*.c $D/.h ../w5500
|
||||
done
|
||||
popd
|
||||
|
Loading…
x
Reference in New Issue
Block a user