10#include "AustralisConfig.h"
13#include "stm32f439xx.h"
16#include "event_groups.h"
17#include "message_buffer.h"
33static TaskHandle_t vUartTransmitHandle;
34static TaskHandle_t vUartReceiveHandle;
42void UART_setPeripheral(
UART_t *peripheral_) {
43 peripheral = peripheral_;
52void vUartTransmit(
void *argument) {
53 const TickType_t blockTime = portMAX_DELAY;
56 vUartTransmitHandle = xTaskGetCurrentTaskHandle();
60 if (peripheral == NULL)
64 BaseType_t result = WAIT_COMMENT(
65 uart.public.commentInbox,
70 if (result == pdTRUE) {
72 peripheral->send(peripheral, txData);
83void vUartReceive(
void *argument) {
84 const TickType_t blockTime = portMAX_DELAY;
87 vUartReceiveHandle = xTaskGetCurrentTaskHandle();
90 indicator.
reset(&indicator);
94 if (peripheral == NULL)
98 xTaskNotifyWait(0, 0, &rxData, portMAX_DELAY);
111void pubUartInterrupt() {
112 BaseType_t xHigherPriorityTaskWoken = pdFALSE;
115 if (peripheral == NULL)
118 if (peripheral->interface->SR & USART_SR_RXNE) {
119 uint8_t data = peripheral->interface->DR;
120 xTaskNotifyFromISR(vUartReceiveHandle, data, eSetValueWithOverwrite, &xHigherPriorityTaskWoken);
121 portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
bool Topic_publish(PrivateTopic *topic, uint8_t *article)
Publish an "article" to all discovered subscribers of a topic.
#define CREATE_TOPIC(topic, commentInboxSize, messageSize)
Macro to define and initialize a topic instance.
Internal representation of a Topic instance.
void(* reset)(struct GPIOpin *)
GPIOpin_t GPIOpin_init(GPIO_TypeDef *, GPIO_Pin, GPIO_Config *)
Initialiser for a GPIO peripheral pin interface.
Struct definition for a GPIO pin.
Struct definition for UART interface.
Public representation of a Topic.