PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
simple
serial_close.c
1
/*
2
* @file SimpleSerial_close.c
3
*
4
* Copyright (c) 2013, Parallax Inc.
5
* Written by Steve Denson
6
*/
7
#include <propeller.h>
8
#include <stdlib.h>
9
#include "serial.h"
10
11
void
serial_close(
serial
*device)
12
{
13
if
(!device)
14
return
;
15
Serial_t
*sp = (
Serial_t
*) device->
devst
;
16
OUTA &= ~(1 << sp->
tx_pin
);
17
DIRA &= ~(1 << sp->
tx_pin
);
18
DIRA &= ~(1 << sp->
rx_pin
);
19
free((
void
*)device->
devst
);
20
free(device);
21
device = 0;
22
}
23
24
/*
25
+--------------------------------------------------------------------
26
| TERMS OF USE: MIT License
27
+--------------------------------------------------------------------
28
Permission is hereby granted, free of charge, to any person obtaining
29
a copy of this software and associated documentation files
30
(the "Software"), to deal in the Software without restriction,
31
including without limitation the rights to use, copy, modify, merge,
32
publish, distribute, sublicense, and/or sell copies of the Software,
33
and to permit persons to whom the Software is furnished to do so,
34
subject to the following conditions:
35
36
The above copyright notice and this permission notice shall be
37
included in all copies or substantial portions of the Software.
38
39
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
40
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
41
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
42
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
43
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
44
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
45
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
46
+--------------------------------------------------------------------
47
*/
serial_info::tx_pin
int tx_pin
Definition:
serial.h:58
text_struct::devst
volatile void * devst
Definition:
simpletext.h:79
serial_info::rx_pin
int rx_pin
Definition:
serial.h:57
text_struct
Structure that contains data used by simple text device libraries.
Definition:
simpletext.h:70
serial_info
Defines serial interface structure of 9 contiguous int variables.
Definition:
serial.h:55
Generated on Sat Aug 27 2016 00:58:09 for PropWare by
1.8.12