From 07f6644a38e2a4d5aa96d3f007ffd21fcedc3955 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 4 Jul 2019 18:03:26 +1000 Subject: extmod/nimble: Add nimble bindings. --- extmod/nimble/hal/hal_gpio.h | 1 + extmod/nimble/hal/hal_uart.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 extmod/nimble/hal/hal_gpio.h create mode 100644 extmod/nimble/hal/hal_uart.h (limited to 'extmod/nimble/hal') diff --git a/extmod/nimble/hal/hal_gpio.h b/extmod/nimble/hal/hal_gpio.h new file mode 100644 index 000000000..8b1a39374 --- /dev/null +++ b/extmod/nimble/hal/hal_gpio.h @@ -0,0 +1 @@ +// empty diff --git a/extmod/nimble/hal/hal_uart.h b/extmod/nimble/hal/hal_uart.h new file mode 100644 index 000000000..294dfb50d --- /dev/null +++ b/extmod/nimble/hal/hal_uart.h @@ -0,0 +1,18 @@ +#ifndef MICROPY_INCLUDED_EXTMOD_NIMBLE_HAL_HAL_UART_H +#define MICROPY_INCLUDED_EXTMOD_NIMBLE_HAL_HAL_UART_H + +#include + +#define SYSINIT_PANIC_ASSERT_MSG(cond, msg) + +#define HAL_UART_PARITY_NONE (0) + +typedef int (*hal_uart_tx_cb_t)(void *arg); +typedef int (*hal_uart_rx_cb_t)(void *arg, uint8_t data); + +int hal_uart_init_cbs(uint32_t port, hal_uart_tx_cb_t tx_cb, void *tx_arg, hal_uart_rx_cb_t rx_cb, void *rx_arg); +int hal_uart_config(uint32_t port, uint32_t baud, uint32_t bits, uint32_t stop, uint32_t parity, uint32_t flow); +void hal_uart_start_tx(uint32_t port); +int hal_uart_close(uint32_t port); + +#endif // MICROPY_INCLUDED_EXTMOD_NIMBLE_HAL_HAL_UART_H -- cgit v1.2.3