EE445M RTOS
Taken at the University of Texas Spring 2015
Main Page
Modules
Classes
Files
File List
File Members
switchpp.hpp
Go to the documentation of this file.
1
/* -*- mode: c++; c-basic-offset: 4; */
2
#ifndef __lswitchpp__
3
#define __lswitchpp__
4
5
#include <stdbool.h>
6
#include <stdint.h>
7
8
#include "
semaphorepp.hpp
"
9
#include "
timerpp.hpp
"
10
#include "
interruptable.hpp
"
11
12
#include "driverlib/gpio.h"
13
14
typedef
uint32_t
memory_address_t
;
15
16
class
lswitch
:
public
interruptable
{
17
private
:
18
memory_address_t
base
;
19
memory_address_t
pin
;
20
semaphore
*
sem
;
21
timer
tim
;
22
public
:
24
lswitch
();
25
lswitch
(
memory_address_t
lswitch_base,
memory_address_t
lswitch_pin,
26
semaphore
*sem,
timer_t
timer_id,
subtimer_t
timer_subtimer,
27
uint32_t switch_interrupt, uint32_t interrupt_mask = GPIO_BOTH_EDGES,
28
bool
start
=
false
);
29
30
virtual
void
start
(
void
);
31
virtual
void
stop
(
void
);
32
virtual
uint32_t
ack
(
void
);
33
34
void
debounce
(
void
);
35
uint32_t
end_debounce
(
void
);
36
38
uint32_t
sample
(
void
);
39
40
uint32_t
debounced_data
;
41
};
42
43
#endif
/* __LSWITCHPP__ */
44
45
/* Local Variables: */
46
/* firestarter: (compile "make -k -j32 -C ~/workspace/ee445m-labs/build/") */
47
/* End: */
memory_address_t
uint32_t memory_address_t
Definition:
adcpp.hpp:16
interruptable
Definition:
interruptable.hpp:14
lswitch::pin
memory_address_t pin
Definition:
switchpp.hpp:19
timer_t
uint8_t timer_t
Definition:
timerpp.hpp:20
lswitch
Definition:
switchpp.hpp:16
semaphore
Definition:
semaphorepp.hpp:17
timerpp.hpp
lswitch::end_debounce
uint32_t end_debounce(void)
Definition:
switchpp.cpp:74
memory_address_t
uint32_t memory_address_t
Definition:
switchpp.hpp:14
lswitch::debounced_data
uint32_t debounced_data
Definition:
switchpp.hpp:40
lswitch::ack
virtual uint32_t ack(void)
Definition:
switchpp.cpp:83
lswitch::sem
semaphore * sem
Definition:
switchpp.hpp:20
lswitch::sample
uint32_t sample(void)
Definition:
switchpp.cpp:88
lswitch::stop
virtual void stop(void)
Definition:
switchpp.cpp:59
lswitch::lswitch
lswitch()
Definition:
switchpp.cpp:15
semaphorepp.hpp
lswitch::start
virtual void start(void)
Definition:
switchpp.cpp:54
subtimer_t
uint32_t subtimer_t
Definition:
timerpp.hpp:21
lswitch::tim
timer tim
Definition:
switchpp.hpp:21
lswitch::debounce
void debounce(void)
Definition:
switchpp.cpp:65
lswitch::base
memory_address_t base
Definition:
switchpp.hpp:18
interruptable.hpp
timer
Definition:
timerpp.hpp:26
board-progs
autonomous-racer
common
switchpp.hpp
Generated on Fri May 8 2015 15:22:13 for EE445M RTOS by
1.8.9.1