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

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. #pragma once
  2. #include <stdint.h>
  3. #include "project_dep.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. typedef struct {
  8. /**
  9. * @brief ָSPI ӿ
  10. */
  11. SPI_HandleTypeDef *spi1;
  12. SPI_HandleTypeDef *spi2;
  13. /**
  14. * @brief timecode
  15. */
  16. xs_gpio_t timecode_add[4];
  17. xs_gpio_t timecode_data[8];
  18. Pin_t timecode_add_pin[4];
  19. Pin_t timecode_data_pin[8];
  20. Pin_t timecode_irq_pin;
  21. Pin_t camera_sync_code_irq_pin;
  22. xs_gpio_t timecode_irq_io;
  23. xs_gpio_t camera_sync_code_irq_io;
  24. } fpga_if_t;
  25. /**
  26. * @brief fpga_ifʼ
  27. *
  28. */
  29. void fpga_if_init();
  30. /**
  31. * @brief ȡǰtimecode
  32. *
  33. * @param timecode0
  34. * @param timecode1
  35. */
  36. void fpga_if_get_timecode(uint32_t *timecode0, uint32_t *timecode1);
  37. /**
  38. * @brief SPIĴдָ_01 FPGAĴдSPI
  39. *
  40. * @param add
  41. * @param txdata
  42. * @param rxdata
  43. */
  44. void fpga_if_spi_write_data_01(uint32_t add, uint32_t txdata, uint32_t *rxdata);
  45. /**
  46. * @brief SPIĴָ FPGAĴдSPI
  47. *
  48. * @param add
  49. * @param rxdata
  50. */
  51. void fpga_if_spi_read_data_01(uint32_t add, uint32_t *rxdata);
  52. /**
  53. * @brief SPIĴдָ FPGASPI
  54. *
  55. * @param add
  56. * @param txdata
  57. * @param rxdata
  58. */
  59. void fpga_if_spi_write_data_02(uint32_t add, uint32_t txdata, uint32_t *rxdata);
  60. /**
  61. * @brief SPIĴָ FPGASPI
  62. *
  63. * @param add
  64. * @param rxdata
  65. */
  66. void fpga_if_spi_read_data_02(uint32_t add, uint32_t *rxdata);
  67. fpga_if_t *fpga_if_get_instance();
  68. #ifdef __cplusplus
  69. }
  70. #endif