SCAMP-5c SPI Interface  1.0.0
SCAMP-5c is connected to the flight computer via a SPI interface
scamp5c_spi_versions.hpp
Go to the documentation of this file.
1 
18 #ifndef SCAMP5C_SPI_VERSIONS_HPP
19 #define SCAMP5C_SPI_VERSIONS_HPP
20 
21 #include "scamp5c_spi.hpp"
22 #include "scamp5c_oxu4.hpp"
23 
24 
25 
30 
31 
32 public:
33 
34  uint8_t ipu_port_forward[8];
35 
37  for(int i = 0;i<8;i++){
38  ipu_port_forward[i] = 0;
39  }
40  }
41 
42  void SetupGpio(scamp5c_oxu4_gpio *p){
43  oxu4_gpio = p;
44  oxu4_gpio->configure_gpio();
45  }
46 
47  inline scamp5c_oxu4_gpio* GetGpioClass(){
48  return oxu4_gpio;
49  }
50 
51 
52 protected:
53  scamp5c_oxu4_gpio *oxu4_gpio;
54  int trigger_state;
55 
56  virtual size_t transfer_callback();
57 
58  virtual bool get_hw_trigger(){
59  return oxu4_gpio->get_spi_data_ready();
60  }
61 
62  virtual bool spi_transfer_trigger(){
63  return get_hw_trigger();
64  }
65 
66 
67 };
68 
69 
70 
75 
76 public:
77 
79 
80  inline void Transfer(){
81  green_light.store(true);
82  }
83 
84  std::atomic<bool> enable_external_trigger;
85  std::atomic<bool> green_light;
86 
87 protected:
88 
89  virtual bool spi_transfer_trigger();
90  virtual void header_callback(size_t rx_offset,packet_header*header);
91  virtual void packet_callback(size_t rx_offset);
92 
93 };
94 
95 #endif // SCAMP5C_SPI_VERSIONS_HPP
this interface uses the data-ready pin to trigger transfers.
Definition: scamp5c_spi_versions.hpp:29
this interface will dynamically change the transfer size to adapt payload size.
Definition: scamp5c_spi_versions.hpp:74
the object-oriented interface of the spi bus
Definition: scamp5c_spi.hpp:44