InPlay API
hal_sdr.h
1 
13 #ifndef HAL_SDR_H
14 #define HAL_SDR_H
15 #include "./hal/hal_power.h"
16 #include "cmsis_os.h"
17 #include "in_mmap.h"
18 #include "in_sdr.h"
19 #include <stdint.h>
20 
21 typedef struct {
22  int used;
23  //osSemaphoreId semaphore;
24  osMutexId mutex;
25  void (*rx_callback)(rx_param_t* arg);
26 #if CFG_PM_EN
27  int resume;
28  int power_state;
29  struct pm_module pmd;
30 #endif
31 } sdr_dev_t;
32 typedef struct {
33  uint32_t access_addr;
34  uint16_t mst_addr;
35  char mst_nb;
36  uint16_t mst_addr_array[8];
37  uint16_t mst_addr_mask[8];
38  uint16_t slv_addr;
39  uint16_t rx_da_mask;
40 } sdr_addr_t;
41 
42 /*
43  * APIs
44  ****************************************************************************************
45  */
59 sdr_dev_t* hal_sdr_open(void (*rx_callback)(rx_param_t* arg));
60 
70 void hal_sdr_close(sdr_dev_t* dev);
71 
89 int hal_sdr_mstr_to_slv(sdr_dev_t* dev, char mode, int slv_ack, sdr_addr_t* addr, char chn, char txr, char rxr, uint16_t tx_len, uint8_t* tx_buf, uint16_t* actual_tx_bytes);
90 
109 int hal_sdr_slv_to_mstr(sdr_dev_t* dev, char mode, int slv_ack, sdr_addr_t* addr, char chn, char txr, char rxr, uint16_t rxw_sz,
110  uint16_t tx_len[8], uint8_t* tx_buf[8], uint16_t actual_tx_bytes_array[8]);
111 #endif