28 #include "p33c_mpuart.h" 31 volatile uint16_t* p33c_MpUartPort_Handles[8]={
32 &U1MODE, &U2MODE, &U3MODE, &U4MODE,
33 &U5MODE, &U6MODE, &U7MODE, &U8MODE
35 #elif defined (U7MODE) 36 volatile uint16_t* p33c_MpUartPort_Handles[7]={
37 &U1MODE, &U2MODE, &U3MODE, &U4MODE,
38 &U5MODE, &U6MODE, &U7MODE
40 #elif defined (U6MODE) 41 volatile uint16_t* p33c_MpUartPort_Handles[6]={
42 &U1MODE, &U2MODE, &U3MODE, &U4MODE,
45 #elif defined (U5MODE) 46 volatile uint16_t* p33c_MpUartPort_Handles[5]={
47 &U1MODE, &U2MODE, &U3MODE, &U4MODE,
50 #elif defined (U4MODE) 51 volatile uint16_t* p33c_MpUartPort_Handles[4]={
52 &U1MODE, &U2MODE, &U3MODE, &U4MODE
54 #elif defined (U3MODE) 55 volatile uint16_t* p33c_MpUartPort_Handles[3]={
56 &U1MODE, &U2MODE, &U3MODE
58 #elif defined (U2MODE) 59 volatile uint16_t* p33c_MpUartPort_Handles[2]={
62 #elif defined (U1MODE) 63 volatile uint16_t* p33c_MpUartPort_Handles[1]={
67 #pragma message "selected device has no supported UART ports" 92 uart = p33c_MpUartPort_GetHandle(uartInstance);
115 volatile uint16_t p33c_MpUartPort_ConfigWrite(
116 volatile uint16_t uartInstance,
120 volatile uint16_t retval=1;
124 uart = p33c_MpUartPort_GetHandle(uartInstance);
150 volatile uint16_t p33c_MpUartPort_Initialize(
volatile uint16_t uartInstance)
152 volatile uint16_t retval=1;
156 uart = p33c_MpUartPort_GetHandle(uartInstance);
159 retval &= p33c_MpUartPort_Disable(uart);
162 retval &= p33c_MpUartPort_ConfigWrite(uartInstance, uartConfigClear);
185 volatile uint16_t p33c_MpUartPort_Dispose(
volatile uint16_t uartInstance)
187 volatile uint16_t retval=1;
191 uart = p33c_MpUartPort_GetHandle(uartInstance);
194 retval &= p33c_MpUartPort_ConfigWrite(uartInstance, uartConfigClear);
223 volatile uint16_t retval=1;
227 retval &= (bool)((uart->
UxMODE.
bits.UARTEN) &&
249 volatile uint16_t retval=1;
253 retval &= (bool)(!uartInstance->
UxMODE.
bits.UARTEN);
275 volatile uint16_t retval=1;
282 retval = (
volatile uint16_t)
283 (((
volatile uint16_t)&uart->
UxMODE - (
volatile uint16_t)P33C_UART_SFR_START_ADDR) / P33C_UARTPORT_SFR_OFFSET) + 1;
285 if (retval > P33C_UART_COUNT)
312 .UxMODEH.value = 0x0000,
313 .UxSTA.value = 0x0000,
314 .UxSTAH.value = 0x0000,
315 .UxBRG.value = 0x0000,
316 .UxBRGH.value = 0x0000,
317 .UxRXREG.value = 0x0000,
318 .UxTXREG.value = 0x0000,
319 .UxP1.value = 0x0000,
320 .UxP2.value = 0x0000,
321 .UxP3.value = 0x0000,
322 .UxP3H.value = 0x0000,
323 .UxTXCHK.value = 0x0000,
324 .UxRXCHK.value = 0x0000,
325 .UxSCCON.value = 0x0000,
326 .UxSCINT.value = 0x0000,
327 .UxINT.value = 0x0000
359 .UxMODEH.value = 0x0880,
360 .UxSTA.value = 0x0000,
361 .UxSTAH.value = 0x0000,
362 .UxBRG.value = 0x0000,
363 .UxBRGH.value = 0x0000,
364 .UxRXREG.value = 0x0000,
365 .UxTXREG.value = 0x0000,
366 .UxP1.value = 0x0000,
367 .UxP2.value = 0x0000,
368 .UxP3.value = 0x0000,
369 .UxP3H.value = 0x0000,
370 .UxTXCHK.value = 0x0000,
371 .UxRXCHK.value = 0x0000,
372 .UxSCCON.value = 0x0000,
373 .UxSCINT.value = 0x0000,
374 .UxINT.value = 0x0000
union P33C_UART_INSTANCE_s::@147 UxMODE
struct tagU1MODEBITS bits