Morse Micro IoT SDK  2.9.7
mmhal_uart.h
1/*
2 * Copyright 2024 Morse Micro
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
19#pragma once
20
21#include <stdbool.h>
22#include <stddef.h>
23#include <stdint.h>
24#include "mmhal.h"
25#include "mmosal.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31
45typedef void (*mmhal_uart_rx_cb_t)(const uint8_t *data, size_t length, void *arg);
46
53void mmhal_uart_init(mmhal_uart_rx_cb_t rx_cb, void *rx_cb_arg);
54
59
67void mmhal_uart_tx(const uint8_t *data, size_t length);
68
69
72{
77};
78
88
89
90#ifdef __cplusplus
91}
92#endif
93
void mmhal_uart_tx(const uint8_t *data, size_t length)
Transmit data on the UART.
void(* mmhal_uart_rx_cb_t)(const uint8_t *data, size_t length, void *arg)
Function type for UART RX callback.
Definition: mmhal_uart.h:45
void mmhal_uart_deinit(void)
Deinitialize the UART HAL, and disable the UART.
mmhal_uart_deep_sleep_mode
Enumeration of deep sleep modes for the UART HAL.
Definition: mmhal_uart.h:72
void mmhal_uart_init(mmhal_uart_rx_cb_t rx_cb, void *rx_cb_arg)
Initialize the UART HAL and perform any setup necessary.
bool mmhal_uart_set_deep_sleep_mode(enum mmhal_uart_deep_sleep_mode mode)
Set the deep sleep mode for the UART.
@ MMHAL_UART_DEEP_SLEEP_ONE_SHOT
Enable deep sleep until activity occurs on data-link transport.
Definition: mmhal_uart.h:76
@ MMHAL_UART_DEEP_SLEEP_DISABLED
Deep sleep mode is disabled.
Definition: mmhal_uart.h:74