Implement Uart RX functionality. UART RX works. DMX frame detection not yet implemented.

This commit is contained in:
2022-06-21 22:04:44 +02:00
parent 4166396f75
commit 3faab7173c
3 changed files with 113 additions and 3 deletions

View File

@@ -1,4 +1,43 @@
#ifndef _DMX_H_
#define _DMX_H_
#include <stdint.h>
#include <stdbool.h>
#define DMX_UNIVERSE_SIZE (255u)
#define DMX_USED_CHANNEL_COUNT (129u)
/**
* @brief Init DMX reception
*
* DMX data is received from the base channel onwards:
* - R LED1
* - G LED1
* - B LED1
* - W LED1
* - R LED2
* ...
* - W LED32
* - W DISCRETE
*
* In Sum: 129 8 bit channels
*
* @param base_channel Base channel the ring light will listen on
*/
void dmx_init(uint32_t base_channel);
/**
* @brief Has new DMX data been received?
* @return true if new data is available
*/
bool dmx_new_data_available(void);
/**
* @brief Returns the array of the 129 DMX channels
* @return
*/
const uint8_t *dmx_get_data(void);
#endif /* _DMX_H_ */