/ bf16-ctrldevice.h
bf16-ctrldevice.h
 1  #ifndef BF16_CTRLDEVICE_H
 2  #define BF16_CTRLDEVICE_H
 3  
 4  #include "bf16-brd-control.h"
 5  #include "bf16-device.h"
 6  
 7  #define CTRL_BUFFER_SIZE    96
 8  
 9  /* CTRL functions */
10  #define F_BUZZER        0
11  #define F_LED1          1
12  #define F_LED2          2
13  #define F_BRST          3
14  #define F_RST           4
15  #define F_BDET          5
16  #define F_STAT          6
17  
18  /* read in signals */
19  #define HW_VER          "HW_VER"
20  #define BTN_FR          "BTN_FR"
21  #define BTN_DISCOVERY   "BTN_DISCOVERY"
22  #define CH1_DET         "CH1_DET"
23  #define CH2_DET         "CH2_DET"
24  
25  /* write out signals */
26  #define BUZZER          "BUZZER"
27  #define LED_GREEN       "LED_GREEN"
28  #define LED_RED         "LED_RED"
29  #define CH1_MSP_RST     "CH1_MSP_RST"
30  #define CH2_MSP_RST     "CH2_MSP_RST"
31  #define CH1_SPI_RES     "CH1_SPI_RES"
32  #define CH2_SPI_RES     "CH2_SPI_RES"
33  #define CH1_BRD_DET     "CH1_BRD_DET"
34  #define CH2_BRD_DET     "CH2_BRD_DET"
35  
36  extern char *ctrl_device_name;
37  
38  int8_t ctrl_init(device_t* attr, char *device, uint16_t size);
39  int8_t ctrl_transfer(device_t *attr);
40  void ctrl_release(device_t *attr);
41  char* get_ctrl_data(int channel, int state, int fn);
42  
43  #endif /* BF16_CTRLDEVICE_H */