API Reference Document
API Reference Document
R 2.0
Author’s Vikrama/Suhas
APPROVAL
Name Function Organization Date Signature
Mr. Hemachandra Bhat Wipro
CONTACT INFO
DOCUMENT IDENTIFICATION
Project Name EMDBY
Document Name iW-EMDBY–DD-01-R2.0-REL2.1
Document Home //server/emdby/svn/trunk/iW-EMDBY-PF-01-R1.0/iW-EMDBY-SF-
01-R1.0/iW-EMDBY-SD-01-R1.0/iW-EMDBY-DD-01-R2.0-
Revision No REL2.1
Status Draf
Audience Wipro
PROPRIETARY NOTICE: This document contains proprietary material for the sole use of the
intended recipient(s). Do not read this document further if you are not the intended recipient.
Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the
intended recipient (or authorized to receive for the recipient), you are hereby notified that any
disclosure, copy or distribution or use of any of the information contained within this
document is STRICTLY PROHIBITED. Thank you. “iWave Systems Tech. Pvt. Ltd.”
TABLE OF CONTENTS
1. ULK_PROC_UART_API.................................................................................................................................... 21
15. ULK_TIMER_PWM_API’S............................................................................................................................. 28
16. ULK_SDMA_API’S........................................................................................................................................ 31
16.3.12 ulk_proc_set_src_dest_add....................................................................................................................38
16.3.13 ulk_proc_set_index.................................................................................................................................38
16.3.14 ulk_proc_set_parms...............................................................................................................................39
16.3.15 ulk_proc_get_parms...............................................................................................................................39
16.3.16 ulk_proc_set_ctrl_parms........................................................................................................................39
16.3.17 ulk_proc_get_ctrl_parms........................................................................................................................39
16.3.18 ulk_proc_sdma_master_callback...........................................................................................................40
16.3.19 ulk_proc_proc_sdma_enable_irq...........................................................................................................40
18. ULK_MCSPI_API’S........................................................................................................................................ 43
19. ULK_MCBSP_API’S....................................................................................................................................... 46
19.3.12 ulk_proc_mcbsp_RxClk_config...............................................................................................................54
19.3.13 ulk_proc_mcbsp_TxClk_config................................................................................................................55
19.3.14 ulk_proc_mcbsp_Rx_param_config.......................................................................................................55
19.3.15 ulk_proc_mcbsp_Tx_param_config........................................................................................................55
19.3.16 ulk_proc_mcbsp_read............................................................................................................................56
19.3.17 ulk_proc_mcbsp_write...........................................................................................................................56
19.3.18 ulk_mcbsp_interface_reset.....................................................................................................................56
19.3.19 Uint8.......................................................................................................................................................56
19.3.20 ulk_proc_mcbsp_Tx_start.......................................................................................................................56
19.3.21 ulk_proc_mcbsp_Tx_stop.......................................................................................................................57
19.3.22 ulk_proc_mcbsp_Rx_start......................................................................................................................57
19.3.23 uint8........................................................................................................................................................57
19.3.24 ulk_proc_mcbsp_Rx_stop.......................................................................................................................57
19.3.25 ulk_proc_mcbsp_Rx_dma_callback........................................................................................................58
19.3.26 ulk_proc_mcbsp_Tx_dma_callback........................................................................................................58
20. ULK_PROC_LED_API’S.................................................................................................................................. 59
21. ULK_PROC_KEYPAD_API’S........................................................................................................................... 61
22. ULK_PROC_I2C_API’S................................................................................................................................... 62
23. ULK_PROC_GPIO_API’S................................................................................................................................ 64
23.2.6 ulk_proc_gpio_set_data_out....................................................................................................................66
23.2.7 ulk_gpio_enable_wakeup.........................................................................................................................66
23.2.8 ulk_proc_gpio_enable_debounce.............................................................................................................67
23.2.9 ulk_proc_gpio_get_debounce..................................................................................................................67
23.2.10 ulk_proc_gpio_set_debounce_time.......................................................................................................67
23.2.11 ulk_proc_gpio_irq _enable _mpu...........................................................................................................68
23.2.12 ulk_proc_gpio_irq _clear _mpu..............................................................................................................68
23.2.13 ulk_proc_gpio_irq _enable _iva.............................................................................................................68
23.2.14 ulk_proc_gpio_irq _clear _iva................................................................................................................69
23.2.15 ulk_proc_gpio_irq_trig_level_0..............................................................................................................69
23.2.16 ulk_proc_gpio_irq_trig_level_1..............................................................................................................69
23.2.17 ulk_proc_gpio_irq_trig_edge_r..............................................................................................................70
23.2.18 ulk_proc_gpio_irq_trig_edge_f..............................................................................................................70
23.2.19 ulk_proc_sys_pad_set_muxmode..........................................................................................................70
23.2.20 ulk_proc_sys_pad_get_muxmode..........................................................................................................70
23.2.21 ulk_proc_sys_pad_set_pull.....................................................................................................................71
23.2.22 ulk_sys_pad_get_pull.............................................................................................................................71
23.2.23 ulk _proc_sys_pad_set_dir.....................................................................................................................71
23.2.24 ulk _proc_sys_pad_get_dir.....................................................................................................................72
23.2.25 ulk _proc_sys_pad_set_wakeup.............................................................................................................72
23.2.26 ulk _proc_sys_pad_get_wakeup............................................................................................................72
24. ULK_PROC_EEPROM_API’S.......................................................................................................................... 73
25. ULK_PROC_AUDIO_API’S............................................................................................................................. 76
26. ULK_PROC_CHARACTER_LCD_API’S............................................................................................................. 84
27. ULK_INTERRUPT_API’S................................................................................................................................ 88
28. ULK_FPGA_7SEGLED_API’S.......................................................................................................................... 90
29. ULK_FPGA_ADC_API’S................................................................................................................................. 91
30. ULK_FPGA_DAC_API’S................................................................................................................................. 92
32. ULK_FPGA_DDR_API’S................................................................................................................................. 94
33. ULK_FPGA_KEYPAD_API’S............................................................................................................................ 95
34. ULK_FPGA_LED_API’S.................................................................................................................................. 96
36.2.3 FPGA_init................................................................................................................................................100
36.2.4 ulk_fpga_uart_reg_init...........................................................................................................................100
36.2.5 ulk_fpga_uart_getc................................................................................................................................100
36.2.6 ulk_fpga_uart_putc................................................................................................................................101
36.2.7 calc_divisor.............................................................................................................................................101
36.2.8 NS16550_puts_fpga...............................................................................................................................101
36.2.9 NS16550_getc_fpga...............................................................................................................................101
36.2.10 config_io_expander..............................................................................................................................101
36.2.11 ulk__set_ for_write_cmd......................................................................................................................101
36.2.12 uint8 NS16500_set_parity_data_sb.....................................................................................................102
LIST OF FIGURES
NO TABLE OF FIGURES ENTRIES FOUND.
LIST OF TABLES
TABLE 1:TIMER AND PWM FUNCTIONS..................................................................................28
PROCESSOR INTERFACES
FUNCTION NAME DESCRIPTION
ulk_proc_uart_init Initialization of UART is done by configuring the related
registers
ulk_proc_uart_getc Will dump a character in the transmit register
NS16550_init Initializes all the register values for the uart initialization
process
NS16500_set_parity_data_sb Will set the configuration for uart (baudrate,number of
stop bits, number of databits, parity)
ulk_proc_delay Includes specified amount of delay in calling function.
ulk_proc_sdma_get_reqline Get the assigned sdma request line for the channel.
ulk_proc_sdma_set_data Set the address and data size for the channel.
ulk_proc_sdma_get_data Get the address and data size configured for the channel.
ulk_proc_sdma_get_index get the source and the destination element and the
frame indexes
ulk_proc_set_en_fn To set the number of elements and frames to transfer
via DMA
ulk_proc_set_src_dest_add Set the Source and the Destination Start Address
ulk_proc_set_index set the source and the destination element and the
frame indexes
ulk_proc_set_parms set the source and the destination parameters
ulk_proc_sdma_master_callback sdma master isr callback to serve all sdma irq lines
. ulk_spi_select_ch Configure the spi with the selected channel and the
selected SPI
ulk_spi_read_single Read a single byte from the SPI device.
ulk_proc_led_blink Blink the led with specified timing for a specified counts.
ulk_proc_keypad_i2c_getkey
ulk_proc_keypad_i2c_getkey_nb To scan the keys on the keypad. I.e. this will give the row
and column of the key in the keypad
ulk_proc_i2c_init Initialize the i2c line.
ulk_proc_sys_pad_set_pull PULL_UP/PULL_DOWN/OPEN_DRAIN
ulk_proc_audio_record_nb Capture the input audio data in a bufer using sdma. Non
blocking function.
ulk_proc_audio_play_nb Output the audio data from a bufer using sdma. Non
blocking function.
ulk_proc_clcd_init Initialize LCD with default configurations.
FPGA INTERFACES
FUNCTION NAME DESCRIPTION
ulk_fpga_led Initialize gpmc and ON 7 segment led.
ulk_fpga_keypad_getkey to get the value of the key pressed from the keypad by
the user.
1.ULK_PROC_UART_API
12. NS16550_init Initializes all the register values for the uart
initialization process
13. NS16500_set_parity_data_sb Will set the configuration for uart
(baudrate,number of stop bits, number of
databits, parity)
14. ulk_proc_uart_init
14.1 Functions
14.1.1 ulk_proc_uart_init
14.1.2 ulk_proc_uart_getc
Arguments port :User specifies the port number to receive the character
Return value Returns the value read from the receive holding register(comport)
14.1.3ulk_proc_uart_putc
Arguments port ;User specifies the port number to transmit the character.
Val: It’s the value which the user is transmitting.
Return value Returns always zero.
14.1.4ulk_proc_ uart_puts
14.1.5 ulk_proc_uart_gets
Arguments port :User specifies the port number to receive the string.
buf_p: It’s the pointer that holds the characters which is being read from
14.1.6ulk_proc_uart_get_buff
Function Definition uint8 ulk_proc_uart_get_buf (uint8 port, uint8 *buf_p, uint32 size)
port :User specifies the port number to read the string of characters from
receive bufer.
Arguments buf_p: It’s the pointer that holds the string which is being read from the
port.
Size: Specifies the number of characters to be read from the port .
Return value Returns the string of characters read from the receive bufer.
14.1.7ulk_proc_uart_put_buff
Function Definition uint8 ulk_proc_uart_put_buf (uint8 port, uint8 *buf_p, uint32 size)
port :User specifies the port number to transmit the string characters to
Arguments transmit bufer.
buf_p: It’s the pointer that holds the string which is being transmitted
size: Specifies the number of characters to be written to the port .
Return value Always returns zero.
14.1.8 NS16550_putc
14.1.9NS16550_getc
Function Definition uint8 NS16550_getc (NS16550_t com_port)
Arguments comport
Return value zero.
14.1.10 calc_divisor
14.1.11NS16550_init
14.1.12NS16500_set_parity_data_sb
struct NS16550 {
unsigned char rbr;
int pad1:24;
unsigned char ier;
int pad2:24;
unsigned char fcr;
int pad3:24;
unsigned char lcr;
int pad4:24;
unsigned char mcr;
int pad5:24;
unsigned char lsr;
int pad6:24;
unsigned char msr;
int pad7:24;
unsigned char spr;
int pad8:24;
unsigned char mdr1;
int pad9:24;
unsigned char mdr2;
int pad10:24;
unsigned char sflr;
int pad11:24;
unsigned char resume;
int pad12:24;
unsigned char sfrgl;
int pad13:24;
unsigned char sfrgh;
int pad14:24;
unsigned char blr;
int pad15:24;
unsigned char acreg;
int pad16:24;
unsigned char scr;
int pad17:24;
unsigned char ssr;
int pad18:24;
unsigned char eblr;
int pad19:24;
unsigned char reserved;
int pad20:24;
unsigned char sysc;
int pad21:24;
unsigned char syss;
int pad22:24;
unsigned char wer;
int pad23:24;
unsigned char cfps;
int pad24:24;
} __attribute__ ((packed));
struct NS16550
element Details (possible values, exceptions etc)
rbr Receive bufer register
ier Interrupt enable register
fcr Fifo control register
lcr Line control register
mcr Modem control register
lsr Line status register
msr Modem status register
spr Scratchpad register
mdr1 Mode definition register1
mdr2 Mode definition register2
sflr Status FIFO register low
resume IR-IrDA and IR-CIR modes only
sfrgl Status FIFO register low
sfrgh Status FIFO register high
blr BOF control register
acreg Auxiliary control register
scr Supplementary control register
ssr Supplementary status register
eblr BOF length register
reserved
sysc System configuration register.
syss System status register
wer Wake-up enable register
cfps Carrier frequency prescaler
15.ULK_TIMER_PWM_API’S
15.1Table of API
Table 1:Timer and PWM Functions
15.2 Functions
15.2.1ulk_proc_delay
Function Definition uint8 ulk_proc_delay (uint32 delay)
Arguments delay (in):Delay counts. Using ULK_USEC/ ULK_MSEC/ ULK_SEC macros.
15.2.2 ulk_proc_timeout_nb
Function Definition uint8 ulk_timeout_nb (uint8 timer_no, uint32 delay, uint32 *funct_p,
void *arg)
Arguments timer_line(in):Timer to be used. 3 to 7(GPT3 to GPT7). Other value will
return error.
delay (in): Delay counts. Using ULK_USEC/ ULK_MSEC/ ULK_SEC macros.
funct_p(in): Call-back function pointer.
arg(in) :Pointer to the call-back function arguments
Return value Sucess: PROC_SUCCESS 0
Error code: /* Timer 7 used for proc_delay */
PROC_TIMER_USED_BY_OTHER_MODULE (-2)
15.2.3ulk_proc_pwm_init
Function Definition uint8 ulk_pwm_init (uint8 pwm_line)
Arguments pwm_line (in):PWM timer number 0 to 3 (GPT8 to GPT11).
Return value Succes: PROC_SUCCESS 0
Error code: /* Timer Number not supported in this processor */
PROC_TIMER_UNAVAIL (-1)
15.2.4ulk_proc_pwm_config
Function Definition uint8 ulk_pwm_config (uint8 pwm_line, uint32 pwm_period, uint8
duty_cycle)
Arguments pwm_line (in):PWM timer number 0 to 3 (GPT8 to GPT11).
pwm_period (in): Time period of PWM in microseconds.
duty_cycle (in): PWM duty cycle (period to on time ratio) in percentage
(0 to 100).
Return value Succes: PROC_SUCCESS 0
Error code: /* Timer Number not supported in this processor */
PROC_TIMER_UNAVAIL (-1)
15.2.5ulk_proc_pwm_start
Function Definition uint8 ulk_pwm_start (uint8 pwm_line)
Arguments pwm_line (in):PWM timer number 0 to 3 (GPT8 to GPT11)
15.2.6ulk_proc_pwm_stop
Function Definition uint8 ulk_proc_pwm_stop (uint8 pwm_line)
Arguments pwm_line (in):PWM timer number 0 to 3 (GPT8 to GPT11).
Return value Succes: PROC_SUCCESS 0
Error code: /* Timer Number not supported in this processor */
PROC_TIMER_UNAVAIL (-1_
15.2.7ulk_proc_pwm_pad_config
Function Definition uint8 ulk_proc_pwm_pad_config(uint8 pwm_line)
Arguments pwm_line: PWM line number
Return value Succes: PROC_SUCCESS 0
Error code: /* Timer Number not supported in this processor */
PROC_TIMER_UNAVAIL (-1)
15.2.8ulk_proc_timer_stop
Function Definition uint8 ulk_proc_timer_stop (uint8 timer_line)
Arguments timer_line: timer line number
Return value Succes: PROC_SUCCESS 0
Error code: /* Timer Number not supported in this processor */
PROC_TIMER_UNAVAIL
16. ULK_SDMA_API’S
16.1Table of API
9 ulk_proc_sdma_get_data Get the address and data size configured for the
channel.
10 ulk_proc_set_src_dest_add Set the Source and the Destination Start Address
17 ulk_proc_sdma_master_callback sdma master isr callback to serve all sdma irq lines
} ulk_sdma_config_t;
ulk_sdma_config_t
Element Details (possible values, exceptions etc)
data_type Sdma data type. 8/16/32 other values set default 32bit type.
src_amode Source addressing mode. 0,1,2,3 (constant, post increment, indexed,
double indexed). Other values set default 1.
src_ei Source element index. Used to set starting element number.
src_fi Source frame index. Used to set starting frame number.
src_pack source packing enable/disable(0/1)
src_burst Source burst mode 4/8/16 words. Other values set default 16.
src_endian source endianness little(0) big(1)
dest_amode Destination addressing mode. 0,1,2,3 (constant, post increment,
indexed, double indexed). Other values set default 1.
dest_ei Destination element index. Used to set starting element number.
dest_fi Destination frame index. Used to set starting frame number.
dest_pack Destination packing enable/disable(0/1)
dest_burst Destination burst mode 4/8/16 words. Other values set default 16.
dest_endian Destination endianness little(0) big(1)
sync_mode sycn on element, frame , block or packet 0 to 3
src_or_dest_sync source synch(1) or destination synch(0)
read_prio Read priority low (0) / high (1).
write_prio Write priority low (0) / high (1).
intr_enable Enable (1) or disable (0) interrupt.
intr_line Interrupt line to be used. 0 to 3.
lnk_channel For chaining link channel number. Not served here, Always set 0xFF.
16.3 Functions
16.3.1ulk_proc_sdma_init
16.3.2ulk_proc_sdma_start
16.3.3ulk_proc_sdma_stop
16.3.4ulk_proc_sdma_set_ch
(ulk_sdma_config_t).
Return value Success: PROC_SUCCESS 0
Error code: /*Invalid sdma channel number*/
PROC_SDMA_INVALID_CHANNEL -81
16.3.5ulk_proc_sdma_get_ch
16.3.6ulk_proc_sdma_set_reqline
16.3.7ulk_proc_sdma_get_reqline
16.3.8ulk_proc_sdma_set_data
16.3.9ulk_proc_sdma_get_data
16.3.10ulk_proc_sdma_get_index
uint32 *frame_count)
Arguments channel(in):SDMA channel number. 0 to 31.
elem_count(out): Pointer to hold currant Element number.
frame_count(out): Pointer to hold currant Frame number.
Return value Success: PROC_SUCCESS 0
Error code: /*Invalid sdma channel number*/
PROC_SDMA_INVALID_CHANNEL -81
16.3.11 ulk_proc_set_en_fn
Function Definition ulk_proc_set_en_fn (uint8 channel, uint32 elem_count, uint32
frame_count )
Arguments Channel number,element number and frame number
Return value none
16.3.12 ulk_proc_set_src_dest_add
16.3.13ulk_proc_set_index
16.3.14ulk_proc_set_parms
16.3.15ulk_proc_get_parms
16.3.16ulk_proc_set_ctrl_parms
16.3.17ulk_proc_get_ctrl_parms
16.3.18ulk_proc_sdma_master_callback
16.3.19ulk_proc_proc_sdma_enable_irq
17.RTC API
17.1Table of API’s
struct rtc_time {
int8 tm_sec;
int8 tm_min;
int8 tm_hour;
int8 tm_day;
int8 tm_mon;
int8 tm_year;
};
17.3 Functions
17.3.1.ulk_proc_enable_rtc
17.3.2ulk_proc_rtc_get_time
PROC_RTC_GET_TIME_FAILED -57
17.3.3ulk_proc_rtc_set_time
PROC_RTC_STOP_TIME_FAILED -58
/*ERROR 0:RTC start failed*/
PROC_RTC_START_TIME_FAILED -59
18.ULK_MCSPI_API’S
18.1Table of API
2 . ulk_spi_select_ch Configure the spi with the selected channel and the selected SPI
18.2 Functions
18.2.1ulk_proc_spi_init
18.2.2. ulk_spi_select_ch
18.2.3ulk_spi_read_single
18.2.4ulk_spi_write_single
18.2.5ulk_spi_read
18.2.6 ulk_spi_write
18.2.7ulk_spi_read_nb
18.2.8ulk_spi_write_nb
18.2.9ulk_touch_spi_enable
19.ULK_MCSPI_API’S
19.1Table of API
} ulk_mcbsp_srg_t;
uint8 rx_fsync_src;
uint8 tx_fsync_src;
uint8 rx_polarity;
uint8 tx_polarity;
uint32 period;
uint32 pulse_width;
uint8 fsgm;
} ulk_mcbsp_fsync_t;
} ulk_mcbsp_transfer_param_t;
ulk_mcbsp_srg_t
Element Details (possible values, exceptions etc)
sample_rate Required sampling rate in Hz.
bits_per_sample Number of bits per sample.
clk_rate The SRC Clock frequency in hertz, required for non prcm.
srg_src Source of SRG input clock.1 to 4
1 for CLKS, 2 for FCLK, 3 for CLKR & 4 for CLKX. Other value will raise an
error message.
sync_mode Synchronization mode. 1 for Free running or 2 for running. Other value
will raise an error message.
polarity Polarity of input clock. 1 for rising edge or 2 for falling edge. Other value
will raise an error message.
sdma_channel Sdma channel number used for mcbsp interface. 0 to 31 channels. Other
values will be treated in sdma functions.
mcbsp_sdma_cfg Pointer to the SDMA structure. This holds the mcbsp sdma configuration
values.
ulk_mcbsp_fsync_t
Element Details (possible values, exceptions etc)
rx_fsync_src Receiver frame synchronizer source. 0 for External source or 1 for
Internal source. Other value will raise an error message.
tx_fsync_src Transmitter frame synchronizer source. 0 for External source or 1 for
Internal source. Other value will raise an error message.
rx_polarity Polarity of receiver clock. 0 for active high or 1 for active low. Other
value will raise an error message.
tx_polarity Polarity of transmitter clock. 0 for active high or 1 for active low. Other
value will raise an error message.
period Frame-sync signal becomes active afer period+1 CLKG cycles.
0 to 4095 i.e. Masked values of 12 bits will be used by discarding other
bits.
pulse_width Width of the frame-sync pulse. Pulse width+1 CLKG cycles will be the
width of frame-sync pulse. 0 to 255 i.e. Masked values of 8 bits will be
used by discarding other bits.
fsgm Sample Rate Generator Transmit Frame-Synchronization. 0 for disable, 1
for enable. LSB will be used by discarding other bits.
ulk_mcbsp_transfer_param_t
Element Details (possible values, exceptions etc)
phase Communication phase. 1 for single phase or 2 for dual phase. Other
value will leads to dual phase setting.
data_delay Data delay for the sample. 0 to 2 bit delay can be added. Masked values
of 2 bits will be used by discarding other bits.
word_length1 Word length of first phase sample. 0 to 5 i.e. Masked values of 3 bits will
be used by discarding other bits. (6 and 7 must be avoided).
0 to 5 indicates 8, 12, 16, 20, 24 and 32 bit length accordingly.
word_length2 Word length of second phase sample. 0 to 5 i.e. Masked values of 3 bits
will be used by discarding other bits. (6 and 7 must be avoided).
0 to 5 indicates 8, 12, 16, 20, 24 and 32 bit length accordingly.
frame_length1 Frame length of first phase sample. 0 to 127 i.e. Masked values of 7 bits
will be used by discarding other bits.
19.3 Functions
19.3.1ulk_proc_mcbsp_pad_config
19.3.2ulk_proc_mcbsp_interface_reserve_request
19.3.3ulk_proc_mcbsp_interface_release
19.3.4ulk_proc_mcbsp_Tx_enable
19.3.5ulk_proc_mcbsp_Rx_enable
19.3.6ulk_proc_mcbsp_Rx_reset_enable
19.3.7ulk_proc_mcbsp_Tx_reset_enable
19.3.8ulk_proc_mcbsp_srg_enable
19.3.9ulk_proc_mcbsp_fsg_enable
19.3.10ulk_proc_mcbsp_srg_config
INVALID_CLKS -103
19.3.11ulk_proc_mcbsp_fsync_config
19.3.12ulk_proc_mcbsp_RxClk_config
19.3.13ulk_proc_mcbsp_TxClk_config
19.3.14ulk_proc_mcbsp_Rx_param_config
19.3.15ulk_proc_mcbsp_Tx_param_config
19.3.16ulk_proc_mcbsp_read
19.3.17ulk_proc_mcbsp_write
19.3.18ulk_mcbsp_interface_reset
19.3.19Uint8
19.3.20 ulk_proc_mcbsp_Tx_start
19.3.21ulk_proc_mcbsp_Tx_stop
19.3.22ulk_proc_mcbsp_Rx_start
19.3.23 uint8
19.3.24 ulk_proc_mcbsp_Rx_stop
19.3.25ulk_proc_mcbsp_Rx_dma_callback
Function Definition ulk_proc_mcbsp_Rx_dma_callback(uint8 ch_id)
Arguments ch_id: sdma channel number
Return value void
19.3.26 ulk_proc_mcbsp_Tx_dma_callback
20.ULK_PROC_LED_API’S
20.2 Functions
20.2.1ulk_proc_led_config
PROC_INVALID_LED -76
20.2.2ulk_proc_led_drive
PROC_INVALID_LED -76
20.2.3ulk_proc_led_blink
PROC_INVALID_LED -76
21.ULK_PROC_KEYPAD_API’S
2 ulk_proc_keypad_i2c_getkey
3 ulk_proc_keypad_i2c_getkey_nb To scan the keys on the keypad. I.e. this will give
the row and column of the key in the keypad
21.2Functions
21.2.1ulk_proc_keypad_i2c_init
21.2.2ulk_proc_keypad_i2c_getkey
21.2.3ulk_proc_keypad_i2c_getkey_nb
22.ULK_PROC_I2C_API’S
22.1Table of API
22.2 Functions
22.2.1ulk_proc_i2c_init
Function Definition uint8 ulk_proc_i2c_init (uint32 speed, uint32 slaveadd)
Arguments speed (in):I2c communication speed for the interface device in Hz.
slaveadd (in): Slave address for the i2c device.
Return value Seccess: PROC_SUCCESS 0
Error code: /*Invalid i2c bus no*/
PROC_BUS_UNAVAIL -38
22.2.2ulk_proc_i2c_read_byte
22.2.3ulk_proc_i2c_write_byte
23.ULK_PROC_GPIO_API’S
23.1Table of API
3 ulk_proc_sys_pad_set_pull PULL_UP/PULL_DOWN/OPEN_DRAIN
23.2Function
23.2.1ulk_proc_gpio_init
23.2.2ulk_proc_gpio_reset
23.2.3ulk_proc_gpio_set_dir
23.2.4ulk_proc_gpio_get_dir
23.2.5ulk_proc_gpio_get_data_in
23.2.6ulk_proc_gpio_set_data_out
23.2.7ulk_gpio_enable_wakeup
23.2.8ulk_proc_gpio_enable_debounce
23.2.9ulk_proc_gpio_get_debounce
23.2.10ulk_proc_gpio_set_debounce_time
Function Definition uint8 ulk_proc_gpio_irq _enable _mpu (uint8 pin, uint8 enable)
Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
enable (in): Interrupt line 1 (mpu subsystem). 0-disable, 1-enable, other
values leads to default disable condition.
Return value Success 0.
Error: invalid gpio pin (-51).
Function Definition uint8 ulk_proc_gpio_irq _enable _iva (uint8 pin, uint8 enable)
Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
enable (in): Interrupt line 2 (iva subsystem). 0-disable, 1-enable, other
values leads to default disable condition.
Return value Success 0.
Error: invalid gpio pin (-51).
23.2.15ulk_proc_gpio_irq_trig_level_0
23.2.16ulk_proc_gpio_irq_trig_level_1
23.2.17ulk_proc_gpio_irq_trig_edge_r
23.2.18ulk_proc_gpio_irq_trig_edge_f
23.2.19ulk_proc_sys_pad_set_muxmode
23.2.20ulk_proc_sys_pad_get_muxmode
23.2.21ulk_proc_sys_pad_set_pull
23.2.22ulk_sys_pad_get_pull
pins).
pull (out): Pointer to hold currant pull condition of GPIO pad.
Return value Success 0.
Error: invalid gpio pin (-51).
23.2.23ulk _proc_sys_pad_set_dir
23.2.24ulk _proc_sys_pad_get_dir
23.2.25ulk _proc_sys_pad_set_wakeup
23.2.26ulk _proc_sys_pad_get_wakeup
24.ULK_PROC_EEPROM_API’S
24.1Table of API
24.2 Functions
24.2.1ulk_proc_eeprom_init
Function Definition Void ulk_proc_eeprom_init ()
Arguments None
Return value Success: PROC_SUCCESS 0
24.2.2ulk_proc_eeprom_write_byte
24.2.3ulk_proc_eeprom_read_byte
24.2.4ulk_proc_eeprom_write_N_bytes
24.2.5ulk_eeprom_read_N_bytes
25.ULK_PROC_AUDIO_API’S
25.1Table of API
ulk_audio_config_t
Element Details (possible values, exceptions etc)
SAMPLE_RATE Sample rate in kHz
Possible values->8, 11(11.025), 12, 16, 22(22.05), 24, 32, 44(44.1), 48.
Other values leads to set the default value 48.
BOOST_EFFECT Audio boost level
Possible values->0,1,2,3
Other values leads to set the default value 0.
MIC_L_GAIN Audio input channel lef gain in db
Possible values->->-6 to 24 with 1db step
Other values leads to set the default value 6.
MIC_R_GAIN Audio input channel right gain in db
Possible values->-6 to 24 with 1db step
Other values leads to set the default value 6.
SPK_L_GAIN Audio output channel lef gain in db
Possible values->-50,-48….0,1….12 with 2db step
Other values leads to set the default value 12.
SPK_R_GAIN Audio output channel right gain in db
Possible values50,-48….0,1….12 with 2db step
Other values leads to set the default value 12.
OUT_MODE Audio output mode
Possible values->M(mono) or S(stereo)
Other values leads to set the default value S.
ulk_audio_pcm_t
Element Details (possible values, exceptions etc)
pcm_type pcm line type. D/L/R
D(default) : Both L&R data, L – only L data, R – only R data
pcm_data_p Pointer to the pcm bufer.
pcm_size Number of pcm samples to be handled.
25.3 Functions
25.3.1ulk_proc_audio_init
25.3.2ulk _proc_audio_get_dflt_config
25.3.3ulk _proc_audio_set_dflt_config
25.3.4ulk_proc_audio_get_config
25.3.5ulk_proc_audio_set_config
25.3.6ulk_proc_audio_get_mute
25.3.7ulk_proc_audio_mute_enable
25.3.8ulk_proc_audio_codec_isEnable
25.3.9ulk_proc_audio_codec_enable
25.3.10ulk_proc_audio_loopback_isEnable
25.3.11ulk_proc_audio_ loopback_enable
25.3.12ulk_proc_audio_get_mic_gain
25.3.13ulk_proc_audio_set_mic_gain
25.3.14ulk_proc_audio_get_spkr_gain
25.3.15ulk_proc_audio_set_spkr_gain
25.3.16ulk_proc_audio_record
25.3.17ulk_proc_audio_play
25.3.18ulk_proc_audio_record_nb
25.3.19ulk_proc_audio_play_nb
26.ULK_PROC_CHARACTER_LCD_API’S
26.1Table of API
26.2 Functions
26.2.1ulk_proc_clcd_init
26.2.2ulk_proc_clcd_display_on
26.2.3ulk_proc_clcd_display_off
Function Definition ulk_proc_clcd_display_of ()
Arguments None.
Return value None.
26.2.4ulk_proc_clcd_cursor_home
26.2.5ulk_proc_clcd_display_clear
26.2.6ulk_proc_clcd_shift_left
26.2.7ulk_proc_clcd_shift_right
26.2.8ulk_proc_clcd_row_swap
26.2.9ulk_proc_clcd_display_string
26.2.10config_io_expander
26.2.11ulk_set_for_write_cmd
27.ULK_INTERRUPT_API’S
27.1Table of API
27.2Functions.
27.2.1ulk_swi_installer
27.2.2ulk_irq_installer
None
27.2.3ulk_fiq_installer
Function Definition Ulk_fiq_installer
Arguments int32 fiq_number, uint64 call_back_address, uint32 *arg
28.ULK_FPGA_7SEGLED_API’S
API Function
Sl No Function_name Purpose
1 ulk_gpmc_init Initialize gpmc with default configurations.
28.2 Functions
28.2.1ulk_fpga_led_enable
28.2.2ulk_fpga_led_disable
28.2.3ulk_fpga_led_write
29.ULK_FPGA_ADC_API’S
29.2Functions
29.2.1 ulk_fpga_adc_get_voltage
Function definition ulk_fpga_adc_get_voltage()
Arguments val
Return value Float val.
30.ULK_FPGA_DAC_API’S
30.2 Functions
30.2.1ulk_fpga_dac_set_voltage
31.ULK_FPGA_DIP SWITCH_API’S
31.2 Functions
31.2.1 ulk_fpga_dip_switch_read
32.ULK_FPGA_DDR_API’S
32.2Functions
32.2.1ulk_fpga_ddr_write
32.2.2ulk_fpga_read_ddr
33.ULK_FPGA_KEYPAD_API’S
3 ulk_fpga_keypad_getkey to get the value of the key pressed from the keypad by
the user.
33.2Functions
33.2.1ulk_fpga_keypad_init
33.2.2ulk_checking_interrupt
33.2.3ulk_fpga_keypad_getkey
34.ULK_FPGA_LED_API’S
34.2 Functions
34.2.1ulk_fpga_led_init
34.2.2ulk_fpga_led_drive
35.ULK_FPGA_PROGRAMMING _API’S
35.2Functions
35.2.1ulk_ fpga_load_init
35.2.2setPort
35.2.3pulseClock
Function Definition pulseClock()
Arguments None
Return value None.
35.2.4readByte
35.2.5readTDOBit
35.2.6waitTime
35.2.7fpga_prog_main
36.ULK_FPGA_UART _API’S
36.2Functions
36.2.1 ulk_gpmc_init
36.2.2ulk _gpmc_config
36.2.3FPGA_init
Function Definition FPGA_init(int baud_divisor)
Arguments baud divisor :Baud rate.
Return value None.
36.2.4ulk_fpga_uart_reg_init
36.2.5ulk_fpga_uart_getc
36.2.6ulk_fpga_uart_putc
36.2.7calc_divisor
36.2.8NS16550_puts_fpga
36.2.9NS16550_getc_fpga
36.2.10config_io_expander
36.2.11ulk__set_ for_write_cmd
36.2.12uint8 NS16500_set_parity_data_sb
Arguments Port number,int baudrate, uint8 parity, uint8 data, uint8 stopbit.
Return value None.
37.ULK_FPGA_CHARACTER_LCD _API’S
37.2Functions
37.2.1ulk_fpga_clcd_init
Arguments None
Return value None.
37.2.2ulk _fpga_clcd_display_on
37.2.3ulk _fpga_clcd_display_off
Function Definition ulk_fpga_clcd_display_of()
Arguments None
Return value None.
37.2.4ulk_fpga_clcd_cursor_home
37.2.5ulk_fpga_clcd_display_clear
37.2.6ulk_fpga_clcd_shift_left
37.2.7ulk_fpga_clcd_shift_right
37.2.8ulk_fpga_clcd_row_swap
37.2.9ulk_fpga_clcd_display_string
37.2.10ulk_fpga_gpmc_init
37.2.11ulk_fpga_gpmc_config
37.2.12ulk_fpga_gpmc_read_version
37.2.13ulk_fpga_clcd_hw_init
37.2.14ulk_fpga_clcd_poll_busy_flag