PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Examples
PropWare_BufferedUART
buffereduartrx.cogcpp
Go to the documentation of this file.
1
26
#include "
BufferedUART_Demo.h
"
27
#include <
PropWare/serial/uart/uartrx.h
>
28
29
using
PropWare::UARTRX
;
30
31
_NATIVE
int
main
() {
32
CharQueue
*buffer = *
reinterpret_cast<
CharQueue
**
>
(
PAR
);
33
34
const
UARTRX
rx;
35
36
while
(1) {
37
const
char
c =
static_cast<
char
>
(rx.
receive
());
38
while
(buffer->
is_full
());
39
buffer->
enqueue
(c);
40
}
41
}
BufferedUART_Demo.h
_NATIVE
#define _NATIVE
Can be used in per-function declarations to tell compiler that function will use cog "call/ret" calli...
Definition:
cog.h:57
PropWare::Queue::is_full
bool is_full() const
Determine if inserting another element would overwrite data.
Definition:
queue.h:109
uartrx.h
PropWare::UARTRX
Receive routines for basic UART communication.
Definition:
uartrx.h:41
main
int main(void)
Definition:
GraphicsTest.c:20
PropWare::UARTRX::receive
uint32_t receive() const
Retrieve a single word from the bus.
Definition:
uartrx.h:104
PropWare::CharQueue
Provide a communication buffer for character data between cogs.
Definition:
charqueue.h:46
PropWare::Queue::enqueue
virtual Queue & enqueue(const T &value)
Insert an element to the buffer.
Definition:
queue.h:129
PAR
#define PAR
Parameter register is used for sharing HUB RAM address info with the COG.
Definition:
propeller1.h:149
Generated on Fri May 20 2022 16:48:01 for PropWare by
1.8.17