Configure uart1.
More...
#include <stdlib.h>
#include <stdint.h>
#include <xc.h>
#include <sys/attribs.h>
#include "interrup.h"
Go to the source code of this file.
|
| #define | DisableUart1RxInterrupt() IEC0bits.U1RXIE = 0; |
| |
|
#define | EnableUart1RxInterrupt() IEC0bits.U1RXIE = 1; |
| |
|
#define | DisableUart1TxInterrupt() IEC0bits.U1TXIE = 0; |
| |
|
#define | EnableUart1TxInterrupt() IEC0bits.U1TXIE = 1; |
| |
|
#define | UART_BUF_SIZE 256 |
| | must be 2's power
|
| |
|
#define | INDEX_MASK (UART_BUF_SIZE-1) |
| |
◆ DisableUart1RxInterrupt
| #define DisableUart1RxInterrupt |
( |
| ) |
IEC0bits.U1RXIE = 0; |
◆ _mon_putc()
function uart transmitter for polling
- Parameters
-
◆ initUart()
| void initUart |
( |
uint32_t |
PBCLK | ) |
|
Initial uart1.
- Parameters
-
| PBCLK | frequency of pic work. |
◆ readChar()
| uint8_t readChar |
( |
char * |
pchar | ) |
|
function uart reader for interruption
- Parameters
-
| registor | to save char in buffer. |
- Returns
- List (if feasible) and describe the return values of the function.
-
1 receive new char in buffer
-
0 don't receive char in buffer