PIC24 Support Libraries
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
lib
include
pic24_serial.h
Go to the documentation of this file.
1
/*
2
* "Copyright (c) 2008 Robert B. Reese, Bryan A. Jones, J. W. Bruce ("AUTHORS")"
3
* All rights reserved.
4
* (R. Reese, reese_AT_ece.msstate.edu, Mississippi State University)
5
* (B. A. Jones, bjones_AT_ece.msstate.edu, Mississippi State University)
6
* (J. W. Bruce, jwbruce_AT_ece.msstate.edu, Mississippi State University)
7
*
8
* Permission to use, copy, modify, and distribute this software and its
9
* documentation for any purpose, without fee, and without written agreement is
10
* hereby granted, provided that the above copyright notice, the following
11
* two paragraphs and the authors appear in all copies of this software.
12
*
13
* IN NO EVENT SHALL THE "AUTHORS" BE LIABLE TO ANY PARTY FOR
14
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
15
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE "AUTHORS"
16
* HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17
*
18
* THE "AUTHORS" SPECIFICALLY DISCLAIMS ANY WARRANTIES,
19
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21
* ON AN "AS IS" BASIS, AND THE "AUTHORS" HAS NO OBLIGATION TO
22
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
23
*
24
* Please maintain this header in its entirety when copying/modifying
25
* these files.
26
*
27
*
28
*/
29
30
31
// Documentation for this file. If the \file tag isn't present,
32
// this file won't be documented.
33
/** \file
34
* This file defines routines to send and receive data
35
* over the serial port. All hardware-specific routines
36
* are contained elsewhere.
37
* These are lightweight character I/O functions and are
38
* intended for use when \em printf overhead is too costly.
39
*/
40
41
#ifndef _PIC24_SERIAL_H_
42
#define _PIC24_SERIAL_H_
43
44
#include <stdint.h>
45
#include "
pic24_chip.h
"
46
#include "
pic24_libconfig.h
"
47
48
49
50
// Consistency check
51
#if (DEFAULT_UART > NUM_UART_MODS) || (DEFAULT_UART < 1)
52
#error Invalid choice of DEFAULT_UART
53
#endif
54
55
56
57
uint8_t
inChar
(
void
);
//blocking single character input
58
void
outString
(
const
char
* psz_s);
59
uint16_t
inString
(
char
*psz_buff,
int16_t
u16_maxCount);
60
uint16_t
inStringEcho
(
char
*psz_buff,
int16_t
u16_maxCount);
61
void
outChar
(
uint8_t
u8_c);
62
void
outUint8NoLeader (
uint8_t
u8_x);
63
void
outUint8
(
uint8_t
u8_x);
64
void
outUint16
(
uint16_t
u16_x);
65
void
outUint32
(
uint32_t
u32_x);
66
void
outUint8Decimal
(
uint8_t
u8_x);
67
void
outUint16Decimal
(
uint16_t
u16_x);
68
uint8_t
isCharReady
(
void
);
//determine if character is available to be read
69
70
uint8_t
inCharEcho
(
void
);
71
void
configDefaultUART
(
uint32_t
u32_baudRate);
72
73
#endif
Generated by
1.8.4