You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
1.4 KiB
81 lines
1.4 KiB
#pragma once
|
|
#include <stdint.h>
|
|
|
|
#include "project_dep.h"
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct {
|
|
/**
|
|
* @brief 指令SPI 接口
|
|
*/
|
|
SPI_HandleTypeDef *spi1;
|
|
SPI_HandleTypeDef *spi2;
|
|
|
|
/**
|
|
* @brief timecode并口
|
|
*/
|
|
|
|
xs_gpio_t timecode_add[4];
|
|
xs_gpio_t timecode_data[8];
|
|
|
|
Pin_t timecode_add_pin[4];
|
|
Pin_t timecode_data_pin[8];
|
|
|
|
Pin_t timecode_irq_pin;
|
|
Pin_t camera_sync_code_irq_pin;
|
|
|
|
xs_gpio_t timecode_irq_io;
|
|
xs_gpio_t camera_sync_code_irq_io;
|
|
|
|
} fpga_if_t;
|
|
/**
|
|
* @brief fpga_if初始化
|
|
*
|
|
*/
|
|
void fpga_if_init();
|
|
/**
|
|
* @brief 读取当前timecode
|
|
*
|
|
* @param timecode0
|
|
* @param timecode1
|
|
*/
|
|
void fpga_if_get_timecode(uint32_t *timecode0, uint32_t *timecode1);
|
|
/**
|
|
* @brief SPI寄存器写指令_01 FPGA寄存器读写SPI
|
|
*
|
|
* @param add
|
|
* @param txdata
|
|
* @param rxdata
|
|
*/
|
|
void fpga_if_spi_write_data_01(uint32_t add, uint32_t txdata, uint32_t *rxdata);
|
|
/**
|
|
* @brief SPI寄存器读指令 FPGA寄存器读写SPI
|
|
*
|
|
* @param add
|
|
* @param rxdata
|
|
*/
|
|
void fpga_if_spi_read_data_01(uint32_t add, uint32_t *rxdata);
|
|
|
|
/**
|
|
* @brief SPI寄存器写指令 FPGA备用SPI
|
|
*
|
|
* @param add
|
|
* @param txdata
|
|
* @param rxdata
|
|
*/
|
|
void fpga_if_spi_write_data_02(uint32_t add, uint32_t txdata, uint32_t *rxdata);
|
|
/**
|
|
* @brief SPI寄存器读指令 FPGA备用SPI
|
|
*
|
|
* @param add
|
|
* @param rxdata
|
|
*/
|
|
void fpga_if_spi_read_data_02(uint32_t add, uint32_t *rxdata);
|
|
|
|
fpga_if_t *fpga_if_get_instance();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|