|  | Dual Active Bridge Development Board (Part-No. ) |
Content |  |  |  |  |  |

Loading...
Searching...
No Matches
Macros | Functions | Variables
uart1.c File Reference
MPLABX MCC Melody Code Generator » UART Driver

This is the generated driver source file for the UART1 driver. More...

`#include <stdint.h>`
`#include <stddef.h>`
`#include <xc.h>`
`#include "../uart1.h"`
Include dependency graph for uart1.c:

Go to the source code of this file.

## Macros
#define | UART1_CLOCK 100000000U
#define | UART1_BAUD_TO_BRG_WITH_FRACTIONAL(x) (UART1_CLOCK/(x))
#define | UART1_BAUD_TO_BRG_WITH_BRGH_1(x) (UART1_CLOCK/(4U*(x))-1U)
#define | UART1_BAUD_TO_BRG_WITH_BRGH_0(x) (UART1_CLOCK/(16U*(x))-1U)
#define | UART1_BRG_TO_BAUD_WITH_FRACTIONAL(x) (UART1_CLOCK/(x))
#define | UART1_BRG_TO_BAUD_WITH_BRGH_1(x) (UART1_CLOCK/(4U*((x)+1U)))
#define | UART1_BRG_TO_BAUD_WITH_BRGH_0(x) (UART1_CLOCK/(16U*((x)+1U)))
#define | UART1_MIN_ACHIEVABLE_BAUD_WITH_FRACTIONAL 95U
#define | UART1_MIN_ACHIEVABLE_BAUD_WITH_BRGH_1 24U

## Functions
void | UART1_Initialize (void)
| Initializes the UART driver.
void | UART1_Deinitialize (void)
| Deinitializes the UART to POR values.
uint8_t | UART1_Read (void)
| Reads a byte of data from the UART1.
void | UART1_Write (uint8_t txData)
| Writes a byte of data to the UART1.
bool | UART1_IsRxReady (void)
| Returns a boolean value if data is available to read.
bool | UART1_IsTxReady (void)
| Returns a boolean value if data can be written.
bool | UART1_IsTxDone (void)
| Indicates if all bytes have been transferred.
void | UART1_TransmitEnable (void)
| Enables UART1 transmit.
void | UART1_TransmitDisable (void)
| Disables UART1 transmit.
void | UART1_AutoBaudSet (bool enable)
| Enables or disables UART1 Auto-Baud detection.
bool | UART1_AutoBaudQuery (void)
| Returns the status of Auto-Baud detection.
bool | UART1_AutoBaudEventEnableGet (void)
| Returns enable state of the Auto-Baud feature.
size_t | UART1_ErrorGet (void)
| Returns the error status of UART1.
void | UART1_BRGCountSet (uint32_t brgValue)
| Sets the BRG value of UART1.
uint32_t | UART1_BRGCountGet (void)
| Gets the BRG value of UART1.
void | UART1_BaudRateSet (uint32_t baudRate)
| Sets the calculated Baud-Rate of UART1.
uint32_t | UART1_BaudRateGet (void)
| Gets the actual Baud-Rate of UART1.

## Variables
const struct UART_INTERFACE | UART1_Drv
| Structure object of type UART_INTERFACE with the custom name given by the user in the Melody Driver User interface. The default name e.g. UART1 can be changed by the user in the UART user interface. This allows defining a structure with application specific name using the 'Custom Name' field. Application specific name allows the API Portability.
union { |
struct { |
uint16_t frammingError:1 |
uint16_t parityError:1 |
uint16_t overrunError:1 |
uint16_t txCollisionError:1 |
uint16_t autoBaudOverflow:1 |
uint16_t reserved:11 |
} |  |
size_t status |
} | uartError |

## Detailed Description

UART1 Generated Driver Source File

Definition in file uart1.c.

## Macro Definition Documentation

## ◆ UART1_BAUD_TO_BRG_WITH_BRGH_0

#define UART1_BAUD_TO_BRG_WITH_BRGH_0 | ( |  | x | ) | (UART1_CLOCK/(16U*(x))-1U)

Definition at line 49 of file uart1.c.

## ◆ UART1_BAUD_TO_BRG_WITH_BRGH_1

#define UART1_BAUD_TO_BRG_WITH_BRGH_1 | ( |  | x | ) | (UART1_CLOCK/(4U*(x))-1U)

Definition at line 48 of file uart1.c.

## ◆ UART1_BAUD_TO_BRG_WITH_FRACTIONAL

#define UART1_BAUD_TO_BRG_WITH_FRACTIONAL | ( |  | x | ) | (UART1_CLOCK/(x))

Definition at line 47 of file uart1.c.

## ◆ UART1_BRG_TO_BAUD_WITH_BRGH_0

#define UART1_BRG_TO_BAUD_WITH_BRGH_0 | ( |  | x | ) | (UART1_CLOCK/(16U*((x)+1U)))

Definition at line 52 of file uart1.c.

## ◆ UART1_BRG_TO_BAUD_WITH_BRGH_1

#define UART1_BRG_TO_BAUD_WITH_BRGH_1 | ( |  | x | ) | (UART1_CLOCK/(4U*((x)+1U)))

Definition at line 51 of file uart1.c.

## ◆ UART1_BRG_TO_BAUD_WITH_FRACTIONAL

#define UART1_BRG_TO_BAUD_WITH_FRACTIONAL | ( |  | x | ) | (UART1_CLOCK/(x))

Definition at line 50 of file uart1.c.

## ◆ UART1_CLOCK

#define UART1_CLOCK 100000000U

Definition at line 46 of file uart1.c.

## ◆ UART1_MIN_ACHIEVABLE_BAUD_WITH_BRGH_1

#define UART1_MIN_ACHIEVABLE_BAUD_WITH_BRGH_1 24U

Definition at line 55 of file uart1.c.

## ◆ UART1_MIN_ACHIEVABLE_BAUD_WITH_FRACTIONAL

#define UART1_MIN_ACHIEVABLE_BAUD_WITH_FRACTIONAL 95U

Definition at line 54 of file uart1.c.

## Variable Documentation

## ◆ autoBaudOverflow

uint16_t autoBaudOverflow

Definition at line 96 of file uart1.c.

## ◆ frammingError

uint16_t frammingError

Definition at line 92 of file uart1.c.

## ◆ overrunError

uint16_t overrunError

Definition at line 94 of file uart1.c.

## ◆ parityError

uint16_t parityError

Definition at line 93 of file uart1.c.

## ◆ reserved

uint16_t reserved

Definition at line 97 of file uart1.c.

## ◆ status

size_t status

Definition at line 99 of file uart1.c.

## ◆ txCollisionError

uint16_t txCollisionError

Definition at line 95 of file uart1.c.

## ◆ [union]

union { ... } uartError