| EVShield v1.3 EVShield Library Reference by mindsensors.com

EVShieldUART.h
1 /*
2 * EVShield interface library
3 * Copyright (C) 2015 mindsensors.com
4 *
5 * This file is part of EVShield interface library.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef EVShieldUART_H
22 #define EVShieldUART_H
23
24
25 #include "SHDefines.h"
26 #include "EVShield.h"
27
32 class EVShieldUART
33 {
34 public:
36 EVShield * mp_shield;
37
39 SH_BankPort m_bp;
40
43 int m_offset;
44
46 EVShieldUART();
47
49 EVShieldUART(EVShield * shield, SH_BankPort bp);
50
52 uint8_t getMode( );
53
55 bool setType(uint8_t type);
56
58 bool writeLocation(uint8_t loc, uint8_t data);
59
61 int16_t readLocationInt(uint8_t loc);
62
64 uint8_t readLocationByte(uint8_t loc);
65
67 bool init(EVShield * shield, SH_BankPort bp);
68
70 uint8_t setMode(char newMode);
71
73 uint16_t readValue();
74
76 bool readAndPrint(uint8_t loc, uint8_t len);
77 };
78
79
80 #endif
81
EVShieldUART::EVShieldUART
EVShieldUART()
Definition: EVShieldUART.cpp:24
EVShieldUART::readLocationByte
uint8_t readLocationByte(uint8_t loc)
Definition: EVShieldUART.cpp:97
EVShieldUART::readAndPrint
bool readAndPrint(uint8_t loc, uint8_t len)
Definition: EVShieldUART.cpp:157
EVShieldUART
EVShield UART Sensor class. also provides support for the EV3 Touch Sensor.
Definition: EVShieldUART.h:32
EVShieldUART::m_offset
int m_offset
Definition: EVShieldUART.h:43
EVShieldUART::init
bool init(EVShield *shield, SH_BankPort bp)
Definition: EVShieldUART.cpp:113
EVShieldUART::setMode
uint8_t setMode(char newMode)
Definition: EVShieldUART.cpp:144
SHDefines.h
EVShieldUART::mp_shield
EVShield * mp_shield
Definition: EVShieldUART.h:36
EVShieldUART::m_bp
SH_BankPort m_bp
Definition: EVShieldUART.h:39
EVShield
This class defines methods to access EVShield features.
Definition: EVShield.h:694
EVShieldUART::readValue
uint16_t readValue()
Definition: EVShieldUART.cpp:167
EVShieldUART::setType
bool setType(uint8_t type)
Definition: EVShieldUART.cpp:46
SH_BankPort
SH_BankPort
Definition: SHDefines.h:52
EVShieldUART::writeLocation
bool writeLocation(uint8_t loc, uint8_t data)
Definition: EVShieldUART.cpp:65
EVShieldUART::readLocationInt
int16_t readLocationInt(uint8_t loc)
Definition: EVShieldUART.cpp:81
EVShield.h
EVShieldUART::getMode
uint8_t getMode()
Definition: EVShieldUART.cpp:130