MotorWare f2806x Driver API Documentation

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

sci.h
Go to the documentation of this file.
1 /* --COPYRIGHT--,BSD
2 * Copyright (c) 2015, Texas Instruments Incorporated
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * --/COPYRIGHT--*/
32 #ifndef _SCI_H_
33 #define _SCI_H_
34
40
41
42 // **************************************************************************
43 // the includes
44
45 // drivers
46 #include "sw/drivers/cpu/src/32b/f28x/f2806x/cpu.h"
47
48
49 // modules
50 #include "sw/modules/types/src/types.h"
51
52
57
58
59
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63
64
65 // **************************************************************************
66 // the defines
67
68
71 #define SCIA_BASE_ADDR (0x00007050)
72
75 #define SCIB_BASE_ADDR (0x00007750)
76
77
80 #define SCI_SCICCR_CHAR_LENGTH_BITS (7 << 0)
81
84 #define SCI_SCICCR_MODE_BITS (1 << 3)
85
88 #define SCI_SCICCR_LB_ENA_BITS (1 << 4)
89
92 #define SCI_SCICCR_PARITY_ENA_BITS (1 << 5)
93
96 #define SCI_SCICCR_PARITY_BITS (1 << 6)
97
100 #define SCI_SCICCR_STOP_BITS (1 << 7)
101
102
105 #define SCI_SCICTL1_RXENA_BITS (1 << 0)
106
109 #define SCI_SCICTL1_TXENA_BITS (1 << 1)
110
113 #define SCI_SCICTL1_SLEEP_BITS (1 << 2)
114
117 #define SCI_SCICTL1_TXWAKE_BITS (1 << 3)
118
121 #define SCI_SCICTL1_RESET_BITS (1 << 5)
122
125 #define SCI_SCICTL1_RX_ERR_INT_ENA_BITS (1 << 6)
126
127
130 #define SCI_SCICTL2_TX_INT_ENA_BITS (1 << 0)
131
134 #define SCI_SCICTL2_RX_INT_ENA_BITS (1 << 1)
135
138 #define SCI_SCICTL2_TXEMPTY_BITS (1 << 6)
139
142 #define SCI_SCICTL2_TXRDY_BITS (1 << 7)
143
144
147 #define SCI_SCIRXST_RXWAKE_BITS (1 << 1)
148
151 #define SCI_SCIRXST_PE_BITS (1 << 2)
152
155 #define SCI_SCIRXST_OE_BITS (1 << 3)
156
159 #define SCI_SCIRXST_FE_BITS (1 << 4)
160
163 #define SCI_SCIRXST_BRKDT_BITS (1 << 5)
164
167 #define SCI_SCIRXST_RXRDY_BITS (1 << 6)
168
171 #define SCI_SCIRXST_RXERROR_BITS (1 << 7)
172
173
176 #define SCI_SCIFFRX_IL_BITS (31 << 0)
177
180 #define SCI_SCIFFRX_IENA_BITS ( 1 << 5)
181
184 #define SCI_SCIFFRX_INTCLR_BITS ( 1 << 6)
185
188 #define SCI_SCIFFRX_INT_BITS ( 1 << 7)
189
192 #define SCI_SCIFFRX_FIFO_ST_BITS (31 << 8)
193
196 #define SCI_SCIFFRX_FIFO_RESET_BITS ( 1 << 13)
197
200 #define SCI_SCIFFRX_FIFO_OVFCLR_BITS ( 1 << 14)
201
204 #define SCI_SCIFFRX_FIFO_OVF_BITS ( 1 << 15)
205
206
209 #define SCI_SCIFFTX_IL_BITS (31 << 0)
210
213 #define SCI_SCIFFTX_IENA_BITS ( 1 << 5)
214
217 #define SCI_SCIFFTX_INTCLR_BITS ( 1 << 6)
218
221 #define SCI_SCIFFTX_INT_BITS ( 1 << 7)
222
225 #define SCI_SCIFFTX_FIFO_ST_BITS (31 << 8)
226
229 #define SCI_SCIFFTX_FIFO_RESET_BITS ( 1 << 13)
230
233 #define SCI_SCIFFTX_FIFO_ENA_BITS ( 1 << 14)
234
237 #define SCI_SCIFFTX_CHAN_RESET_BITS ( 1 << 15)
238
239
242 #define SCI_SCIFFCT_DELAY_BITS (255 << 0)
243
246 #define SCI_SCIFFCT_CDC_BITS ( 1 << 13)
247
250 #define SCI_SCIFFCT_ABDCLR_BITS ( 1 << 14)
251
254 #define SCI_SCIFFCT_ABD_BITS ( 1 << 15)
255
256
257 // **************************************************************************
258 // the typedefs
259
262 typedef enum
263 {
264 SCI_BaudRate_9_6_kBaud = 194,
265 SCI_BaudRate_19_2_kBaud = 97,
266 SCI_BaudRate_57_6_kBaud = 33,
267 SCI_BaudRate_115_2_kBaud = 15
268 } SCI_BaudRate_e;
269
270
273 typedef enum
274 {
275 SCI_CharLength_1_Bit=(0 << 0),
276 SCI_CharLength_2_Bits=(1 << 0),
277 SCI_CharLength_3_Bits=(2 << 0),
278 SCI_CharLength_4_Bits=(3 << 0),
279 SCI_CharLength_5_Bits=(4 << 0),
280 SCI_CharLength_6_Bits=(5 << 0),
281 SCI_CharLength_7_Bits=(6 << 0),
282 SCI_CharLength_8_Bits=(7 << 0)
283 } SCI_CharLength_e;
284
285
288 typedef enum
289 {
290 SCI_Mode_IdleLine=(0 << 3),
291 SCI_Mode_AddressBit=(1 << 3)
292 } SCI_Mode_e;
293
294
297 typedef enum
298 {
299 SCI_NumStopBits_One=(0 << 7),
300 SCI_NumStopBits_Two=(1 << 7)
301 } SCI_NumStopBits_e;
302
303
306 typedef enum
307 {
308 SCI_Parity_Odd=(0 << 6),
309 SCI_Parity_Even=(1 << 6)
310 } SCI_Parity_e;
311
312
315 typedef enum
316 {
317 SCI_Priority_Immediate=(0 << 3),
318 SCI_Priority_FreeRun=(1 << 3),
319 SCI_Priority_AfterRxRxSeq=(2 << 3)
320 } SCI_Priority_e;
321
322
325 typedef enum
326 {
327 SCI_FifoLevel_Empty=(0 << 0),
328 SCI_FifoLevel_1_Word=(1 << 0),
329 SCI_FifoLevel_2_Words=(2 << 0),
330 SCI_FifoLevel_3_Words=(3 << 0),
331 SCI_FifoLevel_4_Words=(4 << 0)
332 } SCI_FifoLevel_e;
333
334
337 typedef enum
338 {
339 SCI_FifoStatus_Empty=(0 << 8),
340 SCI_FifoStatus_1_Word=(1 << 8),
341 SCI_FifoStatus_2_Words=(2 << 8),
342 SCI_FifoStatus_3_Words=(3 << 8),
343 SCI_FifoStatus_4_Words=(4 << 8)
344 } SCI_FifoStatus_e;
345
346
349 typedef struct _SCI_Obj_
350 {
351 volatile uint16_t SCICCR;
352 volatile uint16_t SCICTL1;
353 volatile uint16_t SCIHBAUD;
354 volatile uint16_t SCILBAUD;
355 volatile uint16_t SCICTL2;
356 volatile uint16_t SCIRXST;
357 volatile uint16_t SCIRXEMU;
358 volatile uint16_t SCIRXBUF;
359 volatile uint16_t rsvd_1;
360 volatile uint16_t SCITXBUF;
361 volatile uint16_t SCIFFTX;
362 volatile uint16_t SCIFFRX;
363 volatile uint16_t SCIFFCT;
364 volatile uint16_t rsvd_2[2];
365 volatile uint16_t SCIPRI;
366 } SCI_Obj;
367
368
371 typedef struct _SCI_Obj_ *SCI_Handle;
372
373
374 // **************************************************************************
375 // the globals
376
377
378 // **************************************************************************
379 // the function prototypes
380
383 extern void SCI_clearAutoBaudDetect(SCI_Handle sciHandle);
384
385
388 extern void SCI_clearRxFifoOvf(SCI_Handle sciHandle);
389
390
393 extern void SCI_clearRxFifoInt(SCI_Handle sciHandle);
394
395
398 extern void SCI_clearTxFifoInt(SCI_Handle sciHandle);
399
400
403 extern void SCI_disable(SCI_Handle sciHandle);
404
405
408 extern void SCI_disableAutoBaudAlign(SCI_Handle sciHandle);
409
410
413 extern void SCI_disableLoopBack(SCI_Handle sciHandle);
414
415
418 extern void SCI_disableParity(SCI_Handle sciHandle);
419
420
423 extern void SCI_disableRx(SCI_Handle sciHandle);
424
425
428 extern void SCI_disableRxErrorInt(SCI_Handle sciHandle);
429
430
433 extern void SCI_disableRxFifoInt(SCI_Handle sciHandle);
434
435
438 extern void SCI_disableRxInt(SCI_Handle sciHandle);
439
440
443 extern void SCI_disableSleep(SCI_Handle sciHandle);
444
445
448 extern void SCI_disableTx(SCI_Handle sciHandle);
449
450
453 extern void SCI_disableTxFifoEnh(SCI_Handle sciHandle);
454
455
458 extern void SCI_disableTxFifoInt(SCI_Handle sciHandle);
459
460
463 extern void SCI_disableTxInt(SCI_Handle sciHandle);
464
465
468 extern void SCI_disableTxWake(SCI_Handle sciHandle);
469
470
473 extern void SCI_enable(SCI_Handle sciHandle);
474
475
478 extern void SCI_enableAutoBaudAlign(SCI_Handle sciHandle);
479
480
483 extern void SCI_enableChannels(SCI_Handle sciHandle);
484
485
488 extern void SCI_enableLoopBack(SCI_Handle sciHandle);
489
490
493 extern void SCI_enableParity(SCI_Handle sciHandle);
494
495
498 extern void SCI_enableRx(SCI_Handle sciHandle);
499
500
503 extern void SCI_enableRxErrorInt(SCI_Handle sciHandle);
504
505
508 extern void SCI_enableRxInt(SCI_Handle sciHandle);
509
510
513 extern void SCI_enableSleep(SCI_Handle sciHandle);
514
515
518 extern void SCI_enableRxFifo(SCI_Handle sciHandle);
519
520
523 extern void SCI_enableRxFifoInt(SCI_Handle sciHandle);
524
525
528 extern void SCI_enableTx(SCI_Handle sciHandle);
529
530
533 extern void SCI_enableTxFifo(SCI_Handle sciHandle);
534
535
538 extern void SCI_enableTxFifoEnh(SCI_Handle sciHandle);
539
540
543 extern void SCI_enableTxFifoInt(SCI_Handle sciHandle);
544
545
548 extern void SCI_enableTxInt(SCI_Handle sciHandle);
549
550
553 extern void SCI_enableTxWake(SCI_Handle sciHandle);
554
555
559 extern uint16_t SCI_getDataBlocking(SCI_Handle sciHandle);
560
561
566 extern uint16_t SCI_getDataNonBlocking(SCI_Handle sciHandle, uint16_t * success);
567
568
572 extern SCI_FifoStatus_e SCI_getRxFifoStatus(SCI_Handle sciHandle);
573
574
578 extern SCI_FifoStatus_e SCI_getTxFifoStatus(SCI_Handle sciHandle);
579
580
585 extern SCI_Handle SCI_init(void *pMemory,const size_t numBytes);
586
587
591 extern void SCI_putDataBlocking(SCI_Handle sciHandle, uint16_t data);
592
593
598 extern uint16_t SCI_putDataNonBlocking(SCI_Handle sciHandle, uint16_t data);
599
600
604 static inline uint16_t SCI_read(SCI_Handle sciHandle)
605 {
606 SCI_Obj *sci = (SCI_Obj *)sciHandle;
607
608
609 // get the data
610 uint16_t data = sci->SCIRXBUF;
611
612 return(data);
613 } // end of SCI_read() function
614
615
618 extern void SCI_reset(SCI_Handle sciHandle);
619
620
623 extern void SCI_resetChannels(SCI_Handle sciHandle);
624
625
628 extern void SCI_resetRxFifo(SCI_Handle sciHandle);
629
630
633 extern void SCI_resetTxFifo(SCI_Handle sciHandle);
634
635
639 static inline bool SCI_rxDataReady(SCI_Handle sciHandle)
640 {
641 SCI_Obj *sci = (SCI_Obj *)sciHandle;
642 bool status;
643
644 status = (sci->SCIRXST & SCI_SCIRXST_RXRDY_BITS) >> 6;
645
646 return((bool)status);
647 } // end of SCI_rxDataReady() function
648
649
653 extern void SCI_setBaudRate(SCI_Handle sciHandle,const SCI_BaudRate_e baudRate);
654
655
659 extern void SCI_setCharLength(SCI_Handle sciHandle,const SCI_CharLength_e charLength);
660
661
665 extern void SCI_setMode(SCI_Handle sciHandle,const SCI_Mode_e mode);
666
667
671 extern void SCI_setNumStopBits(SCI_Handle sciHandle,const SCI_NumStopBits_e numBits);
672
673
677 extern void SCI_setPriority(SCI_Handle sciHandle,const SCI_Priority_e priority);
678
679
683 extern void SCI_setParity(SCI_Handle sciHandle,const SCI_Parity_e parity);
684
685
689 extern void SCI_setTxDelay(SCI_Handle sciHandle,const uint_least8_t delay);
690
691
695 extern void SCI_setTxFifoIntLevel(SCI_Handle sciHandle,const SCI_FifoLevel_e fifoLevel);
696
697
701 extern void SCI_setRxFifoIntLevel(SCI_Handle sciHandle,const SCI_FifoLevel_e fifoLevel);
702
703
707 static inline bool SCI_txReady(SCI_Handle sciHandle)
708 {
709 SCI_Obj *sci = (SCI_Obj *)sciHandle;
710 bool status;
711
712 status = (sci->SCICTL2 & SCI_SCICTL2_TXRDY_BITS) >> 7;
713
714 return((bool)status);
715 } // end of SCI_txReady() function
716
717
721 static inline void SCI_write(SCI_Handle sciHandle,const uint16_t data)
722 {
723 SCI_Obj *sci = (SCI_Obj *)sciHandle;
724
725
726 // write the data
727 sci->SCITXBUF = data;
728
729 return;
730 } // end of SCI_write() function
731
732
733 #ifdef __cplusplus
734 }
735 #endif // extern "C"
736
738 #endif // end of _SCI_H_ definition
739
SCI_Handle
struct _SCI_Obj_ * SCI_Handle
Defines the serial communications interface (SCI) handle.
Definition: sci.h:371
SCI_clearAutoBaudDetect
void SCI_clearAutoBaudDetect(SCI_Handle sciHandle)
Clears the auto baud detect mode.
Definition: sci.c:57
SCI_getDataBlocking
uint16_t SCI_getDataBlocking(SCI_Handle sciHandle)
Gets data from the serial communications interface (Blocking)
Definition: sci.c:477
SCI_setPriority
void SCI_setPriority(SCI_Handle sciHandle, const SCI_Priority_e priority)
Sets the serial communications interface (SCI) priority.
Definition: sci.c:686
SCI_reset
void SCI_reset(SCI_Handle sciHandle)
Resets the serial communications interface (SCI)
Definition: sci.c:574
SCI_FifoStatus_2_Words
Denotes the fifo contains 2 words.
Definition: sci.h:341
SCI_Obj
struct _SCI_Obj_ SCI_Obj
Defines the serial communications interface (SCI) object.
SCI_enableTxWake
void SCI_enableTxWake(SCI_Handle sciHandle)
Enables the serial communications interface (SCI) wakeup method.
Definition: sci.c:465
SCI_FifoLevel_e
SCI_FifoLevel_e
Enumeration to define the serial communications interface (SCI) FIFO level.
Definition: sci.h:325
SCI_Parity_Even
Denotes even parity.
Definition: sci.h:309
SCI_enable
void SCI_enable(SCI_Handle sciHandle)
Enables the serial communications interface (SCI)
Definition: sci.c:273
SCI_enableTx
void SCI_enableTx(SCI_Handle sciHandle)
Enables the serial communications interface (SCI) masater/slave transmit mode.
Definition: sci.c:405
SCI_enableRxInt
void SCI_enableRxInt(SCI_Handle sciHandle)
Enables the serial communications interface (SCI) receive interrupt.
Definition: sci.c:357
_SCI_Obj_::SCIFFTX
volatile uint16_t SCIFFTX
SCI FIFO Transmit Register.
Definition: sci.h:361
SCI_disable
void SCI_disable(SCI_Handle sciHandle)
Disables the serial communications interface (SCI) interrupt.
Definition: sci.c:105
SCI_FifoStatus_Empty
Denotes the fifo is empty.
Definition: sci.h:339
SCI_CharLength_6_Bits
Denotes a character length of 6 bits.
Definition: sci.h:280
SCI_disableTx
void SCI_disableTx(SCI_Handle sciHandle)
Disables the serial communications interface (SCI) master/slave transmit mode.
Definition: sci.c:213
SCI_Mode_IdleLine
Denotes idle-line mode protocol.
Definition: sci.h:290
SCI_enableAutoBaudAlign
void SCI_enableAutoBaudAlign(SCI_Handle sciHandle)
Enable the serial communications interface (SCI) auto baud alignment.
Definition: sci.c:285
SCI_setMode
void SCI_setMode(SCI_Handle sciHandle, const SCI_Mode_e mode)
Sets the serial communications interface (SCI) miltprocessor mode.
Definition: sci.c:656
SCI_Priority_FreeRun
Denotes free running.
Definition: sci.h:318
_SCI_Obj_::SCIPRI
volatile uint16_t SCIPRI
SCI Priority Register.
Definition: sci.h:365
SCI_NumStopBits_Two
Denotes 2 stop bits.
Definition: sci.h:300
SCI_Mode_AddressBit
Denotes address-bit mode protocol.
Definition: sci.h:291
SCI_enableTxFifoInt
void SCI_enableTxFifoInt(SCI_Handle sciHandle)
Enables the serial communications interface (SCI) transmit FIFO interrupt.
Definition: sci.c:441
SCI_setRxFifoIntLevel
void SCI_setRxFifoIntLevel(SCI_Handle sciHandle, const SCI_FifoLevel_e fifoLevel)
Sets the serial communications interface (SCI) receive FIFO level for generating an interrupt...
Definition: sci.c:727
SCI_BaudRate_115_2_kBaud
Denotes 115.2 kBaud.
Definition: sci.h:267
SCI_BaudRate_57_6_kBaud
Denotes 57.6 kBaud.
Definition: sci.h:266
SCI_SCICTL2_TXRDY_BITS
#define SCI_SCICTL2_TXRDY_BITS
Defines the location of the RX EMPTY bits in the SCICTL2 register.
Definition: sci.h:142
SCI_Priority_Immediate
Denotes an immediate stop.
Definition: sci.h:317
_SCI_Obj_::rsvd_2
volatile uint16_t rsvd_2[2]
Reserved.
Definition: sci.h:364
SCI_enableParity
void SCI_enableParity(SCI_Handle sciHandle)
Enables the serial peripheral interface (SCI) parity.
Definition: sci.c:321
_SCI_Obj_::SCICTL1
volatile uint16_t SCICTL1
SCI Control Register 1.
Definition: sci.h:352
SCI_enableTxFifo
void SCI_enableTxFifo(SCI_Handle sciHandle)
Enables the serial communications interface (SCI) transmit FIFO.
Definition: sci.c:417
SCI_enableRxFifoInt
void SCI_enableRxFifoInt(SCI_Handle sciHandle)
Enables the serial communications interface (SCI) receive FIFO interrupt.
Definition: sci.c:393
SCI_FifoStatus_1_Word
Denotes the fifo contains 1 word.
Definition: sci.h:340
SCI_FifoLevel_4_Words
Denotes the fifo contains 4 words.
Definition: sci.h:331
SCI_disableLoopBack
void SCI_disableLoopBack(SCI_Handle sciHandle)
Disables the serial peripheral interface (SCI) loop back mode.
Definition: sci.c:129
SCI_rxDataReady
static bool SCI_rxDataReady(SCI_Handle sciHandle)
Determines if the serial communications interface (SCI) has receive data ready.
Definition: sci.h:639
SCI_FifoStatus_e
SCI_FifoStatus_e
Enumeration to define the serial communications interface (SCI) FIFO status.
Definition: sci.h:337
SCI_setCharLength
void SCI_setCharLength(SCI_Handle sciHandle, const SCI_CharLength_e charLength)
Sets the serial communications interface (SCI) character length.
Definition: sci.c:641
SCI_CharLength_1_Bit
Denotes a character length of 1 bit.
Definition: sci.h:275
SCI_enableSleep
void SCI_enableSleep(SCI_Handle sciHandle)
Enables the serial communications interface (SCI) sleep mode.
Definition: sci.c:369
SCI_setBaudRate
void SCI_setBaudRate(SCI_Handle sciHandle, const SCI_BaudRate_e baudRate)
Sets the serial communications interface (SCI) baud rate.
Definition: sci.c:628
SCI_Priority_AfterRxRxSeq
Denotes that a stop after the current receive/transmit sequence.
Definition: sci.h:319
SCI_read
static uint16_t SCI_read(SCI_Handle sciHandle)
Reads data from the serial communications interface (SCI)
Definition: sci.h:604
SCI_enableTxFifoEnh
void SCI_enableTxFifoEnh(SCI_Handle sciHandle)
Enables the serial communications interface (SCI) transmit FIFO enhancements.
Definition: sci.c:429
SCI_getDataNonBlocking
uint16_t SCI_getDataNonBlocking(SCI_Handle sciHandle, uint16_t *success)
Read data from the serial communications interface (Non-Blocking)
Definition: sci.c:489
SCI_SCIRXST_RXRDY_BITS
#define SCI_SCIRXST_RXRDY_BITS
Defines the location of the RXRDY bits in the SCIRXST register.
Definition: sci.h:167
SCI_FifoLevel_1_Word
Denotes the fifo contains 1 word.
Definition: sci.h:328
SCI_disableRxFifoInt
void SCI_disableRxFifoInt(SCI_Handle sciHandle)
Disables the serial communications interface (SCI) receive FIFO interrupt.
Definition: sci.c:177
SCI_disableRxErrorInt
void SCI_disableRxErrorInt(SCI_Handle sciHandle)
Disables the serial communications interface (SCI) receive error interrupt.
Definition: sci.c:165
_SCI_Obj_::SCITXBUF
volatile uint16_t SCITXBUF
SCI Transmit Data Buffer Register.
Definition: sci.h:360
SCI_NumStopBits_e
SCI_NumStopBits_e
Enumeration to define the serial communications interface (SCI) number of stop bits.
Definition: sci.h:297
SCI_setNumStopBits
void SCI_setNumStopBits(SCI_Handle sciHandle, const SCI_NumStopBits_e numBits)
Sets the serial communications interface (SCI) number of stop bits.
Definition: sci.c:671
SCI_FifoStatus_3_Words
Denotes the fifo contains 3 words.
Definition: sci.h:342
SCI_clearRxFifoOvf
void SCI_clearRxFifoOvf(SCI_Handle sciHandle)
Clears the Rx FIFO overflow flag.
Definition: sci.c:69
SCI_CharLength_4_Bits
Denotes a character length of 4 bits.
Definition: sci.h:278
_SCI_Obj_
Defines the serial communications interface (SCI) object.
Definition: sci.h:349
SCI_BaudRate_9_6_kBaud
Denotes 9.6 kBaud.
Definition: sci.h:264
SCI_resetTxFifo
void SCI_resetTxFifo(SCI_Handle sciHandle)
Resets the serial communications interface (SCI) transmit FIFO.
Definition: sci.c:614
SCI_disableParity
void SCI_disableParity(SCI_Handle sciHandle)
Disable the parity.
Definition: sci.c:141
SCI_disableAutoBaudAlign
void SCI_disableAutoBaudAlign(SCI_Handle sciHandle)
Disable the serial communications interface (SCI) auto baud alignment.
Definition: sci.c:117
SCI_CharLength_e
SCI_CharLength_e
Enumeration to define the serial communications interface (SCI) character lengths.
Definition: sci.h:273
SCI_CharLength_3_Bits
Denotes a character length of 3 bits.
Definition: sci.h:277
SCI_enableRxFifo
void SCI_enableRxFifo(SCI_Handle sciHandle)
Enables the serial communications interface (SCI) receive FIFO.
Definition: sci.c:381
SCI_disableRxInt
void SCI_disableRxInt(SCI_Handle sciHandle)
Disables the serial communications interface (SCI) receive interrupt.
Definition: sci.c:189
SCI_txReady
static bool SCI_txReady(SCI_Handle sciHandle)
Determines if the serial communications interface (SCI) is ready to transmit.
Definition: sci.h:707
SCI_setTxDelay
void SCI_setTxDelay(SCI_Handle sciHandle, const uint_least8_t delay)
Sets the serial communications interface (SCI) transmit delay.
Definition: sci.c:713
_SCI_Obj_::SCICTL2
volatile uint16_t SCICTL2
SCI Control Register 2.
Definition: sci.h:355
SCI_BaudRate_19_2_kBaud
Denotes 19.2 kBaud.
Definition: sci.h:265
SCI_Priority_e
SCI_Priority_e
Enumeration to define the serial communications interface (SCI) emulation suspend priority...
Definition: sci.h:315
_SCI_Obj_::rsvd_1
volatile uint16_t rsvd_1
Reserved.
Definition: sci.h:359
SCI_enableLoopBack
void SCI_enableLoopBack(SCI_Handle sciHandle)
Enables the serial peripheral interface (SCI) loop back mode.
Definition: sci.c:309
SCI_setParity
void SCI_setParity(SCI_Handle sciHandle, const SCI_Parity_e parity)
Sets the serial communications interface (SCI) parity.
Definition: sci.c:698
SCI_enableTxInt
void SCI_enableTxInt(SCI_Handle sciHandle)
Enables the serial communications interface (SCI) transmit interrupt.
Definition: sci.c:453
cpu.h
Contains public interface to various functions related to the central processing unit (CPU) object...
_SCI_Obj_::SCIRXBUF
volatile uint16_t SCIRXBUF
SCI Receive Data Buffer Register.
Definition: sci.h:358
SCI_putDataNonBlocking
uint16_t SCI_putDataNonBlocking(SCI_Handle sciHandle, uint16_t data)
Writes data to the serial communications interface (Non-Blocking)
Definition: sci.c:558
SCI_resetRxFifo
void SCI_resetRxFifo(SCI_Handle sciHandle)
Resets the serial communications interface (SCI) receive FIFO.
Definition: sci.c:600
SCI_getRxFifoStatus
SCI_FifoStatus_e SCI_getRxFifoStatus(SCI_Handle sciHandle)
Gets the serial communications interface (SCI) receive FIFO status.
Definition: sci.c:504
_SCI_Obj_::SCIRXEMU
volatile uint16_t SCIRXEMU
SCI Receive Emulation Data Buffer Register.
Definition: sci.h:357
SCI_CharLength_8_Bits
Denotes a character length of 8 bits.
Definition: sci.h:282
SCI_disableTxWake
void SCI_disableTxWake(SCI_Handle sciHandle)
Disables the serial communications interface (SCI) wakeup method.
Definition: sci.c:261
SCI_enableChannels
void SCI_enableChannels(SCI_Handle sciHandle)
Enable the serial communications interface (SCI) transmit and receive channels.
Definition: sci.c:297
_SCI_Obj_::SCIHBAUD
volatile uint16_t SCIHBAUD
SCI Baud Register, High Bits.
Definition: sci.h:353
SCI_disableTxFifoEnh
void SCI_disableTxFifoEnh(SCI_Handle sciHandle)
Disables the serial communications interface (SCI) transmit FIFO enhancements.
Definition: sci.c:225
SCI_disableSleep
void SCI_disableSleep(SCI_Handle sciHandle)
Disables the serial communications interface (SCI) sleep mode.
Definition: sci.c:201
SCI_Mode_e
SCI_Mode_e
Enumeration to define the serial communications interface (SCI) multiprocessor protocol mode...
Definition: sci.h:288
SCI_write
static void SCI_write(SCI_Handle sciHandle, const uint16_t data)
Writes data to the serial communications interface (SCI)
Definition: sci.h:721
SCI_getTxFifoStatus
SCI_FifoStatus_e SCI_getTxFifoStatus(SCI_Handle sciHandle)
Gets the serial communications interface (SCI) transmit FIFO status.
Definition: sci.c:516
SCI_putDataBlocking
void SCI_putDataBlocking(SCI_Handle sciHandle, uint16_t data)
Writes data to the serial communications interface (Blocking)
Definition: sci.c:543
SCI_CharLength_2_Bits
Denotes a character length of 2 bits.
Definition: sci.h:276
SCI_clearTxFifoInt
void SCI_clearTxFifoInt(SCI_Handle sciHandle)
Clears the Tx FIFO interrupt flag.
Definition: sci.c:93
SCI_disableTxInt
void SCI_disableTxInt(SCI_Handle sciHandle)
Disables the serial communications interface (SCI) transmit interrupt.
Definition: sci.c:249
_SCI_Obj_::SCIFFRX
volatile uint16_t SCIFFRX
SCI FIFO Receive Register.
Definition: sci.h:362
SCI_enableRx
void SCI_enableRx(SCI_Handle sciHandle)
Enables the serial peripheral interface (SCI) receiver.
Definition: sci.c:333
SCI_disableRx
void SCI_disableRx(SCI_Handle sciHandle)
Disables the serial communications interface (SCI) master/slave receive mode.
Definition: sci.c:153
SCI_Parity_e
SCI_Parity_e
Enumeration to define the serial communications interface (SCI) parity.
Definition: sci.h:306
_SCI_Obj_::SCIFFCT
volatile uint16_t SCIFFCT
SCI FIFO Control Register.
Definition: sci.h:363
SCI_CharLength_5_Bits
Denotes a character length of 5 bits.
Definition: sci.h:279
SCI_FifoLevel_2_Words
Denotes the fifo contains 2 words.
Definition: sci.h:329
SCI_Parity_Odd
Denotes odd parity.
Definition: sci.h:308
SCI_BaudRate_e
SCI_BaudRate_e
Enumeration to define the serial communications interface (SCI) baud rates. This enumeration assume a...
Definition: sci.h:262
SCI_FifoLevel_Empty
Denotes the fifo is empty.
Definition: sci.h:327
_SCI_Obj_::SCICCR
volatile uint16_t SCICCR
SCI Configuration Control Register.
Definition: sci.h:351
SCI_NumStopBits_One
Denotes 1 stop bit.
Definition: sci.h:299
SCI_enableRxErrorInt
void SCI_enableRxErrorInt(SCI_Handle sciHandle)
Enables the serial communications interface (SCI) receive error interrupt.
Definition: sci.c:345
SCI_disableTxFifoInt
void SCI_disableTxFifoInt(SCI_Handle sciHandle)
Disables the serial communications interface (SCI) transmit FIFO interrupt.
Definition: sci.c:237
_SCI_Obj_::SCIRXST
volatile uint16_t SCIRXST
SCI Receive Status Register.
Definition: sci.h:356
SCI_CharLength_7_Bits
Denotes a character length of 7 bits.
Definition: sci.h:281
SCI_setTxFifoIntLevel
void SCI_setTxFifoIntLevel(SCI_Handle sciHandle, const SCI_FifoLevel_e fifoLevel)
Sets the serial communications interface (SCI) transmit FIFO level for generating an interrupt...
Definition: sci.c:741
SCI_FifoStatus_4_Words
Denotes the fifo contains 4 words.
Definition: sci.h:343
SCI_clearRxFifoInt
void SCI_clearRxFifoInt(SCI_Handle sciHandle)
Clears the Rx FIFO interrupt flag.
Definition: sci.c:81
SCI_FifoLevel_3_Words
Denotes the fifo contains 3 words.
Definition: sci.h:330
_SCI_Obj_::SCILBAUD
volatile uint16_t SCILBAUD
SCI Baud Register, Low Bits.
Definition: sci.h:354
SCI_init
SCI_Handle SCI_init(void *pMemory, const size_t numBytes)
Initializes the serial communications interface (SCI) object handle.
Definition: sci.c:528
SCI_resetChannels
void SCI_resetChannels(SCI_Handle sciHandle)
Resets the serial communications interface (SCI) transmit and receive channels.
Definition: sci.c:586