InPlay API
in_ble_plt.h
1 
13 #ifndef IN_BLE_PLT_H
14 #define IN_BLE_PLT_H
15 
16 #include "stdint.h"
17 
18 typedef struct _plt_isr_fun {
19  uint32_t (*ble_rand)(void);
20  uint32_t (*ble_slow_clk)(void);
21 
22  uint32_t (*ble_irq_mask)(void);
23  void (*ble_irq_unmask)(uint32_t primask);
24  void (*ble_irq_enable)(void);
25 
26  void (*ble_mutex_wait)(void *hdl, uint32_t time_ms);
27  void (*ble_mutex_release)(void *hdl);
28 
29  void *(*ble_semaphore_create)(void);
30  void (*ble_semaphore_delete)(void *hdl);
31  void (*ble_semaphore_wait)(void *hdl, uint32_t time_ms);
32  void (*ble_semaphore_release)(void *hdl);
33 
34  void (*ble_event_signal)(void);
35  void (*ble_stack_signal)(void);
36 
37  void (*ble_assert_error)(const char *file, int line);
38  void (*ble_assert_param)(const char *file, int line, int param0, int param1);
39  void (*ble_assert_warn)(const char *file, int line, int param0, int param1);
40 
41  int (*ble_trace_uart_write)(void *hdl, uint8_t *buffer, uint16_t buffer_len, void *arg, void (*callback)(void *, int, int ));
42  int (*ble_trace_uart_read)(void *hdl, uint8_t *buffer, uint16_t buffer_len, void *arg, void(*callback)(void *, int, int));
43 
44  void (*ble_adv_ignore_timestamp)(int en);
45 
46 } plt_isr_fun_t;
47 
48 typedef struct _plt_fun {
49  int (*ble_ecc_pub_key_async_start)(const uint8_t *secret_key);
50  int (*ble_ecc_ecdh_key_async_start)(const uint8_t *secret_key, const uint8_t* pub_x, const uint8_t* pub_y);
51  int (*ble_ecc_check_finish)(void);
52  int (*ble_ecc_key_async_end)(uint8_t *key_x, uint8_t *key_y);
53  int (*ble_ecc_valid_point)(uint8_t *Px, uint8_t *Py);
54 
55  void (*ble_clock_init)(void);
56  uint32_t (*ble_get_em_size)(void);
57 
58  void (*ble_irq_disable)(void);
59  int (*ble_stack_task_init)(void *arg);
60  int (*ble_event_task_init)(void);
61  void *(*ble_mutex_create)(void);
62  void (*ble_mutex_delete)(void *hdl);
63 
64  void *(*ble_hci_init)(void *arg);
65  void (*ble_hci_deinit)(void *hdl);
66  void (*ble_hci_write)(void *hdl, uint8_t *buffer, uint16_t buffer_len, void (*callback)(void *arg, uint8_t status), void *arg);
67  void (*ble_hci_read)(void *hdl, uint8_t *buffer, uint16_t buffer_len, void(*callback)(void *arg, uint8_t status), void *arg);
68  void (*ble_hci_flow_on)(void *hdl);
69  void (*ble_hci_flow_off)(void *hdl);
70 
71  void *(*ble_trace_uart_init)(void);
72  void (*ble_trace_uart_deinit)(void *hdl);
73 
74  void (*ble_power_register)(void *arg, int (*pow_state)(void *arg, uint32_t *duration), void (*pow_down)(void *arg, uint32_t duration), void (*pow_up)(void * arg));
75 
76  void (*osc_irq_enable)(void);
77  void (*osc_irq_disable)(void);
78 
79 } plt_fun_t;
80 
81 extern plt_isr_fun_t g_plt_isr_fun;
82 extern plt_fun_t g_plt_fun;
83 extern void ble_isr_cb(void* arg);
84 #endif /* IN_BLE_PLT_H */