Manages UART transmits through peripheral DMA controller (PDC).
More...
#include <PDC.hpp>
|
| PDC () |
| Default constructor for the PDC class. Initializes all relevant register pointers.
|
|
void | init () |
| Turns on PDC, waits until ready. Must be called AFTER Serial.begin() in setup().
|
|
template<typename T > |
void | send (T *buffer, int size) |
| Adds data to the PDC buffer to be sent out through UART.
|
|
template<typename T > |
void | send_next (T *buffer, int size) |
| Adds data to the backup PDC buffer. Identical to send().
|
|
bool | is_on () |
| Checks if the PDC and UART are on.
|
|
void | enableUARTInterrupt () |
|
void | UART_Handler () |
|
Manages UART transmits through peripheral DMA controller (PDC).
Definition at line 33 of file PDC.hpp.
◆ PDC()
Default constructor for the PDC class. Initializes all relevant register pointers.
Definition at line 53 of file PDC.hpp.
◆ enableUARTInterrupt()
void PDC::enableUARTInterrupt |
( |
| ) |
|
|
inline |
◆ init()
Turns on PDC, waits until ready. Must be called AFTER Serial.begin() in setup().
Definition at line 67 of file PDC.hpp.
◆ is_on()
Checks if the PDC and UART are on.
Definition at line 145 of file PDC.hpp.
◆ send()
template<typename T >
void PDC::send |
( |
T * |
buffer, |
|
|
int |
size |
|
) |
| |
|
inline |
Adds data to the PDC buffer to be sent out through UART.
- Template Parameters
-
T | - data type of buffer - either char pointer or integer array |
- Parameters
-
buffer | - pointer to data buffer. Note that it doesn't like pointer casts, so global pointers to sentinels must be used. That's not an issue with Arduino's Serial library because it's blocking - avoiding that is the whole point of this. |
size | - size of buffer |
This can also handle text in an ASCII readable format by using a char pointer:
String message = "Hello World!";
uint8_t* p_message = (uint8_t*)message.c_str();
pdc.
send(p_message,
sizeof(message));
void send(T *buffer, int size)
Adds data to the PDC buffer to be sent out through UART.
But, Serial.print() is recommended for any debugging application to avoid global declarations.
Note for later - negative numbers are sent as two's complement. make sure Jules' parser is reading that correctly.
Definition at line 96 of file PDC.hpp.
◆ send_next()
template<typename T >
void PDC::send_next |
( |
T * |
buffer, |
|
|
int |
size |
|
) |
| |
|
inline |
Adds data to the backup PDC buffer. Identical to send().
Definition at line 122 of file PDC.hpp.
◆ UART_Handler()
void PDC::UART_Handler |
( |
| ) |
|
|
inline |
◆ backup_buffer
uint8_t PDC::backup_buffer[294] |
|
private |
◆ p_UART_PTCR
volatile uint32_t* const PDC::p_UART_PTCR |
|
private |
◆ p_UART_PTSR
volatile uint32_t* const PDC::p_UART_PTSR |
|
private |
◆ p_UART_SR
volatile uint32_t* const PDC::p_UART_SR |
|
private |
◆ p_UART_TCR
volatile uint32_t* const PDC::p_UART_TCR |
|
private |
◆ p_UART_TNCR
volatile uint32_t* const PDC::p_UART_TNCR |
|
private |
◆ p_UART_TNPR
volatile uint32_t* const PDC::p_UART_TNPR |
|
private |
◆ p_UART_TPR
volatile uint32_t* const PDC::p_UART_TPR |
|
private |
The documentation for this class was generated from the following file: