for some reason I would like to integrate a Spark Core intoo a DMX light controller. Currently I use a case with integrated power supply so all you need is to plug in power and DMX. As we use another DMX controller for simple light effects, I also need to switch the DMX line to the light controller.
With a Spark Core it should be possible to receive DMX signals (using DmxSerial) and send them as ArtNet-UDP-Packets over WiFi. As soon as the Spark Core device is online I can implement a rule that switches the DMX line to the ArtNet-Receiver (with data from Spark Core).
I don’t assume that generating valid ArtNet packets should be that complicated. My problem right now is that I don’t succeed to implement the DmxSerial library, which sounds to be the most simple solution, to the Spark Core firmware.
To port the DmxSerial to Spark Core I need to set all the registers for the USART-Serial interface, but I don’t have an idea how to get all these:
// These definitions are used on ATmega8 boards #define UCSRnA UCSRA // Control and Status Register A #define TXCn TXC // Transmit buffer clear #define UCSRnB UCSRB // USART Control and Status Register B #define RXCIEn RXCIE // Enable Receive Complete Interrupt #define TXCIEn TXCIE // Enable Transmission Complete Interrupt #define UDRIEn UDRIE // Enable Data Register Empty Interrupt #define RXENn RXEN // Enable Receiving #define TXENn TXEN // Enable Sending #define UCSRnC UCSRC // Control and Status Register C #define USBSn USBS // Stop bit select 0=1bit, 1=2bits #define UCSZn0 UCSZ0 // Character size 00=5, 01=6, 10=7, 11=8 bits #define UPMn0 UPM0 // Parity setting 00=N, 10=E, 11=O #define UBRRnH UBRRH // USART Baud Rate Register High #define UBRRnL UBRRL // USART Baud Rate Register Low #define UDRn UDR // USART Data Register #define UDREn UDRE // USART Data Ready #define FEn FE // Frame Error #define USARTn_RX_vect USART_RXC_vect // Interrupt Data received #define USARTn_TX_vect USART_TXC_vect // Interrupt Data sent #define USARTn_UDRE_vect USART_UDRE_vect // Interrupt Data Register empty
Any idea how I can get this library working?
edit: updated code formatting