Xbee Arduino
Arduino Driver for Xbee
Loading...
Searching...
No Matches
port.h
Go to the documentation of this file.
1
35#ifndef PORT_H
36#define PORT_H
37
38#if defined(__cplusplus)
39extern "C"
40{
41#endif
42
43#include <stdint.h>
44
45// Enum for UART read status
46typedef enum {
53
54int portUartRead(uint8_t *buffer, int length);
55int portUartWrite(const uint8_t *buf, uint16_t len);
56uint32_t portMillis(void);
57void portFlushRx(void);
58int portUartInit(uint32_t baudrate, void *device);
59void portDelay(uint32_t ms);
60void portDebugPrintf(const char *format, ...);
61
62#if defined(__cplusplus)
63}
64#endif
65
66#endif // UART_H
void portDebugPrintf(const char *format,...)
Prints debug information to the Serial output.
Definition: port_arduino.cpp:167
void portDelay(uint32_t ms)
Delays execution for a specified number of milliseconds.
Definition: port_arduino.cpp:155
void portFlushRx(void)
Flushes the UART receive buffer.
Definition: port_arduino.cpp:127
int portUartRead(uint8_t *buffer, int length)
Reads data from the UART.
Definition: port_arduino.cpp:102
int portUartWrite(const uint8_t *buf, uint16_t len)
Writes data to the UART.
Definition: port_arduino.cpp:84
uint32_t portMillis(void)
Returns the number of milliseconds since the program started.
Definition: port_arduino.cpp:144
int portUartInit(uint32_t baudrate, void *device)
Initializes the UART for communication on the Arduino platform.
Definition: port_arduino.cpp:49
uart_status_t
Definition: port.h:46
@ UART_ERROR_OVERRUN
Definition: port.h:50
@ UART_ERROR_UNKNOWN
Definition: port.h:51
@ UART_ERROR_TIMEOUT
Definition: port.h:49
@ UART_SUCCESS
Definition: port.h:47
@ UART_INIT_FAILED
Definition: port.h:48