linux/drivers/mxc/ssi/ssi.h File Reference

This header file contains SSI driver functions prototypes. More...

Functions

unsigned int get_ssi_fifo_addr (unsigned int ssi, int direction)
void ssi_ac97_frame_rate_divider (ssi_mod module, unsigned char frame_rate_divider)
unsigned int ssi_ac97_get_command_address_register (ssi_mod module)
unsigned int ssi_ac97_get_command_data_register (ssi_mod module)
unsigned int ssi_ac97_get_tag_register (ssi_mod module)
void ssi_ac97_mode_enable (ssi_mod module, bool state)
void ssi_ac97_tag_in_fifo (ssi_mod module, bool state)
void ssi_ac97_read_command (ssi_mod module, bool state)
void ssi_ac97_set_command_address_register (ssi_mod module, unsigned int address)
void ssi_ac97_set_command_data_register (ssi_mod module, unsigned int data)
void ssi_ac97_set_tag_register (ssi_mod module, unsigned int tag)
void ssi_ac97_variable_mode (ssi_mod module, bool state)
void ssi_ac97_write_command (ssi_mod module, bool state)
void ssi_clock_idle_state (ssi_mod module, idle_state state)
void ssi_clock_off (ssi_mod module, bool state)
void ssi_enable (ssi_mod module, bool state)
unsigned int ssi_get_data (ssi_mod module, fifo_nb fifo)
ssi_status_enable_mask ssi_get_status (ssi_mod module)
void ssi_i2s_mode (ssi_mod module, mode_i2s mode)
void ssi_interrupt_disable (ssi_mod module, ssi_status_enable_mask mask)
void ssi_interrupt_enable (ssi_mod module, ssi_status_enable_mask mask)
void ssi_network_mode (ssi_mod module, bool state)
void ssi_receive_enable (ssi_mod module, bool state)
void ssi_rx_bit0 (ssi_mod module, bool state)
void ssi_rx_clock_direction (ssi_mod module, ssi_tx_rx_direction direction)
void ssi_rx_clock_divide_by_two (ssi_mod module, bool state)
void ssi_rx_clock_polarity (ssi_mod module, ssi_tx_rx_clock_polarity polarity)
void ssi_rx_clock_prescaler (ssi_mod module, bool state)
void ssi_rx_early_frame_sync (ssi_mod module, ssi_tx_rx_early_frame_sync early)
unsigned char ssi_rx_fifo_counter (ssi_mod module, fifo_nb fifo)
void ssi_rx_fifo_enable (ssi_mod module, fifo_nb fifo, bool enabled)
int ssi_rx_fifo_full_watermark (ssi_mod module, fifo_nb fifo, unsigned char watermark)
void ssi_rx_flush_fifo (ssi_mod module)
void ssi_rx_frame_direction (ssi_mod module, ssi_tx_rx_direction direction)
int ssi_rx_frame_rate (ssi_mod module, unsigned char ratio)
void ssi_rx_frame_sync_active (ssi_mod module, ssi_tx_rx_frame_sync_active active)
void ssi_rx_frame_sync_length (ssi_mod module, ssi_tx_rx_frame_sync_length length)
void ssi_rx_mask_time_slot (ssi_mod module, unsigned int mask)
int ssi_rx_prescaler_modulus (ssi_mod module, unsigned int divider)
void ssi_rx_shift_direction (ssi_mod module, ssi_tx_rx_shift_direction direction)
void ssi_rx_word_length (ssi_mod module, ssi_word_length length)
void ssi_set_data (ssi_mod module, fifo_nb fifo, unsigned int data)
void ssi_set_wait_states (ssi_mod module, ssi_wait_states wait)
void ssi_synchronous_mode (ssi_mod module, bool state)
void ssi_system_clock (ssi_mod module, bool state)
void ssi_transmit_enable (ssi_mod module, bool state)
void ssi_two_channel_mode (ssi_mod module, bool state)
void ssi_tx_bit0 (ssi_mod module, bool state)
void ssi_tx_clock_direction (ssi_mod module, ssi_tx_rx_direction direction)
void ssi_tx_clock_divide_by_two (ssi_mod module, bool state)
void ssi_tx_clock_polarity (ssi_mod module, ssi_tx_rx_clock_polarity polarity)
void ssi_tx_clock_prescaler (ssi_mod module, bool state)
void ssi_tx_early_frame_sync (ssi_mod module, ssi_tx_rx_early_frame_sync early)
unsigned char ssi_tx_fifo_counter (ssi_mod module, fifo_nb fifo)
int ssi_tx_fifo_empty_watermark (ssi_mod module, fifo_nb fifo, unsigned char watermark)
void ssi_tx_fifo_enable (ssi_mod module, fifo_nb fifo, bool enable)
void ssi_tx_flush_fifo (ssi_mod module)
void ssi_tx_frame_direction (ssi_mod module, ssi_tx_rx_direction direction)
int ssi_tx_frame_rate (ssi_mod module, unsigned char ratio)
void ssi_tx_frame_sync_active (ssi_mod module, ssi_tx_rx_frame_sync_active active)
void ssi_tx_frame_sync_length (ssi_mod module, ssi_tx_rx_frame_sync_length length)
void ssi_tx_mask_time_slot (ssi_mod module, unsigned int mask)
int ssi_tx_prescaler_modulus (ssi_mod module, unsigned int divider)
void ssi_tx_shift_direction (ssi_mod module, ssi_tx_rx_shift_direction direction)
void ssi_tx_word_length (ssi_mod module, ssi_word_length length)

Detailed Description

This header file contains SSI driver functions prototypes.


Function Documentation

unsigned int get_ssi_fifo_addr ( unsigned int  ssi,
int  direction 
)

This function gets the SSI fifo address.

Parameters:
ssi ssi number
direction To indicate playback / recording
Returns:
This function returns the SSI fifo address.

References MXC_SSI1STX0, MXC_SSI2STX0, and SSI1.

void ssi_ac97_frame_rate_divider ( ssi_mod  module,
unsigned char  frame_rate_divider 
)

This function controls the AC97 frame rate divider.

Parameters:
module the module number
frame_rate_divider the AC97 frame rate divider
unsigned int ssi_ac97_get_command_address_register ( ssi_mod  module  ) 

This function gets the AC97 command address register.

Parameters:
module the module number
Returns:
This function returns the command address slot information.
unsigned int ssi_ac97_get_command_data_register ( ssi_mod  module  ) 

This function gets the AC97 command data register.

Parameters:
module the module number
Returns:
This function returns the command data slot information.
unsigned int ssi_ac97_get_tag_register ( ssi_mod  module  ) 

This function gets the AC97 tag register.

Parameters:
module the module number
Returns:
This function returns the tag information.
void ssi_ac97_mode_enable ( ssi_mod  module,
bool  state 
)

This function controls the AC97 mode.

Parameters:
module the module number
state the AC97 mode state (enabled or disabled)

References AC97_MODE_ENABLE_SHIFT.

void ssi_ac97_read_command ( ssi_mod  module,
bool  state 
)

This function controls the AC97 read command.

Parameters:
module the module number
state the next AC97 command is a read command or not
void ssi_ac97_set_command_address_register ( ssi_mod  module,
unsigned int  address 
)

This function sets the AC97 command address register.

Parameters:
module the module number
address the command address slot information
void ssi_ac97_set_command_data_register ( ssi_mod  module,
unsigned int  data 
)

This function sets the AC97 command data register.

Parameters:
module the module number
data the command data slot information
void ssi_ac97_set_tag_register ( ssi_mod  module,
unsigned int  tag 
)

This function sets the AC97 tag register.

Parameters:
module the module number
tag the tag information
void ssi_ac97_tag_in_fifo ( ssi_mod  module,
bool  state 
)

This function controls the AC97 tag in FIFO behavior.

Parameters:
module the module number
state the tag in fifo behavior (Tag info stored in Rx FIFO 0 if TRUE, Tag info stored in SATAG register otherwise)

This function controls the AC97 tag in FIFO behavior.

Parameters:
module the module number
state the tag in fifo behavior (Tag info stored in Rx FIFO 0 if true, Tag info stored in SATAG register otherwise)
void ssi_ac97_variable_mode ( ssi_mod  module,
bool  state 
)

This function controls the AC97 variable mode.

Parameters:
module the module number
state the AC97 variable mode state (enabled or disabled)
void ssi_ac97_write_command ( ssi_mod  module,
bool  state 
)

This function controls the AC97 write command.

Parameters:
module the module number
state the next AC97 command is a write command or not
void ssi_clock_idle_state ( ssi_mod  module,
idle_state  state 
)

This function controls the idle state of the transmit clock port during SSI internal gated mode.

Parameters:
module the module number
state the clock idle state
void ssi_clock_off ( ssi_mod  module,
bool  state 
)

This function turns off/on the ccm_ssi_clk to reduce power consumption.

Parameters:
module the module number
state the state for ccm_ssi_clk (true: turn off, else:turn on)
void ssi_enable ( ssi_mod  module,
bool  state 
)

This function enables/disables the SSI module.

Parameters:
module the module number
state the state for SSI module

References SSI_ENABLE_SHIFT.

unsigned int ssi_get_data ( ssi_mod  module,
fifo_nb  fifo 
)

This function gets the data word in the Receive FIFO of the SSI module.

Parameters:
module the module number
fifo the Receive FIFO to read
Returns:
This function returns the read data.

References ssi_fifo_0.

ssi_status_enable_mask ssi_get_status ( ssi_mod  module  ) 

This function returns the status of the SSI module (SISR register) as a combination of status.

Parameters:
module the module number
Returns:
This function returns the status of the SSI module.

This function returns the status of the SSI module (SISR register) as a combination of status.

Parameters:
module the module number
Returns:
This function returns the status of the SSI module
void ssi_i2s_mode ( ssi_mod  module,
mode_i2s  mode 
)

This function selects the I2S mode of the SSI module.

Parameters:
module the module number
mode the I2S mode
void ssi_interrupt_disable ( ssi_mod  module,
ssi_status_enable_mask  mask 
)

This function disables the interrupts of the SSI module.

Parameters:
module the module number
mask the mask of the interrupts to disable
void ssi_interrupt_enable ( ssi_mod  module,
ssi_status_enable_mask  mask 
)

This function enables the interrupts of the SSI module.

Parameters:
module the module number
mask the mask of the interrupts to enable
void ssi_network_mode ( ssi_mod  module,
bool  state 
)

This function enables/disables the network mode of the SSI module.

Parameters:
module the module number
state the network mode state
void ssi_receive_enable ( ssi_mod  module,
bool  state 
)

This function enables/disables the receive section of the SSI module.

Parameters:
module the module number
state the receive section state
void ssi_rx_bit0 ( ssi_mod  module,
bool  state 
)

This function configures the SSI module to receive data word at bit position 0 or 23 in the Receive shift register.

Parameters:
module the module number
state the state to receive at bit 0
void ssi_rx_clock_direction ( ssi_mod  module,
ssi_tx_rx_direction  direction 
)

This function controls the source of the clock signal used to clock the Receive shift register.

Parameters:
module the module number
direction the clock signal direction
void ssi_rx_clock_divide_by_two ( ssi_mod  module,
bool  state 
)

This function configures the divide-by-two divider of the SSI module for the receive section.

Parameters:
module the module number
state the divider state
void ssi_rx_clock_polarity ( ssi_mod  module,
ssi_tx_rx_clock_polarity  polarity 
)

This function controls which bit clock edge is used to clock in data.

Parameters:
module the module number
polarity the clock polarity
void ssi_rx_clock_prescaler ( ssi_mod  module,
bool  state 
)

This function configures a fixed divide-by-eight clock prescaler divider of the SSI module in series with the variable prescaler for the receive section.

Parameters:
module the module number
state the prescaler state
void ssi_rx_early_frame_sync ( ssi_mod  module,
ssi_tx_rx_early_frame_sync  early 
)

This function controls the early frame sync configuration.

Parameters:
module the module number
early the early frame sync configuration

References SSI_EARLY_FRAME_SYNC_SHIFT.

unsigned char ssi_rx_fifo_counter ( ssi_mod  module,
fifo_nb  fifo 
)

This function gets the number of data words in the Receive FIFO.

Parameters:
module the module number
fifo the fifo
Returns:
This function returns the number of words in the Rx FIFO.

References ssi_fifo_0, and SSI_RX_FIFO_1_COUNT_SHIFT.

void ssi_rx_fifo_enable ( ssi_mod  module,
fifo_nb  fifo,
bool  enable 
)

This function enables the Receive FIFO.

Parameters:
module the module number
fifo the fifo to enable
enabled the state of the fifo, enabled or disabled

This function enables the Receive FIFO.

Parameters:
module the module number
fifo the fifo to enable
enable the state of the fifo, enabled or disabled
int ssi_rx_fifo_full_watermark ( ssi_mod  module,
fifo_nb  fifo,
unsigned char  watermark 
)

This function controls the threshold at which the RFFx flag will be set.

Parameters:
module the module number
fifo the fifo to enable
watermark the watermark
Returns:
This function returns the result of the operation (0 if successful, -1 otherwise).

References ssi_fifo_0.

void ssi_rx_flush_fifo ( ssi_mod  module  ) 

This function flushes the Receive FIFOs.

Parameters:
module the module number
void ssi_rx_frame_direction ( ssi_mod  module,
ssi_tx_rx_direction  direction 
)

This function controls the direction of the Frame Sync signal for the receive section.

Parameters:
module the module number
direction the Frame Sync signal direction
int ssi_rx_frame_rate ( ssi_mod  module,
unsigned char  ratio 
)

This function configures the Receive frame rate divider for the receive section.

Parameters:
module the module number
ratio the divide ratio from 1 to 32
Returns:
This function returns the result of the operation (0 if successful, -1 otherwise).
void ssi_rx_frame_sync_active ( ssi_mod  module,
ssi_tx_rx_frame_sync_active  active 
)

This function controls the Frame Sync active polarity for the receive section.

Parameters:
module the module number
active the Frame Sync active polarity
void ssi_rx_frame_sync_length ( ssi_mod  module,
ssi_tx_rx_frame_sync_length  length 
)

This function controls the Frame Sync length (one word or one bit long) for the receive section.

Parameters:
module the module number
length the Frame Sync length
void ssi_rx_mask_time_slot ( ssi_mod  module,
unsigned int  mask 
)

This function configures the time slot(s) to mask for the receive section.

Parameters:
module the module number
mask the mask to indicate the time slot(s) masked
int ssi_rx_prescaler_modulus ( ssi_mod  module,
unsigned int  divider 
)

This function configures the Prescale divider for the receive section.

Parameters:
module the module number
divider the divide ratio from 1 to 256
Returns:
This function returns the result of the operation (0 if successful, -1 otherwise).

References SSI_PRESCALER_MODULUS_SHIFT.

void ssi_rx_shift_direction ( ssi_mod  module,
ssi_tx_rx_shift_direction  direction 
)

This function controls whether the MSB or LSB will be received first in a sample.

Parameters:
module the module number
direction the shift direction
void ssi_rx_word_length ( ssi_mod  module,
ssi_word_length  length 
)

This function configures the Receive word length.

Parameters:
module the module number
length the word length
void ssi_set_data ( ssi_mod  module,
fifo_nb  fifo,
unsigned int  data 
)

This function sets the data word in the Transmit FIFO of the SSI module.

Parameters:
module the module number
fifo the FIFO number
data the data to load in the FIFO

References ssi_fifo_0.

void ssi_set_wait_states ( ssi_mod  module,
ssi_wait_states  wait 
)

This function controls the number of wait states between the core and SSI.

Parameters:
module the module number
wait the number of wait state(s)
void ssi_synchronous_mode ( ssi_mod  module,
bool  state 
)

This function enables/disables the synchronous mode of the SSI module.

Parameters:
module the module number
state the synchronous mode state
void ssi_system_clock ( ssi_mod  module,
bool  state 
)

This function allows the SSI module to output the SYS_CLK at the SRCK port.

Parameters:
module the module number
state the system clock state
void ssi_transmit_enable ( ssi_mod  module,
bool  state 
)

This function enables/disables the transmit section of the SSI module.

Parameters:
module the module number
state the transmit section state
void ssi_two_channel_mode ( ssi_mod  module,
bool  state 
)

This function allows the SSI module to operate in the two channel mode.

Parameters:
module the module number
state the two channel mode state
void ssi_tx_bit0 ( ssi_mod  module,
bool  state 
)

This function configures the SSI module to transmit data word from bit position 0 or 23 in the Transmit shift register.

Parameters:
module the module number
state the transmit from bit 0 state
void ssi_tx_clock_direction ( ssi_mod  module,
ssi_tx_rx_direction  direction 
)

This function controls the direction of the clock signal used to clock the Transmit shift register.

Parameters:
module the module number
direction the clock signal direction
void ssi_tx_clock_divide_by_two ( ssi_mod  module,
bool  state 
)

This function configures the divide-by-two divider of the SSI module for the transmit section.

Parameters:
module the module number
state the divider state
void ssi_tx_clock_polarity ( ssi_mod  module,
ssi_tx_rx_clock_polarity  polarity 
)

This function controls which bit clock edge is used to clock out data.

Parameters:
module the module number
polarity the clock polarity
void ssi_tx_clock_prescaler ( ssi_mod  module,
bool  state 
)

This function configures a fixed divide-by-eight clock prescaler divider of the SSI module in series with the variable prescaler for the transmit section.

Parameters:
module the module number
state the prescaler state
void ssi_tx_early_frame_sync ( ssi_mod  module,
ssi_tx_rx_early_frame_sync  early 
)

This function controls the early frame sync configuration for the transmit section.

Parameters:
module the module number
early the early frame sync configuration

References SSI_EARLY_FRAME_SYNC_SHIFT.

unsigned char ssi_tx_fifo_counter ( ssi_mod  module,
fifo_nb  fifo 
)

This function gets the number of data words in the Transmit FIFO.

Parameters:
module the module number
fifo the fifo
Returns:
This function returns the number of words in the Tx FIFO.

References ssi_fifo_0.

int ssi_tx_fifo_empty_watermark ( ssi_mod  module,
fifo_nb  fifo,
unsigned char  watermark 
)

This function controls the threshold at which the TFEx flag will be set.

Parameters:
module the module number
fifo the fifo to enable
watermark the watermark
Returns:
This function returns the result of the operation (0 if successful, -1 otherwise).

References ssi_fifo_0.

void ssi_tx_fifo_enable ( ssi_mod  module,
fifo_nb  fifo,
bool  enable 
)

This function enables the Transmit FIFO.

Parameters:
module the module number
fifo the fifo to enable
enable the state of the FIFO, enabled or disabled

This function enables the Transmit FIFO.

Parameters:
module the module number
fifo the fifo to enable
enable the state of the fifo, enabled or disabled
void ssi_tx_flush_fifo ( ssi_mod  module  ) 

This function flushes the Transmit FIFOs.

Parameters:
module the module number
void ssi_tx_frame_direction ( ssi_mod  module,
ssi_tx_rx_direction  direction 
)

This function controls the direction of the Frame Sync signal for the transmit section.

Parameters:
module the module number
direction the Frame Sync signal direction
int ssi_tx_frame_rate ( ssi_mod  module,
unsigned char  ratio 
)

This function configures the Transmit frame rate divider.

Parameters:
module the module number
ratio the divide ratio from 1 to 32
Returns:
This function returns the result of the operation (0 if successful, -1 otherwise).
void ssi_tx_frame_sync_active ( ssi_mod  module,
ssi_tx_rx_frame_sync_active  active 
)

This function controls the Frame Sync active polarity for the transmit section.

Parameters:
module the module number
active the Frame Sync active polarity
void ssi_tx_frame_sync_length ( ssi_mod  module,
ssi_tx_rx_frame_sync_length  length 
)

This function controls the Frame Sync length (one word or one bit long) for the transmit section.

Parameters:
module the module number
length the Frame Sync length
void ssi_tx_mask_time_slot ( ssi_mod  module,
unsigned int  mask 
)

This function configures the time slot(s) to mask for the transmit section.

Parameters:
module the module number
mask the mask to indicate the time slot(s) masked
int ssi_tx_prescaler_modulus ( ssi_mod  module,
unsigned int  divider 
)

This function configures the Prescale divider for the transmit section.

Parameters:
module the module number
divider the divide ratio from 1 to 256
Returns:
This function returns the result of the operation (0 if successful, -1 otherwise).

References SSI_PRESCALER_MODULUS_SHIFT.

void ssi_tx_shift_direction ( ssi_mod  module,
ssi_tx_rx_shift_direction  direction 
)

This function controls whether the MSB or LSB will be transmited first in a sample.

Parameters:
module the module number
direction the shift direction

This function controls whether the MSB or LSB will be transmitted first in a sample.

Parameters:
module the module number
direction the shift direction
void ssi_tx_word_length ( ssi_mod  module,
ssi_word_length  length 
)

This function configures the Transmit word length.

Parameters:
module the module number
length the word length
footer
©  Freescale Semiconductor, Inc., 2007.  All rights reserved.
Freescale Confidential Proprietary
NDA Required
doxygen