20260324
This commit is contained in:
58
IAPV1.1/Driver/spi/spi.h
Normal file
58
IAPV1.1/Driver/spi/spi.h
Normal file
@ -0,0 +1,58 @@
|
||||
#ifndef __SPI_H
|
||||
#define __SPI_H
|
||||
|
||||
#include "stm32l1xx.h"
|
||||
#include "stm32l1xx_gpio.h"
|
||||
#include "stm32l1xx_spi.h"
|
||||
#include "stm32l1xx_rcc.h"
|
||||
|
||||
|
||||
// SPI<50><49><EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD><D9B6><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define SPI_SPEED_2 0
|
||||
#define SPI_SPEED_4 1
|
||||
#define SPI_SPEED_8 2
|
||||
#define SPI_SPEED_16 3
|
||||
#define SPI_SPEED_32 4
|
||||
#define SPI_SPEED_64 5
|
||||
#define SPI_SPEED_128 6
|
||||
#define SPI_SPEED_256 7
|
||||
|
||||
#define u8 uint8_t
|
||||
#define u16 uint16_t
|
||||
|
||||
void SPI2_Port_Init(void);
|
||||
void SPI2_Init(void); //<2F><>ʼ<EFBFBD><CABC>SPI2<49><32>
|
||||
void SPI2_SetSpeed(uint8_t SpeedSet); //<2F><><EFBFBD><EFBFBD>SPI2<49>ٶ<EFBFBD>
|
||||
uint8_t SPI2_ReadWriteByte(uint8_t TxData);//SPI2<49><32><EFBFBD>߶<EFBFBD>дһ<D0B4><D2BB><EFBFBD>ֽ<EFBFBD>
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user