IPMCSDB Driver
Documentation
FOCUS Software Engineering

Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

ipmcsdb.h File Reference

Library for Max Technologies IPM422/CSDB modules header file. More...

Include dependency graph for ipmcsdb.h:

Include dependency graph

Typedefs

typedef IpmCsdbDescriptor * IpmCsdbHdl
 Handle for accessing the IPM422 module.


Enumerations

enum  IpmCsdbBitRate { IPMCSDB_12_5_KBIT = 0x13F, IPMCSDB_50_KBIT = 0x04F }
 Bit rate constants. More...

enum  IpmCsdbConfigOptions {
  IPMCSDB_CFG_DISABLE, IPMCSDB_CFG_ENABLE, IPMCSDB_CFG_NO_PARITY, IPMCSDB_CFG_EVEN_PARITY,
  IPMCSDB_CFG_ODD_PARITY, IPMCSDB_CFG_7_BIT, IPMCSDB_CFG_8_BIT, IPMCSDB_CFG_1_STOP_BIT,
  IPMCSDB_CFG_2_STOP_BIT, IPMCSDB_CFG_TX_OUT_ENABLE, IPMCSDB_CFG_TX_OUT_DISABLE, IPMCSDB_CFG_TX_OUT_AUTO,
  IPMCSDB_CFG_EXTERNAL, IPMCSDB_CFG_LOOPBACK, IPMCSDB_INT_DISABLE, IPMCSDB_INT_ENABLE
}
 Channel Configuration Options. More...

enum  

Functions

IpmCsdbHdl ipmCsdb_open (IpCarrierHdl ipCarrierHdl, int ipSlotNo, void(*intHandlerFunc)())
 Opens access to a Max Technologies 422/CSDB IPM422 module.

void ipmCsdb_close (IpmCsdbHdl ipModuleHdl)
 Closes access to the IP module and releases associated resources.

void ipmCsdb_sendNow (IpmCsdbHdl ipModuleHdl, int channel, uint8_t dataByte)
 Sends a CSDB word immediately.

void ipmCsdb_sendScheduled (IpmCsdbHdl ipModuleHdl, int channel, uint8_t dataByte, uint16_t timeTag)
 Sends a CSDB word time scheduled.

void ipmCsdb_txEnable (IpmCsdbHdl ipModuleHdl, int channel)
 Enables transmitter channel.

void ipmCsdb_txDisable (IpmCsdbHdl ipModuleHdl, int channel)
 Disables transmitter.

bool ipmCsdb_txIsEnabled (IpmCsdbHdl ipModuleHdl, int channel)
 Returns enable status of transmitter channel.

bool ipmCsdb_txIsFull (IpmCsdbHdl ipModuleHdl, int channel)
 Checks if transmitter is almost full.

bool ipmCsdb_txIsOverflown (IpmCsdbHdl ipModuleHdl, int channel)
 Returns buffer overflow status of transmitter and clears overflow condition.

void ipmCsdb_txIntEnable (IpmCsdbHdl ipModuleHdl, int channel)
 Enables transmit interrupt for a transmitter channel.

void ipmCsdb_txIntDisable (IpmCsdbHdl ipModuleHdl, int channel)
 Disables transmit interrupt for a transmitter channel.

bool ipmCsdb_txIntIsEnabled (IpmCsdbHdl ipModuleHdl, int channel)
 Returns interupt enable status of a transmitter channel.

bool ipmCsdb_receiveStamped (IpmCsdbHdl ipModuleHdl, int channel, uint8_t *csdbWordPtr, uint16_t *timeTagPtr)
 Retrieves a time-stamped CSDB word from receive buffer.

bool ipmCsdb_receive (IpmCsdbHdl ipModuleHdl, int channel, uint8_t *csdbWordPtr)
 Retrieves an CSDB word from receive buffer.

void ipmCsdb_rxEnable (IpmCsdbHdl ipModuleHdl, int channel)
 Enables receiver.

void ipmCsdb_rxDisable (IpmCsdbHdl ipModuleHdl, int channel)
 Disables receiver.

bool ipmCsdb_rxIsEnabled (IpmCsdbHdl ipModuleHdl, int channel)
 Returns enable status of receiver.

bool ipmCsdb_rxIsAvail (IpmCsdbHdl ipModuleHdl, int channel)
 Checks if receiver has data.

bool ipmCsdb_rxIsOverflown (IpmCsdbHdl ipModuleHdl, int channel)
 Returns buffer overflow status of receiver.

void ipmCsdb_rxIntEnable (IpmCsdbHdl ipModuleHdl, int channel)
 Enables receive interrupt for a receiver channel.

void ipmCsdb_rxIntDisable (IpmCsdbHdl ipModuleHdl, int channel)
 Disables receive interrupt for a receiver channel.

bool ipmCsdb_rxIntIsEnabled (IpmCsdbHdl ipModuleHdl, int channel)
 Returns interrupt enable status for a receiver channel.

int ipmCsdb_getTxChannels (IpmCsdbHdl ipModuleHdl)
 Returns the number of TX channels for this module.

int ipmCsdb_getRxChannels (IpmCsdbHdl ipModuleHdl)
 Returns the number of RX channels for this module.

uint32_t ipmCsdb_getTimer (IpmCsdbHdl ipModuleHdl)
 Read the main timer register.

void ipmCsdb_rxSetRate (IpmCsdbHdl ipModuleHdl, int channel, IpmCsdbBitRate bitRate)
 Set receiver channel baud rate register.

void ipmCsdb_txSetRate (IpmCsdbHdl ipModuleHdl, int channel, IpmCsdbBitRate bitRate)
 Set transmitter channel baud rate register.

void ipmCsdb_setTxEmptyThreshold (IpmCsdbHdl ipModuleHdl, uint16_t value)
 Sets the transmitter FIFO almost empty threshold value.

void ipmCsdb_setTxFullThreshold (IpmCsdbHdl ipModuleHdl, uint16_t value)
 Sets the transmitter FIFO almost full threshold value.

void ipmCsdb_setRxFullThreshold (IpmCsdbHdl ipModuleHdl, uint16_t value)
 Sets the receiver FIFO almost full threshold value.

void ipmCsdb_setRxAgingTimeout (IpmCsdbHdl ipModuleHdl, uint16_t value)
 Sets the receiver FIFO aging time-out value.

void ipmCsdb_rxConfig (IpmCsdbHdl ipModuleHdl, int channel, IpmCsdbConfigOptions option)
 Configures receiver channel.

void ipmCsdb_txConfig (IpmCsdbHdl ipModuleHdl, int channel, IpmCsdbConfigOptions option)
 Configures transmitter channel.


Detailed Description

Library for Max Technologies IPM422/CSDB modules header file.


Typedef Documentation

typedef IpmCsdbDescriptor* IpmCsdbHdl
 

Handle for accessing the IPM422 module.

The handle is returned by the open function.


Enumeration Type Documentation

enum IpmCsdbBitRate
 

Bit rate constants.

Enumeration values:
IPMCSDB_12_5_KBIT  12.5 Kbit/s
IPMCSDB_50_KBIT  50 Kbit/s, default rate

enum IpmCsdbConfigOptions
 

Channel Configuration Options.

Enumeration values:
IPMCSDB_CFG_DISABLE  TX/RX channel is disabled.
IPMCSDB_CFG_ENABLE  TX/RX channel is enabled.
IPMCSDB_CFG_NO_PARITY  TX/RX channel does not use/check parity.
IPMCSDB_CFG_EVEN_PARITY  TX/RX channel is even parity.
IPMCSDB_CFG_ODD_PARITY  TX/RX channel is odd parity.
IPMCSDB_CFG_7_BIT  TX/RX channel word size is 7 bit.
IPMCSDB_CFG_8_BIT  TX/RX channel word size is 8 bit.
IPMCSDB_CFG_1_STOP_BIT  TX/RX channel is 1 stop bit.
IPMCSDB_CFG_2_STOP_BIT  TX/RX channel is 2 stop bits.
IPMCSDB_CFG_TX_OUT_ENABLE  Transmitter is on.
IPMCSDB_CFG_TX_OUT_DISABLE  Transmitter is HI-Z.
IPMCSDB_CFG_TX_OUT_AUTO  Transmitter is on during transmission.
IPMCSDB_CFG_EXTERNAL  RX channel connects to external connector.
IPMCSDB_CFG_LOOPBACK  RX channel connects to loop back.
IPMCSDB_INT_DISABLE  TX/RX interrupt is disabled.
IPMCSDB_INT_ENABLE  TX/RX interrupt is enabled.

Function Documentation

IpmCsdbHdl ipmCsdb_open IpCarrierHdl    ipCarrierHdl,
int    ipSlotNo,
void(*    intHandlerFunc)()
 

Opens access to a Max Technologies 422/CSDB IPM422 module.

Parameters:
ipCarrierHdl IP carrier handle returned by ipCarrierOpen()
ipSlotNo IP slot number (IP_SLOT_A = first slot)
intHandlerFunc Pointer to a void function which implements an interrupt service routine for this module or NULL if no interrupt servicing desired
Returns:
Handle to access IP module or NULL if no module of this type found.

void ipmCsdb_close IpmCsdbHdl    ipModuleHdl
 

Closes access to the IP module and releases associated resources.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()

void ipmCsdb_sendNow IpmCsdbHdl    ipModuleHdl,
int    channel,
uint8_t    csdbWord
 

Sends a CSDB word immediately.

This function does not check if there is space in the transmit FIFO. Use the function ipmCsdb_txIsFull to check the FIFO status.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel TX channel number
csdbWord CSDB word

void ipmCsdb_sendScheduled IpmCsdbHdl    ipModuleHdl,
int    channel,
uint8_t    csdbWord,
uint16_t    timeTag
 

Sends a CSDB word time scheduled.

This function does not check if there is space in the transmit FIFO. Use the function ipmCsdb_txIsFull to check the FIFO status.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel TX channel number
csdbWord CSDB word
timeTag 16-bit time tag which specifies the transmission time

void ipmCsdb_txEnable IpmCsdbHdl    ipModuleHdl,
int    channel
 

Enables transmitter channel.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel TX channel number

void ipmCsdb_txDisable IpmCsdbHdl    ipModuleHdl,
int    channel
 

Disables transmitter.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel TX channel number

bool ipmCsdb_txIsEnabled IpmCsdbHdl    ipModuleHdl,
int    channel
 

Returns enable status of transmitter channel.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel TX channel number
Returns:
true if enabled, else false

bool ipmCsdb_txIsFull IpmCsdbHdl    ipModuleHdl,
int    channel
 

Checks if transmitter is almost full.

Almost full is a configurable threshold value.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel TX channel number
Returns:
true if almost empty, else false

bool ipmCsdb_txIsOverflown IpmCsdbHdl    ipModuleHdl,
int    channel
 

Returns buffer overflow status of transmitter and clears overflow condition.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel TX channel number
Returns:
true if over flown, else false

void ipmCsdb_txIntEnable IpmCsdbHdl    ipModuleHdl,
int    channel
 

Enables transmit interrupt for a transmitter channel.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel TX channel number

void ipmCsdb_txIntDisable IpmCsdbHdl    ipModuleHdl,
int    channel
 

Disables transmit interrupt for a transmitter channel.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel TX channel number

bool ipmCsdb_txIntIsEnabled IpmCsdbHdl    ipModuleHdl,
int    channel
 

Returns interupt enable status of a transmitter channel.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel TX channel number
Returns:
true if enabled, else false

bool ipmCsdb_receiveStamped IpmCsdbHdl    ipModuleHdl,
int    channel,
uint8_t *    csdbWordPtr,
uint16_t *    timeTagPtr
 

Retrieves a time-stamped CSDB word from receive buffer.

This function does not check if there is data available in the receive FIFO. Use the function ipmCsdb_rxIsAvail to check the FIFO status.

To check if there are receive errors use ipmCsdb_rxIsOverflown.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel TX channel number
csdbWordPtr Pointer to a 8-bit CSDB word buffer
timeTagPtr Pointer to a 16-bit time tag buffer
Returns:
true if data word's parity and stop bits are OK, else false

bool ipmCsdb_receive IpmCsdbHdl    ipModuleHdl,
int    channel,
uint8_t *    csdbWordPtr
 

Retrieves an CSDB word from receive buffer.

To check if there are receive errors use ipmCsdb_rxIsOverflown and ipmCsdb_rxIsError.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel TX channel number
csdbWordPtr Pointer to a 8-bit CSDB word buffer
Returns:
true if data word's parity and stop bits OK, else false

void ipmCsdb_rxEnable IpmCsdbHdl    ipModuleHdl,
int    channel
 

Enables receiver.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel RX channel number

void ipmCsdb_rxDisable IpmCsdbHdl    ipModuleHdl,
int    channel
 

Disables receiver.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel RX channel number

bool ipmCsdb_rxIsEnabled IpmCsdbHdl    ipModuleHdl,
int    channel
 

Returns enable status of receiver.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel RX channel number
Returns:
true if enabled, else false

bool ipmCsdb_rxIsAvail IpmCsdbHdl    ipModuleHdl,
int    channel
 

Checks if receiver has data.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel RX channel number
Returns:
true if data available, else false

bool ipmCsdb_rxIsOverflown IpmCsdbHdl    ipModuleHdl,
int    channel
 

Returns buffer overflow status of receiver.

This function call clears the error condition.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel RX channel number
Returns:
true if over flown, else false

void ipmCsdb_rxIntEnable IpmCsdbHdl    ipModuleHdl,
int    channel
 

Enables receive interrupt for a receiver channel.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel RX channel number

void ipmCsdb_rxIntDisable IpmCsdbHdl    ipModuleHdl,
int    channel
 

Disables receive interrupt for a receiver channel.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel RX channel number

bool ipmCsdb_rxIntIsEnabled IpmCsdbHdl    ipModuleHdl,
int    channel
 

Returns interrupt enable status for a receiver channel.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel RX channel number
Returns:
true if enabled, else false

int ipmCsdb_getTxChannels IpmCsdbHdl    ipModuleHdl
 

Returns the number of TX channels for this module.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
Returns:
Number of channels

int ipmCsdb_getRxChannels IpmCsdbHdl    ipModuleHdl
 

Returns the number of RX channels for this module.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
Returns:
Number of channels

uint32_t ipmCsdb_getTimer IpmCsdbHdl    ipModuleHdl
 

Read the main timer register.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
Returns:
Value of the 32-bit main timer

void ipmCsdb_rxSetRate IpmCsdbHdl    ipModuleHdl,
int    channel,
IpmCsdbBitRate    bitRate
 

Set receiver channel baud rate register.

RATE Value (Hex) Corresponding bit rate
13F 12.5 Kbit / sec
04F (bit rate reset value) 50 Kbit / sec

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel RX channel number
bitRate Bit rate value

void ipmCsdb_txSetRate IpmCsdbHdl    ipModuleHdl,
int    channel,
IpmCsdbBitRate    bitRate
 

Set transmitter channel baud rate register.

RATE Value (Hex) Corresponding bit rate
13F 12.5 Kbit / sec
04F (bit rate reset value) 50 Kbit / sec

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel TX channel number
bitRate Bit rate value

void ipmCsdb_setTxEmptyThreshold IpmCsdbHdl    ipModuleHdl,
uint16_t    value
 

Sets the transmitter FIFO almost empty threshold value.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
value Fifo almost empty threshold (0 - 15)

void ipmCsdb_setTxFullThreshold IpmCsdbHdl    ipModuleHdl,
uint16_t    value
 

Sets the transmitter FIFO almost full threshold value.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
value Fifo almost full threshold (0 - 16)

void ipmCsdb_setRxFullThreshold IpmCsdbHdl    ipModuleHdl,
uint16_t    value
 

Sets the receiver FIFO almost full threshold value.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
value Fifo almost full threshold (0 - 16)

void ipmCsdb_setRxAgingTimeout IpmCsdbHdl    ipModuleHdl,
uint16_t    value
 

Sets the receiver FIFO aging time-out value.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
value Aging time-out value in 128us units; 0 = disabled, max. value is 127.

void ipmCsdb_rxConfig IpmCsdbHdl    ipModuleHdl,
int    channel,
IpmCsdbConfigOptions    option
 

Configures receiver channel.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel RX channel number
option Configuration option. Valid options see Channel Configuration Options .

void ipmCsdb_txConfig IpmCsdbHdl    ipModuleHdl,
int    channel,
IpmCsdbConfigOptions    option
 

Configures transmitter channel.

Parameters:
ipModuleHdl IP module handle returned by ipmCsdb_open()
channel TX channel number
option Configuration option. Valid options see Channel Configuration Options .