You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
641 B
28 lines
641 B
8 years ago
|
/**
|
||
|
* UART init & async rx module.
|
||
|
*
|
||
|
* Call UART_Init(), UART_SetupAsyncReceiver() and
|
||
|
* define UART_HandleRxByte() somewhere in application code.
|
||
|
*
|
||
|
* Call UART_PollRx() to allow rx in a blocking handler.
|
||
|
*/
|
||
|
|
||
|
#ifndef UART_HANDLER_H
|
||
|
#define UART_HANDLER_H
|
||
|
|
||
|
#include <esp8266.h>
|
||
|
|
||
8 years ago
|
/** Configure UART periphs and enable pins */
|
||
8 years ago
|
void UART_Init(uint32_t baud0, uint32_t baud1);
|
||
|
|
||
8 years ago
|
/** Configure async Rx on UART0 */
|
||
8 years ago
|
void UART_SetupAsyncReceiver(void);
|
||
|
|
||
|
/** User must provide this func for handling received bytes */
|
||
|
extern void UART_HandleRxByte(char c);
|
||
|
|
||
8 years ago
|
/** Poll uart manually while waiting for something */
|
||
8 years ago
|
void UART_PollRx(void);
|
||
|
|
||
|
#endif
|