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.

86 lines
1.6 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
2 years ago
2 years ago
1 year 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. Pin_t xsync_workstate_start_sig_irq_io_pin;
  23. Pin_t reset_pin;
  24. xs_gpio_t timecode_irq_io;
  25. xs_gpio_t camera_sync_code_irq_io;
  26. xs_gpio_t xsync_workstate_start_sig_irq_io;
  27. xs_gpio_t reset_pin_io;
  28. } fpga_if_t;
  29. /**
  30. * @brief fpga_ifʼ
  31. *
  32. */
  33. void fpga_if_init();
  34. /**
  35. * @brief ȡǰtimecode
  36. *
  37. * @param timecode0
  38. * @param timecode1
  39. */
  40. void fpga_if_get_timecode(uint32_t *timecode0, uint32_t *timecode1);
  41. /**
  42. * @brief SPIĴдָ_01 FPGAĴдSPI
  43. *
  44. * @param add
  45. * @param txdata
  46. * @param rxdata
  47. */
  48. void fpga_if_spi_write_data_01(uint32_t add, uint32_t txdata, uint32_t *rxdata);
  49. /**
  50. * @brief SPIĴָ FPGAĴдSPI
  51. *
  52. * @param add
  53. * @param rxdata
  54. */
  55. void fpga_if_spi_read_data_01(uint32_t add, uint32_t *rxdata);
  56. /**
  57. * @brief SPIĴдָ FPGASPI
  58. *
  59. * @param add
  60. * @param txdata
  61. * @param rxdata
  62. */
  63. void fpga_if_spi_write_data_02(uint32_t add, uint32_t txdata, uint32_t *rxdata);
  64. /**
  65. * @brief SPIĴָ FPGASPI
  66. *
  67. * @param add
  68. * @param rxdata
  69. */
  70. void fpga_if_spi_read_data_02(uint32_t add, uint32_t *rxdata);
  71. void fpga_if_get_record_state(uint32_t *workstate);
  72. fpga_if_t *fpga_if_get_instance();
  73. #ifdef __cplusplus
  74. }
  75. #endif