SSP1922头文件
#ifndef _SSP1922_H_
#define _SSP1922_H_
#include "gd32f3x0_gpio.h"
#include "systick.h"
//#include "core_cmInstr.h"
extern uint8_t ALU_INT_FLAG;
//extern uint8_t count;
//TDC_RST -- PA1
//SPI_SCLK -- PA5
//SPI_MOSI -- PA7
//SPI_CS -- PB0
//EN_START -- PB3 //START信号使能
//TDC_INTN -- PA3 //ALU计算中断输入
//SPI_MISO -- PA6 //SPI数据输入
#define TDC_RST_H gpio_bit_set(GPIOA, GPIO_PIN_1)
#define TDC_RST_L gpio_bit_reset(GPIOA, GPIO_PIN_1)
#define SPI_SCLK_H gpio_bit_set(GPIOA, GPIO_PIN_5)
#define SPI_SCLK_L gpio_bit_reset(GPIOA, GPIO_PIN_5)
#define SPI_MOSI_H gpio_bit_set(GPIOA, GPIO_PIN_7)
#define SPI_MOSI_L gpio_bit_reset(GPIOA, GPIO_PIN_7)
#define SPI_CS_H gpio_bit_set(GPIOB, GPIO_PIN_0)
#define SPI_CS_L gpio_bit_reset(GPIOB, GPIO_PIN_0)
#define EN_START_H gpio_bit_set(GPIOB, GPIO_PIN_3)
#define EN_START_L gpio_bit_reset(GPIOB, GPIO_PIN_3)
#define SPI_MISO_IN gpio_input_bit_get(GPIOA, GPIO_PIN_6)
#define Init() Write_Order(0x70)
#define Power_on_Reset() Write_Order(0X50)
#define Start_TOF() Write_Order(0X01)
#define Start_Temp() Write_Order(0X02)
#define Start_Cal_Resonator() Write_Order(0X03)
#define Start_Cal_TDC() Write_Order(0X04)
#define Start_TOF_Restart() Write_Order(0X05)
#define Start_Temp_Restart() Write_Order(0X06)
void GPIO_Config(void);
void RST_TDC(void);
void SPI_Init(void);
void SPI_ENABLE(void);
void SPI_DISABLE(void);
void SEND_0(void);
void SEND_1(void);
void SPI_WRITE8(uint8_t wbuf8);
uint8_t SPI_READ8(void);
void SPI_WRITE32(uint32_t wbuf32);
uint32_t SPI_READ32(void);
uint16_t SPI_READ16(void);
void Write_Reg(uint8_t RegNum,uint32_t RegData);
uint32_t Read_Reg(uint8_t RegNum);
uint16_t Rea