18 typedef struct _plt_isr_fun {
19 uint32_t (*ble_rand)(void);
20 uint32_t (*ble_slow_clk)(void);
22 uint32_t (*ble_irq_mask)(void);
23 void (*ble_irq_unmask)(uint32_t primask);
24 void (*ble_irq_enable)(void);
26 void (*ble_mutex_wait)(
void *hdl, uint32_t time_ms);
27 void (*ble_mutex_release)(
void *hdl);
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);
34 void (*ble_event_signal)(void);
35 void (*ble_stack_signal)(void);
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);
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));
44 void (*ble_adv_ignore_timestamp)(
int en);
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);
55 void (*ble_clock_init)(void);
56 uint32_t (*ble_get_em_size)(void);
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);
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);
71 void *(*ble_trace_uart_init)(void);
72 void (*ble_trace_uart_deinit)(
void *hdl);
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));
76 void (*osc_irq_enable)(void);
77 void (*osc_irq_disable)(void);
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);