Low-Level functions¶
Low-level module consists of callback-only functions, which are called by middleware and must be implemented by final application.
Tip
Check Porting guide for actual implementation
-
group
LWESP_LL
Low-level communication functions.
Typedefs
-
typedef size_t (*
lwesp_ll_send_fn
)(const void *data, size_t len)¶ Function prototype for AT output data.
- Return
Number of bytes sent
- Parameters
[in] data
: Pointer to data to send. This parameter can be set toNULL
[in] len
: Number of bytes to send. This parameter can be set to0
to indicate that internal buffer can be flushed to stream. This is implementation defined and feature might be ignored
-
typedef uint8_t (*
lwesp_ll_reset_fn
)(uint8_t state)¶ Function prototype for hardware reset of ESP device.
- Return
1
on successful action,0
otherwise- Parameters
[in] state
: State indicating reset. When set to1
, reset must be active (usually pin active low), or set to0
when reset is cleared
Functions
-
lwespr_t
lwesp_ll_init
(lwesp_ll_t *ll)¶ Callback function called from initialization process.
- Note
This function may be called multiple times if AT baudrate is changed from application. It is important that every configuration except AT baudrate is configured only once!
- Note
This function may be called from different threads in ESP stack when using OS. When LWESP_CFG_INPUT_USE_PROCESS is set to
1
, this function may be called from user UART thread.- Return
lwespOK on success, member of lwespr_t enumeration otherwise
- Parameters
[inout] ll
: Pointer to lwesp_ll_t structure to fill data for communication functions
-
lwespr_t
lwesp_ll_deinit
(lwesp_ll_t *ll)¶ Callback function to de-init low-level communication part.
- Return
lwespOK on success, member of lwespr_t enumeration otherwise
- Parameters
[inout] ll
: Pointer to lwesp_ll_t structure to fill data for communication functions
-
struct
lwesp_ll_t
¶ - #include <lwesp_typedefs.h>
Low level user specific functions.
Public Members
-
lwesp_ll_send_fn
send_fn
¶ Callback function to transmit data
-
lwesp_ll_reset_fn
reset_fn
¶ Reset callback function
-
uint32_t
baudrate
¶ UART baudrate value
-
struct lwesp_ll_t::[anonymous]
uart
¶ UART communication parameters
-
lwesp_ll_send_fn
-
typedef size_t (*