44 #ifndef SSC_H_INCLUDED 45 #define SSC_H_INCLUDED 58 #define SSC_RX_STOP_COMPARE_0 0 59 #define SSC_RX_STOP_COMPARE_0_1 1 66 #define SSC_DEFAULT_TIMEOUT 10000 136 #define SSC_I2S_MASTER_OUT (1 << 0) 137 #define SSC_I2S_MASTER_IN (1 << 1) 138 #define SSC_I2S_SLAVE_OUT (1 << 2) 139 #define SSC_I2S_SLAVE_IN (1 << 3) 141 #define SSC_AUDIO_CH_LEFT (1 << 0) 143 #define SSC_AUDIO_CH_RIGHT (1 << 1) 157 uint32_t ul_cks, uint32_t ul_ch_mode, uint32_t ul_datlen);
159 uint32_t ul_cks, uint32_t ul_ch_mode, uint32_t ul_datlen);
184 #if (defined _SAM3S_) || (defined _SAM4S_) 185 uint32_t ssc_is_rx_buf_end(
Ssc *p_ssc);
186 uint32_t ssc_is_tx_buf_end(
Ssc *p_ssc);
187 uint32_t ssc_is_rx_buf_full(
Ssc *p_ssc);
188 uint32_t ssc_is_tx_buf_empty(
Ssc *p_ssc);
189 Pdc *ssc_get_pdc_base(
Ssc *p_ssc);
195 #if ((defined _SAM3XA_) || (defined _SAM3U_)) 196 void *ssc_get_tx_access(
Ssc *p_ssc);
197 void *ssc_get_rx_access(
Ssc *p_ssc);
uint32_t ul_cks
Definition: ssc.h:108
void ssc_set_normal_mode(Ssc *p_ssc)
Configure SSC to work in normal mode.
Definition: ssc.c:307
#define SSC_AUDIO_CH_LEFT
Bit for SSC Audio channel left.
Definition: ssc.h:142
uint32_t ssc_get_rx_compare(Ssc *p_ssc, uint32_t ul_id)
Get SSC Receive Compare Register.
Definition: ssc.c:470
uint32_t ssc_read_sync_data(Ssc *p_ssc)
Read from SSC Receive Synchronization Holding Register. Read data that is received in SSC Synchroniza...
Definition: ssc.c:762
uint32_t ssc_get_interrupt_mask(Ssc *p_ssc)
Read SSC interrupt mask.
Definition: ssc.c:511
uint32_t ssc_is_tx_empty(Ssc *p_ssc)
Check if the last data written in SSC_THR has been loaded in TSR and the last data loaded in TSR has ...
Definition: ssc.c:554
#define SSC_AUDIO_CH_RIGHT
Bit for SSC Audio channel right.
Definition: ssc.h:144
Data frame structure.
Definition: ssc.h:78
uint32_t ul_start_sel
Definition: ssc.h:132
void ssc_reset(Ssc *p_ssc)
Reset SSC module.
Definition: ssc.c:252
uint32_t ssc_write(Ssc *p_ssc, uint32_t ul_frame)
Write to SSC Transmit Holding Register. Send data through SSC Data frame.
Definition: ssc.c:700
void ssc_enable_tx(Ssc *p_ssc)
Enable SSC Transmitter.
Definition: ssc.c:287
void ssc_disable_tx(Ssc *p_ssc)
Disable SSC Transmitter.
Definition: ssc.c:297
Ssc hardware registers.
Definition: component_ssc.h:41
void ssc_enable_rx(Ssc *p_ssc)
Enable SSC receiver.
Definition: ssc.c:267
void ssc_i2s_set_transmitter(Ssc *p_ssc, uint32_t ul_mode, uint32_t ul_cks, uint32_t ul_ch_mode, uint32_t ul_datlen)
Setup for I2S transmitter.
Definition: ssc.c:102
void ssc_set_rx_compare(Ssc *p_ssc, uint32_t ul_id, uint32_t ul_value)
Configure SSC Receive Compare Register.
Definition: ssc.c:450
General error.
Definition: ssc.h:73
uint32_t ssc_is_tx_ready(Ssc *p_ssc)
Check if data has been loaded in SSC_THR and is waiting to be loaded in the Transmit Shift Register (...
Definition: ssc.c:537
void ssc_set_receiver(Ssc *p_ssc, clock_opt_t *p_rx_clk_opt, data_frame_opt_t *p_rx_data_frame)
Configure SSC receiver clock mode and date frame configuration.
Definition: ssc.c:382
void ssc_i2s_set_receiver(Ssc *p_ssc, uint32_t ul_mode, uint32_t ul_cks, uint32_t ul_ch_mode, uint32_t ul_datlen)
Setup for I2S receiver.
Definition: ssc.c:182
void ssc_enable_interrupt(Ssc *p_ssc, uint32_t ul_sources)
Enable SSC interrupts.
Definition: ssc.c:488
Pdc hardware registers.
Definition: component_pdc.h:41
void ssc_set_writeprotect(Ssc *p_ssc, uint32_t ul_enable)
Enable or disable write protection of SSC registers.
Definition: ssc.c:799
void ssc_set_td_default_level(Ssc *p_ssc, uint32_t ul_level)
Configure SSC default level driven on the TD pin while out of transmission.
Definition: ssc.c:344
uint32_t ul_cki
Definition: ssc.h:116
Stereo, two channels.
Definition: ssc.h:152
void ssc_set_transmitter(Ssc *p_ssc, clock_opt_t *p_tx_clk_opt, data_frame_opt_t *p_tx_data_frame)
Configure SSC transmitter clock mode and date frame configuration.
Definition: ssc.c:416
uint32_t ul_datlen
Data bits length per transfer, should be 0 to 31.
Definition: ssc.h:80
uint32_t ssc_get_status(Ssc *p_ssc)
Read SSC status.
Definition: ssc.c:523
uint32_t ul_datnb
Data number per frame, should be 0 to 15.
Definition: ssc.h:86
void ssc_disable_interrupt(Ssc *p_ssc, uint32_t ul_sources)
Disable SSC interrupts.
Definition: ssc.c:499
uint32_t ssc_is_tx_enabled(Ssc *p_ssc)
Check if transmitter is enabled.
Definition: ssc.c:586
Mono, left channel enabled.
Definition: ssc.h:148
void ssc_disable_rx(Ssc *p_ssc)
Disable SSC receiver.
Definition: ssc.c:277
uint32_t ssc_read(Ssc *p_ssc, uint32_t *ul_data)
Read from SSC Receive Holding Register. Read data that is received in SSC Data frame.
Definition: ssc.c:724
uint32_t ul_cko
Definition: ssc.h:112
uint32_t ul_fslen
Frame Sync. length should be 0 to 15.
Definition: ssc.h:88
uint32_t ul_fsos
Definition: ssc.h:96
uint32_t ssc_set_clock_divider(Ssc *p_ssc, uint32_t ul_bitclock, uint32_t ul_mck)
Set up clock.
Definition: ssc.c:79
void ssc_set_rx_stop_selection(Ssc *p_ssc, uint32_t ul_sel)
Configure SSC receive stop selection.
Definition: ssc.c:328
uint32_t ssc_is_rx_enabled(Ssc *p_ssc)
Check if receiver is enabled.
Definition: ssc.c:602
uint32_t ul_fsedge
Definition: ssc.h:100
void ssc_disable_tx_frame_sync_data(Ssc *p_ssc)
The TD line is driven with the default value during the Transmit Frame Sync signal.
Definition: ssc.c:370
void ssc_write_sync_data(Ssc *p_ssc, uint32_t ul_frame)
Write to SSC Transmit Synchronization Holding Register. Send data through SSC Synchronization frame...
Definition: ssc.c:747
Mono, right channel enabled.
Definition: ssc.h:150
uint32_t ssc_is_rx_ready(Ssc *p_ssc)
Check if data has been received and loaded in SSC_RHR.
Definition: ssc.c:570
Parameter invalid.
Definition: ssc.h:74
Yes.
Definition: ssc.h:71
uint32_t ul_period
Period divider selection, should be 0 to 255.
Definition: ssc.h:122
uint32_t ul_sttdly
Communication start delay, should be 0 to 255.
Definition: ssc.h:124
Clock mode structure.
Definition: ssc.h:104
uint32_t ul_fslen_ext
Frame Sync. length extension field, should be 0 to 15.
Definition: ssc.h:90
uint32_t ul_msbf
Definition: ssc.h:84
void ssc_set_loop_mode(Ssc *p_ssc)
Configure SSC to work in loop mode.
Definition: ssc.c:317
void ssc_enable_tx_frame_sync_data(Ssc *p_ssc)
The TD line is driven with the SSC_TSHR register value during the transmission of the Transmit Frame ...
Definition: ssc.c:359
ssc_return_code
SSC driver return codes.
Definition: ssc.h:69
uint32_t ssc_get_writeprotect_status(Ssc *p_ssc)
Indicate write protect status.
Definition: ssc.c:815
uint32_t ul_ckg
Definition: ssc.h:120