IPMCSDB Driver
Documentation
FOCUS Software Engineering

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

Industry Pack Driver API

This module describes the API of the driver for the Max Technologies 422/CSDB IPM422/CSDB Industry Pack Module. More...

Driver Initialization and Clean-up 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.


Transmit Functions

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

void ipmCsdb_sendScheduled (IpmCsdbHdl ipModuleHdl, int channel, uint8_t csdbWord, 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.


Receive Functions

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.


Channel configuration Functions

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

This module describes the API of the driver for the Max Technologies 422/CSDB IPM422/CSDB Industry Pack Module.


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_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

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

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

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_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_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_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 .