aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SSI_Comm.h
blob: d515767785c39716d5de718b7df3bdf96d43d703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 * FPGA_SSI_Comm.h
 *
 *  Created on: Apr 22, 2018
 *      Author: avi
 */

#ifndef DRIVERS_FPGA_FPGA_SSI_COMM_H_
#define DRIVERS_FPGA_FPGA_SSI_COMM_H_

#include "drivers/SSI_Comm/SSI_Comm.h"

typedef struct  // 24bit
{
    unsigned short Position:14;
    unsigned char Gen_status:2;
    unsigned char Det_status:8;
}SSI_DANCER_ENC;

SSI_DANCER_ENC DANCER_ENC[NUM_OF_ROTENC];

SSI_DANCER_ENC Dryer_ENC;

bool Dancer_Busy[NUM_OF_ROTENC];

typedef struct
{
  uint32_t Speed;
  bool Busy;

}SpeedSensorResponseStruct;

SpeedSensorResponseStruct SpeedSensorResponseS;

typedef struct
{
  uint32_t Position;
  bool Busy;

}Dryer_ENCResponseStruct;

Dryer_ENCResponseStruct DryerENCResponseS;

typedef struct
{
    volatile short * TX_Reg;
    volatile short * RX_M;
    volatile short * RX_L;
    volatile short * SSI_Busy;

} FpgaDancerMap_t;




#ifdef FOUR_WINDERS
uint8_t FPGA_SSI_Transmit(Dancers_4_Winders _RotEncId);
uint8_t FPGA_SSI_Receive(Dancers_4_Winders _RotEncId);
#else
uint8_t FPGA_SSI_Transmit(HardwareDancerType _RotEncId);

uint8_t FPGA_SSI_Receive(HardwareDancerType _RotEncId);
#endif

uint8_t FPGA_SSI_Speed_Sensor_Transnit();

uint32_t FPGA_SSI_Speed_Sensor_Receive();

uint8_t FPGA_SSI_Dryer_ENC_Transnit();
uint32_t FPGA_SSI_Dryer_ENC_Receive();


#endif /* DRIVERS_FPGA_FPGA_SSI_COMM_H_ */