An initial port to the FRDM-K46Z based on the the following: https://developer.mbed.org/users/okini3939/notebook/dmx512/

Dependents:   FRDM-Dowser

Fork of DMX by Suga koubou

Embed: (wiki syntax)

« Back to documentation index

DMX Class Reference

DMX512 class (sender/client) More...

#include <DMX.h>

Public Member Functions

 DMX (PinName p_tx, PinName p_rx)
 init DMX class
void put (int addr, int data)
 Send the data.
void put (unsigned char *buf, int addr=0, int len=DMX_SIZE)
 Send the data.
int get (int addr)
 Send the data.
void get (unsigned char *buf, int addr=0, int len=DMX_SIZE)
 Send the data.
void start ()
 Start DMX send operation.
void stop ()
 Stop DMX send operation.
void clear ()
 Clear DMX data.
int get_mode_rx ()
 Get the receiver Mode.

Protected Member Functions

void int_timer ()
void int_rx ()

Detailed Description

DMX512 class (sender/client)

Definition at line 40 of file DMX.h.


Constructor & Destructor Documentation

DMX ( PinName  p_tx,
PinName  p_rx 
)

init DMX class

Parameters:
p_txTX serial port (p9, p13, p28)
p_rxRX serial port (p10, p14, p27)

Need to associate the _uart private variable with the user selected pin. Hook the interrupt pin.

Definition at line 14 of file DMX.cpp.


Member Function Documentation

void clear (  )

Clear DMX data.

Definition at line 265 of file DMX.cpp.

void get ( unsigned char *  buf,
int  addr = 0,
int  len = DMX_SIZE 
)

Send the data.

Parameters:
bufDMX data buffer
addrDMX data address
lendata length

Definition at line 101 of file DMX.cpp.

int get ( int  addr )

Send the data.

Parameters:
addrDMX data address (0-511)
Returns:
DMX data (0-255)

Definition at line 95 of file DMX.cpp.

int get_mode_rx (  )

Get the receiver Mode.

Definition at line 84 of file DMX.h.

void int_rx (  ) [protected]

looking for (7)erroneous data,(3) Framming Error, (4) Break

Definition at line 192 of file DMX.cpp.

void int_timer (  ) [protected]

Chapter 31.2 of the Freescale KE02 Sub-Famely Reference UARTx_C2 page 553 enable the transmitter and reciever Sending a break we write a one, then write a zero..... This sets send break bit

Bit 6 in the LCR enables the break signal.....

This sets the break charcter to zero to send the break.

Check the TDRE (Transmit Data Register Empty) flag... page 555 The data is placed in D on the Freescale

Bit 5 of the LSR indicates the THR (Transmit Holding Register) is empty

Definition at line 108 of file DMX.cpp.

void put ( unsigned char *  buf,
int  addr = 0,
int  len = DMX_SIZE 
)

Send the data.

Parameters:
bufDMX data buffer
addrDMX data address
lendata length

Definition at line 88 of file DMX.cpp.

void put ( int  addr,
int  data 
)

Send the data.

Parameters:
addrDMX data address (0-511)
dataDMX data (0-255)

Definition at line 82 of file DMX.cpp.

void start (  )

Start DMX send operation.

Definition at line 249 of file DMX.cpp.

void stop (  )

Stop DMX send operation.

Definition at line 258 of file DMX.cpp.