33 lines
559 B
C
33 lines
559 B
C
#ifndef UARTDRV_H_
|
|
#define UARTDRV_H_
|
|
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
|
|
|
|
#define UART_CMD_BUF_SIZE 4
|
|
#define UART_CMD_CYCLES 10
|
|
|
|
typedef struct uartdrvCmdBuf_s {
|
|
uint8_t idx;
|
|
uint8_t cmdStart;
|
|
uint8_t cmdDelay;
|
|
uint8_t cmdReady;
|
|
uint8_t cmd;
|
|
uint8_t buf[UART_CMD_BUF_SIZE];
|
|
} uartdrvCmdBuf_t;
|
|
|
|
|
|
extern void uartInitCallback();
|
|
extern void uartWriteCallback(uint8_t o);
|
|
|
|
int uartdrvPutchar(char c, FILE *stream);
|
|
void uartdrvInit();
|
|
void uartdrvWrite(uint8_t o);
|
|
|
|
void uartdrvCmdCycle();
|
|
|
|
void uartdrvCmdReceived();
|
|
|
|
#endif /* UARTDRV_H_ */
|