0% found this document useful (0 votes)
173 views

API Reference Document

This document provides a summary of APIs for EMDBY R2.0: - It includes APIs for UART, timers, PWM and SDMA functions. The UART API allows initialization and reading/writing of serial data. Timer APIs allow delays and timeouts. PWM APIs configure and control pulse-width modulation. SDMA APIs control direct memory access operations. - The document is organized by API type with tables of functions and descriptions of parameters and return values for each function. It also lists data structures used for SDMA and revision history. - The APIs allow control and communication via UART, timing functions for delays and timeouts, configuration of PWM for output signals, and management of direct memory access operations

Uploaded by

PB
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
173 views

API Reference Document

This document provides a summary of APIs for EMDBY R2.0: - It includes APIs for UART, timers, PWM and SDMA functions. The UART API allows initialization and reading/writing of serial data. Timer APIs allow delays and timeouts. PWM APIs configure and control pulse-width modulation. SDMA APIs control direct memory access operations. - The document is organized by API type with tables of functions and descriptions of parameters and return values for each function. It also lists data structures used for SDMA and revision history. - The APIs allow control and communication via UART, timing functions for delays and timeouts, configuration of PWM for output signals, and management of direct memory access operations

Uploaded by

PB
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 111

API Reference Document for EMDBY

R 2.0

API REFERENCE DOCUMENT FOR EMDBY


REL2.1
13th July 2010

Author’s Vikrama/Suhas

APPROVAL
Name Function Organization Date Signature
Mr. Hemachandra Bhat Wipro

Distribution Mohamed Saliya


Abdullah Khan

CONTACT INFO

Name Telephone e-mail


iWave Systems Technologies Pvt. Ltd. +91-80-26786245, [email protected]
No. 7/B, 29th Main, +91-80-26683700
BTM Layout 2nd Stage,
Bangalore - 560 076. INDIA.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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

DOCUMENTATION REVISION HISTORY

Revision Date Description Author Reviewer(s)


1.0 13-07-2010 Initial Draf version Vikrama
2.0 22-09-2011 All API Design Documents are Suhas Robin P.V
merged in to one

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

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

TABLE OF CONTENTS

1. ULK_PROC_UART_API.................................................................................................................................... 21

1.1 TABLE OF API.........................................................................................................................................................21


14.1 FUNCTIONS..........................................................................................................................................................22
14.1.1 ulk_proc_uart_init....................................................................................................................................22
14.1.2 ulk_proc_uart_getc...................................................................................................................................22
14.1.3 ulk_proc_uart_putc..................................................................................................................................22
14.1.4 ulk_proc_ uart_puts..................................................................................................................................22
14.1.5 ulk_proc_uart_gets...................................................................................................................................23
14.1.6 ulk_proc_uart_get_buf............................................................................................................................23
14.1.7 ulk_proc_uart_put_buf............................................................................................................................23
14.1.8 NS16550_putc...........................................................................................................................................23
14.1.9 NS16550_getc...........................................................................................................................................24
14.1.10 calc_divisor.............................................................................................................................................24
14.1.11 NS16550_init..........................................................................................................................................24
14.1.12 NS16500_set_parity_data_sb................................................................................................................24

15. ULK_TIMER_PWM_API’S............................................................................................................................. 28

15.1 TABLE OF API.......................................................................................................................................................28


15.2 FUNCTIONS..........................................................................................................................................................28
15.2.1 ulk_proc_delay..........................................................................................................................................28
15.2.2 ulk_proc_timeout_nb...............................................................................................................................29
15.2.3 ulk_proc_pwm_init...................................................................................................................................29
15.2.4 ulk_proc_pwm_config..............................................................................................................................29
15.2.5 ulk_proc_pwm_start.................................................................................................................................30
15.2.6 ulk_proc_pwm_stop.................................................................................................................................30
15.2.7 ulk_proc_pwm_pad_config......................................................................................................................30
15.2.8 ulk_proc_timer_stop.................................................................................................................................30

16. ULK_SDMA_API’S........................................................................................................................................ 31

16.1 TABLE OF API.......................................................................................................................................................31


16.2 DATA STRUCTURES FOR API....................................................................................................................................33
16.3 FUNCTIONS..........................................................................................................................................................35
16.3.1 ulk_proc_sdma_init..................................................................................................................................35
16.3.2 ulk_proc_sdma_start................................................................................................................................35
16.3.3 ulk_proc_sdma_stop.................................................................................................................................35
16.3.4 ulk_proc_sdma_set_ch.............................................................................................................................36
16.3.5 ulk_proc_sdma_get_ch............................................................................................................................36
16.3.6 ulk_proc_sdma_set_reqline......................................................................................................................36
16.3.7 ulk_proc_sdma_get_reqline.....................................................................................................................37
16.3.8 ulk_proc_sdma_set_data.........................................................................................................................37
16.3.9 ulk_proc_sdma_get_data.........................................................................................................................37
16.3.10 ulk_proc_sdma_get_index......................................................................................................................38
16.3.11 ulk_proc_set_en_fn................................................................................................................................38

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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

17. RTC API........................................................................................................................................................ 41

17.1 TABLE OF API’S....................................................................................................................................................41


17.2 DATA STRUCTURES FOR API....................................................................................................................................41
17.3 FUNCTIONS..........................................................................................................................................................42
17.3.1 .ulk_proc_enable_rtc................................................................................................................................42
17.3.2 ulk_proc_rtc_get_time.............................................................................................................................42
17.3.3 ulk_proc_rtc_set_time..............................................................................................................................42

18. ULK_MCSPI_API’S........................................................................................................................................ 43

18.1 TABLE OF API.......................................................................................................................................................43


18.2 FUNCTIONS..........................................................................................................................................................43
18.2.1 ulk_proc_spi_init.......................................................................................................................................43
18.2.2 . ulk_spi_select_ch....................................................................................................................................43
18.2.3 ulk_spi_read_single..................................................................................................................................44
18.2.4 ulk_spi_write_single.................................................................................................................................44
18.2.5 ulk_spi_read..............................................................................................................................................44
18.2.6 ulk_spi_write.............................................................................................................................................44
18.2.7 ulk_spi_read_nb.......................................................................................................................................45
18.2.8 ulk_spi_write_nb......................................................................................................................................45
18.2.9 ulk_touch_spi_enable...............................................................................................................................45

19. ULK_MCBSP_API’S....................................................................................................................................... 46

19.1 TABLE OF API.......................................................................................................................................................46


19.2 DATA STRUCTURES FOR API....................................................................................................................................47
19.3 FUNCTIONS..........................................................................................................................................................49
19.3.1 ulk_proc_mcbsp_pad_config....................................................................................................................49
19.3.2 ulk_proc_mcbsp_interface_reserve_request............................................................................................50
19.3.3 ulk_proc_mcbsp_interface_release..........................................................................................................50
19.3.4 ulk_proc_mcbsp_Tx_enable.....................................................................................................................50
19.3.5 ulk_proc_mcbsp_Rx_enable.....................................................................................................................51
19.3.6 ulk_proc_mcbsp_Rx_reset_enable...........................................................................................................51
19.3.7 ulk_proc_mcbsp_Tx_reset_enable...........................................................................................................51
19.3.8 ulk_proc_mcbsp_srg_enable....................................................................................................................53
19.3.9 ulk_proc_mcbsp_fsg_enable....................................................................................................................53
19.3.10 ulk_proc_mcbsp_srg_config...................................................................................................................53
19.3.11 ulk_proc_mcbsp_fsync_config................................................................................................................54

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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

20.1 TABLE OF API.......................................................................................................................................................59


20.2 FUNCTIONS..........................................................................................................................................................59
20.2.1 ulk_proc_led_config..................................................................................................................................59
20.2.2 ulk_proc_led_drive...................................................................................................................................59
20.2.3 ulk_proc_led_blink....................................................................................................................................60

21. ULK_PROC_KEYPAD_API’S........................................................................................................................... 61

21.1 TABLE OF API.......................................................................................................................................................61


21.2 FUNCTIONS..........................................................................................................................................................61
21.2.1 ulk_proc_keypad_i2c_init.........................................................................................................................61
21.2.2 ulk_proc_keypad_i2c_getkey....................................................................................................................61
21.2.3 ulk_proc_keypad_i2c_getkey_nb.............................................................................................................61

22. ULK_PROC_I2C_API’S................................................................................................................................... 62

22.1 TABLE OF API.......................................................................................................................................................62


22.2 FUNCTIONS..........................................................................................................................................................62
22.2.1 ulk_proc_i2c_init......................................................................................................................................62
22.2.2 ulk_proc_i2c_read_byte...........................................................................................................................62
22.2.3 ulk_proc_i2c_write_byte..........................................................................................................................63

23. ULK_PROC_GPIO_API’S................................................................................................................................ 64

23.1 TABLE OF API.......................................................................................................................................................64


23.2 FUNCTION............................................................................................................................................................65
23.2.1 ulk_proc_gpio_init....................................................................................................................................65
23.2.2 ulk_proc_gpio_reset.................................................................................................................................65
23.2.3 ulk_proc_gpio_set_dir..............................................................................................................................65
23.2.4 ulk_proc_gpio_get_dir..............................................................................................................................65
23.2.5 ulk_proc_gpio_get_data_in......................................................................................................................66

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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

24.1 TABLE OF API.......................................................................................................................................................73


24.2 FUNCTIONS..........................................................................................................................................................73
24.2.1 ulk_proc_eeprom_init...............................................................................................................................73
24.2.2 ulk_proc_eeprom_write_byte..................................................................................................................73
24.2.3 ulk_proc_eeprom_read_byte...................................................................................................................74
24.2.4 ulk_proc_eeprom_write_N_bytes............................................................................................................74
24.2.5 ulk_eeprom_read_N_bytes......................................................................................................................75

25. ULK_PROC_AUDIO_API’S............................................................................................................................. 76

25.1 TABLE OF API.......................................................................................................................................................76


25.2 DATA STRUCTURES FOR API....................................................................................................................................77
25.3 FUNCTIONS..........................................................................................................................................................79
25.3.1 ulk_proc_audio_init..................................................................................................................................79
25.3.2 ulk _proc_audio_get_dflt_config..............................................................................................................79
25.3.3 ulk _proc_audio_set_dflt_config..............................................................................................................79
25.3.4 ulk_proc_audio_get_config......................................................................................................................79
25.3.5 ulk_proc_audio_set_config......................................................................................................................80
25.3.6 ulk_proc_audio_get_mute.......................................................................................................................80
25.3.7 ulk_proc_audio_set_mute........................................................................................................................80
25.3.8 ulk_proc_audio_get_enable.....................................................................................................................80
25.3.9 ulk_proc_audio_set_enable.....................................................................................................................81
25.3.10 ulk_proc_audio_get_ loopback..............................................................................................................81

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

25.3.11 ulk_proc_audio_set_ loopback...............................................................................................................81


25.3.12 ulk_proc_audio_get_mic_gain...............................................................................................................81
25.3.13 ulk_proc_audio_set_mic_gain................................................................................................................81
25.3.14 ulk_proc_audio_get_spkr_gain..............................................................................................................82
25.3.15 ulk_proc_audio_set_spkr_gain..............................................................................................................82
25.3.16 ulk_proc_audio_in_pcm.........................................................................................................................82
25.3.17 ulk_proc_audio_out_pcm.......................................................................................................................83
25.3.18 ulk_proc_audio_in_pcm_nb...................................................................................................................83
25.3.19 ulk_proc_audio_out_pcm_nb.................................................................................................................83

26. ULK_PROC_CHARACTER_LCD_API’S............................................................................................................. 84

26.1 TABLE OF API.......................................................................................................................................................84


26.2 FUNCTIONS..........................................................................................................................................................84
26.2.1 ulk_proc_clcd_init.....................................................................................................................................84
26.2.2 ulk_proc_clcd_display_on.........................................................................................................................85
26.2.3 ulk_proc_clcd_display_of........................................................................................................................85
26.2.4 ulk_proc_clcd_cursor_home.....................................................................................................................85
26.2.5 ulk_proc_clcd_clear_display.....................................................................................................................85
26.2.6 ulk_proc_clcd_shift_left............................................................................................................................85
26.2.7 ulk_proc_clcd_shift_right.........................................................................................................................87
26.2.8 ulk_proc_clcd_row_swap.........................................................................................................................87
26.2.9 ulk_proc_clcd_display_string...................................................................................................................87
26.2.10 config_io_expander................................................................................................................................87
26.2.11 ulk_set_for_write_cmd...........................................................................................................................87

27. ULK_INTERRUPT_API’S................................................................................................................................ 88

27.1 TABLE OF API.......................................................................................................................................................88


27.2 FUNCTIONS..........................................................................................................................................................88
27.2.1 ulk_swi_installer.......................................................................................................................................88
27.2.2 ulk_irq_installer........................................................................................................................................88
27.2.3 ulk_fiq_installer........................................................................................................................................88

28. ULK_FPGA_7SEGLED_API’S.......................................................................................................................... 90

28.1 TABLE OF API.......................................................................................................................................................90


28.2 FUNCTIONS..........................................................................................................................................................90
28.2.1 ulk_fpga_led_enable................................................................................................................................90
28.2.2 ulk_fpga_led_disable................................................................................................................................90
28.2.3 ulk_fpga_led_write...................................................................................................................................90

29. ULK_FPGA_ADC_API’S................................................................................................................................. 91

29.1 TABLE OF API.......................................................................................................................................................91


29.2 FUNCTIONS..........................................................................................................................................................91
29.2.1 ulk_fpga_adc_get_voltage.......................................................................................................................91

30. ULK_FPGA_DAC_API’S................................................................................................................................. 92

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

30.1 TABLE OF API.......................................................................................................................................................92


30.2 FUNCTIONS..........................................................................................................................................................92
30.2.1 ulk_fpga_dac_set_voltage.......................................................................................................................92

31. ULK_FPGA_DIP SWITCH_API’S..................................................................................................................... 93

31.1 TABLE OF API.......................................................................................................................................................93


31.2 FUNCTIONS..........................................................................................................................................................93
31.2.1 ulk_fpga_dip_switch_read.......................................................................................................................93

32. ULK_FPGA_DDR_API’S................................................................................................................................. 94

32.1 TABLE OF API.......................................................................................................................................................94


32.2 FUNCTIONS..........................................................................................................................................................94
32.2.1 ulk_fpga_ddr_write..................................................................................................................................94
32.2.2 ulk_fpga_read_ddr...................................................................................................................................94

33. ULK_FPGA_KEYPAD_API’S............................................................................................................................ 95

33.1 TABLE OF API.......................................................................................................................................................95


33.2 FUNCTIONS..........................................................................................................................................................95
33.2.1 ulk_fpga_keypad_init...............................................................................................................................95
33.2.2 ulk_checking_interrupt.............................................................................................................................95
33.2.3 ulk_fpga_keypad_getkey..........................................................................................................................95

34. ULK_FPGA_LED_API’S.................................................................................................................................. 96

34.1 TABLE OF API.......................................................................................................................................................96


34.2 FUNCTIONS..........................................................................................................................................................96
34.2.1 ulk_fpga_led_init......................................................................................................................................96
34.2.2 ulk_fpga_led_drive...................................................................................................................................96

35. ULK_FPGA_PROGRAMMING _API’S............................................................................................................. 97

35.1 TABLE OF API.......................................................................................................................................................97


35.2 FUNCTIONS..........................................................................................................................................................97
35.2.1 ulk_ fpga_load_init...................................................................................................................................97
35.2.2 setPort.......................................................................................................................................................97
35.2.3 pulseClock.................................................................................................................................................98
35.2.4 readByte....................................................................................................................................................98
35.2.5 readTDOBit...............................................................................................................................................98
35.2.6 waitTime...................................................................................................................................................98
35.2.7 fpga_prog_main.......................................................................................................................................98

36. ULK_FPGA_UART _API’S.............................................................................................................................. 99

36.1 TABLE OF API.......................................................................................................................................................99


FPGA UART DRIVER API (ALL FUNCTIONS)........................................................................................................................99
36.2 FUNCTIONS........................................................................................................................................................100
36.2.1 ulk_gpmc_init.........................................................................................................................................100
36.2.2 ulk _gpmc_config....................................................................................................................................100

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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

37. ULK_FPGA_CHARACTER_LCD _API’S........................................................................................................... 103

37.1 TABLE OF API.....................................................................................................................................................103


37.2 FUNCTIONS........................................................................................................................................................104
37.2.1 ulk_fpga_clcd_init...................................................................................................................................104
37.2.2 ulk _fpga_clcd_display_on.....................................................................................................................104
37.2.3 ulk _fpga_clcd_display_of.....................................................................................................................104
37.2.4 ulk_fpga_clcd_cursor_home...................................................................................................................104
37.2.5 ulk_fpga_clcd_display_clear...................................................................................................................104
37.2.6 ulk_fpga_clcd_shift_left..........................................................................................................................104
37.2.7 ulk_fpga_clcd_shift_right.......................................................................................................................105
37.2.8 ulk_fpga_clcd_row_swap.......................................................................................................................105
37.2.9 ulk_fpga_clcd_display_string.................................................................................................................105
37.2.10 ulk_fpga_gpmc_init..............................................................................................................................105
37.2.11 ulk_fpga_gpmc_config.........................................................................................................................105
37.2.12 ulk_fpga_gpmc_read_version..............................................................................................................106
37.2.13 ulk_fpga_clcd_hw_init..........................................................................................................................106
37.2.14 ulk_fpga_clcd_poll_busy_flag...............................................................................................................106

LIST OF FIGURES
NO TABLE OF FIGURES ENTRIES FOUND.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

LIST OF TABLES
TABLE 1:TIMER AND PWM FUNCTIONS..................................................................................28

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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

ulk_proc_uart_putc Will read a character from the receiver register

ulk_proc_ uart_puts Will write a string of character to the transmit register.

ulk_proc_uart_gets Will read a string of character from the receiver register

ulk_proc_uart_get_buf Will reset the uart by setting some configuration


registers
ulk_proc_uart_put_buf Will clear the transmit & receive fifo’s of uart

NS16550_putc Will dump a character to transmit hold register(thr)

NS16550_getc Will read the character from the comport(rhr)

calc_divisor Calculates the divisor value

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_timeout_nb Call-back with non blocking time out. Call-back function


will be executed afer specified timeout without blocking
the process.
ulk_proc_pwm_init Initialize the specified PWM timer.

ulk_proc_pwm_config Configure the PWM (set period and duty cycle).

ulk_proc_pwm_start Start the PWM timer.

ulk_proc_pwm_stop Stop the PWM timer.

ulk_proc_pwm_pad_config Pad used for PWM

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

ulk_proc_timer_stop Stop the timer module.

ulk_proc_sdma_init Initialize SDMA channel.

ulk_proc_sdma_start Start/enable the sdma channel.

ulk_proc_sdma_stop Stop/disable the sdma channel.

ulk_proc_sdma_set_ch Set/configure the sdma channel settings.

ulk_proc_sdma_get_ch Get the sdma channel settings.

ulk_proc_sdma_set_reqline Assign request line and enable or disable the request.

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_get_parms get the source and the destination parameters

ulk_proc_set_ctrl_parms Set the control parameters for the channel

ulk_proc_get_ctrl_parms get the control parameters for the channel

ulk_proc_sdma_master_callback sdma master isr callback to serve all sdma irq lines

ulk_proc_proc_sdma_enable_irq to enable all sdma irq lines

.ulk_proc_enable_rtc initialises the RTC

ulk_proc_rtc_get_time gets the current time from the RTC.

ulk_proc_rtc_set_time sets the time from the RTC registers .

ulk_proc_spi_init Get the spi device and the SPI channel

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

. 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_spi_write_single Write a single byte to the SPI device

ulk_spi_read Read the data from the bufer

ulk_spi_write Transmit the the size of datas to the spi device.

ulk_spi_read_nb Read datas via the dma

ulk_spi_write_nb Write datas via dma.

ulk_touch_spi_enable Print the x and y coordinates

ulk_proc_mcbsp_pad_config Configure the system pad used for mcbsp.

ulk_proc_mcbsp_interface_reserve_ Request and initialize a mcbsp interface.


request

ulk_proc_mcbsp_interface_release Release the reserved interface.

ulk_proc_mcbsp_Tx_enable Enable/Disable mcbsp transmitter.

ulk_proc_mcbsp_Rx_enable Enable/Disable mcbsp receiver.

ulk_proc_mcbsp_Rx_reset_enable Enable/Reset mcbsp receiver.

ulk_proc_mcbsp_Tx_reset_enable Enable/Reset mcbsp transmitter.

ulk_proc_mcbsp_srg_enable Enable/Disable mcbsp sample rate generator.

ulk_proc_mcbsp_fsg_enable Enable/Disable mcbsp frame Synchronization generator.

ulk_proc_mcbsp_srg_config Configure the mcbsp sample rate generator.

ulk_proc_mcbsp_fsync_config Configure the mcbsp frame Synchronization generator.

ulk_proc_mcbsp_RxClk_config Configure the receiver clock.

ulk_proc_mcbsp_TxClk_config Configure the transmitter clock.

ulk_proc_mcbsp_Rx_param_config Set the receiver parameters.

ulk_proc_mcbsp_Tx_param_config Set the transmitter parameters.

ulk_proc_mcbsp_read Read from mcbsp input (receiver) register.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

ulk_proc_mcbsp_write Write to mcbsp output (transmitter) register.

ulk_mcbsp_interface_reset Reset the mcbsp interface using sofware reset.

ulk_proc_mcbsp_Tx_start Start the transmission using sdma.

ulk_proc_mcbsp_Tx_stop Stop the transmitter.

ulk_proc_mcbsp_Rx_start Start the receiving using sdma.

ulk_proc_mcbsp_Rx_stop Stop the receiver.

ulk_proc_mcbsp_Rx_dma_callback This is a callbac function for mcbsp dma receiver

ulk_proc_mcbsp_Tx_dma_callback This is a callbac function for mcbsp dma transmission

ulk_proc_led_config Configure and initialize specified LED GPIO line.

ulk_proc_led_drive Power on/of the LED.

ulk_proc_led_blink Blink the led with specified timing for a specified counts.

ulk_proc_keypad_i2c_init Initialize the keypad controller

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_i2c_read_byte Read a byte data from an i2c device.

ulk_proc_i2c_write_byte Write a byte data on to the i2c device.

ulk_proc_gpio_init Initialize the GPIO banks.

ulk_proc_gpio_reset Reset the GPIO.

ulk_proc_gpio_set_dir Set the GPIO direction.

ulk_proc_gpio_get_dir Get the GPIO direction.

ulk_proc_gpio_get_data_in Get the GPIO input data.

ulk_proc_gpio_set_data_out Set the GPIO output data.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

ulk_gpio_enable_wakeup Enable/Disable GPIO wakeup.

ulk_proc_gpio_enable_debounce Enable/Disable GPIO de-bounces.

ulk_proc_gpio_get_debounce Get the GPIO de-bounce time.

ulk_proc_gpio_set_debounce_time Set the GPIO de-bounce time.

ulk_proc_gpio_irq _enable _mpu Enable/Disable GPIO irq1.

ulk_proc_gpio_irq _clear _mpu Clear the irq1 status.

ulk_proc_gpio_irq _enable _iva Enable/Disable GPIO irq2.

ulk_proc_gpio_irq _clear _iva Clear the irq2 status.

ulk_proc_gpio_irq_trig_level_0 Set GPIO level low trigger to.

ulk_proc_gpio_irq_trig_level_1 Set GPIO level high trigger.

ulk_proc_gpio_irq_trig_edge_r Enable/Disable GPIO rising edge trigger.

ulk_proc_gpio_irq_trig_edge_f Enable/Disable GPIO falling edge trigger.

ulk_proc_sys_pad_set_muxmode Set the multiplexing mode of GPIO pad.

ulk_proc_sys_pad_get_muxmode Get the multiplexing mode of GPIO pad.

ulk_proc_sys_pad_set_pull PULL_UP/PULL_DOWN/OPEN_DRAIN

ulk_sys_pad_get_pull Get the GPIO pad pull up condition.

ulk _proc_sys_pad_set_dir Set the GPIO pad direction.

ulk _proc_sys_pad_get_dir Get the GPIO pad direction.

ulk _proc_sys_pad_set_wakeup Enable/Disable the GPIO pad wakeup.

ulk _proc_sys_pad_get_wakeup Get the GPIO pad wakeup setting.

ulk_proc_eeprom_init To initialize the EEPROM

ulk_proc_eeprom_write_byte To write a byte of data on the EEPROM.

ulk_proc_eeprom_read_byte To read a byte of data from the EEPROM.

ulk_proc_eeprom_write_N_bytes To write N bytes of data sequentially on the EEPROM.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

ulk_eeprom_read_N_bytes To read N bytes of data sequentially from the EEPROM.

ulk_proc_audio_init Initialize audio with default configurations.

ulk _proc_audio_get_dflt_config Get the default audio configuration settings.

ulk _proc_audio_set_dflt_config Set the default audio configuration settings.

ulk_proc_audio_get_config Get the current audio configuration settings.

ulk_proc_audio_set_config Set the current audio configuration settings.

ulk_proc_audio_get_mute Get the audio mute state.

ulk_proc_audio_mute Set the audio mute state.

ulk_proc_audio_codec_ Get the audio enable state.

ulk_proc_audio_codec_enable Set the audio enable state.

ulk_proc_audio_loopback Get the audio loop back state.

ulk_proc_audio_ loopback Set the audio loop back state.

ulk_proc_audio_get_mic_gain Get the audio input gain.

ulk_proc_audio_set_mic_gain Set the audio input gain.

ulk_proc_audio_get_spkr_gain Get the audio output gain.

ulk_proc_audio_set_spkr_gain Set the audio output gain.

ulk_proc_audio_ Capture the input audio data in a bufer. Blocking


function.
ulk_proc_audio_ Output the audio data from a bufer. Blocking function.

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.

ulk_proc_clcd_display_on Switches on the display.

ulk_proc_clcd_display_of Switches of the display.

ulk_proc_clcd_cursor_home This sets the cursor at the home position.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

ulk_proc_clcd_display Clears the display.

ulk_proc_clcd_shif_lef This lef shifs the display by ‘count’ number of times.

ulk_proc_clcd_shif_right This right shifs the display by ‘count’ number of times.

ulk_proc_clcd_row_swap Swaps the display rows.

ulk_proc_clcd_display_str Displays a string.

config_io_expander Initializes the I2C Cycles.

ulk_set_for_write_cmd Sends the Command/Data to the Character LCD

ulk_swi_installer Can be Used as sofware interrupt

ulk_irq_installer Can be used as a normal interrupt

ulk_fiq_installer Fast interrupt Function

FPGA INTERFACES
FUNCTION NAME DESCRIPTION
ulk_fpga_led Initialize gpmc and ON 7 segment led.

ulk_fpga_led This will of the 7 segment led.

ulk_fpga_led Display the value in 7 segment led.

ulk_fpga_adc_get_voltage Read the adc value.

ulk_fpga_dac_set_voltage Initialize gpmc and write the value in dac.

ulk_fpga_dip_switch_read Initialize the gpmc and read the dip_switch register


value.

ulk_fpga_ddr_write Write the values in TDR register.

ulk_fpga_read_ddr Read the values from RDR and SR register.

ulk_fpga_keypad_init Initialize the keypad controller

ulk_checking_interrupt to check the interrupt from the keypad

ulk_fpga_keypad_getkey to get the value of the key pressed from the keypad by
the user.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

ulk_fpga_led_init Initialize the gpmc and write the led value.

ulk_fpga_led_drive Glow the led according to the data byte.

ulk_ fpga_load_init Initialize TMS, TCK, TDI, TDO Gpio lines.


TMS, TCK, TDI set to input.
TDO set to output.
setPort This will set variables in debugging mode.

pulseClock Toggle TCK low and high.

readByte Read in a byte of data from the prom.

readTDOBit Read the TDO bit from port.

waitTime Program FPGA

fpga_prog_main Pulse TCK for specified microsec.

ulk_gpmc_init Initialize lcd gpmc.

ulk _gpmc_config Configure the gpmc.

FPGA_init Initialize the FPGA uart register

ulk_fpga_uart_reg_init Initialize gpmc and FPGA uart register.

ulk_fpga_uart_getc Used to get the value.

ulk_fpga_uart_putc Used to put the value.

calc_divisor Calculate the divisor value.

NS16550_puts_fpga Used to write the value in FPGA transmit reg.

NS16550_getc_fpga Used to read the value from FPGA receive register.

config_io_expander Initialize the i2c cycles.

ulk__set_ for_write_cmd Sends the commands to display.

uint8 NS16500_set_parity_data_sb Will set the configuration for uart (baudrate,number


of stop bits, number of databits, parity)
ulk_fpga_clcd_init Initialize lcd with default configurations.

ulk _fpga_clcd_display_on Switches on the display.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

ulk _fpga_clcd_display_of Switches of the display.

ulk_fpga_clcd_cursor_home This sets the cursor at the home position.

ulk_fpga_clcd_display_clear Clears the display.

ulk_fpga_clcd_shif_lef This lef shifs the display by ‘count’ number of times.

ulk_fpga_clcd_shif_right This right shifs the display by ‘count’ number of times.

ulk_fpga_clcd_row_swap Swaps the display rows.

ulk_fpga_clcd_display_str Displays a string.

ulk_fpga_gpmc_init Initializes the gpmc.

ulk_fpga_gpmc_config Configures the gpmc cycles.

ulk_fpga_gpmc_read_version Reads the version of FPGA.

ulk_fpga_clcd_hw_init Initializes in the character LCD.

ulk_fpga_clcd_poll_busy_flag Polls the busy flag of display.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

1.ULK_PROC_UART_API

1.1 Table of API

Sl No Function Name Purpose


2. ulk_proc_uart_init Initialization of UART is done by configuring the
related registers
3. ulk_proc_uart_getc Will dump a character in the transmit register

4. ulk_proc_uart_putc Will read a character from the receiver register

5. ulk_proc_ uart_puts Will write a string of character to the transmit


register.
6. ulk_proc_uart_gets Will read a string of character from the receiver
register
7. ulk_proc_uart_get_buf Will reset the uart by setting some configuration
registers
8. ulk_proc_uart_put_buf Will clear the transmit & receive fifo’s of uart

9. NS16550_putc Will dump a character to transmit hold


register(thr)
10. NS16550_getc Will read the character from the comport(rhr)

11. calc_divisor Calculates the divisor value

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

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Function Definition uint8 ulk_proc_uart_init (uint8 port, int baudrate)


Arguments Port :User specifies the port number for initialization of Uart
valid baudrate are 9600,19200,38400,57600,115200
Return value Return
PROC_SUCCESS 0

14.1.2 ulk_proc_uart_getc

Function Definition uint8 ulk_proc_uart_getc(uint8 port)

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

Function Definition uint8 ulk_proc_uart_putc (uint8 port, uint8 val)

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

Function Definition uint8 ulk_proc_uart_puts (uint8 port, uint8 *buf_p)


Arguments port :User specifies the port number to transmit the string.
buf_p: It’s the pointer that holds the string which is being transmitted.
Return value Returns always zero.

14.1.5 ulk_proc_uart_gets

Function Definition uint8 ulk_proc_uart_gets (uint8 port, uint8 *buf_p)

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

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

the port (i.e. receive holding register).


Return value Returns the string of characters read from the port.

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

Function Definition uint8 NS16550_putc ( NS16550_t com_port, char )


Arguments Comport & character
Return value Zero

14.1.9NS16550_getc
Function Definition uint8 NS16550_getc (NS16550_t com_port)

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Arguments comport
Return value zero.

14.1.10 calc_divisor

Function Definition int calc_divisor (NS16550_t port)


Arguments Port number.
Return value Returns integer value.

14.1.11NS16550_init

Function Definition void NS16550_init (NS16550_t com_port, int baud_divisor)


Arguments Port number & clock divisor.
Return value Zero

14.1.12NS16500_set_parity_data_sb

Function Definitions uint8 NS16500_set_parity_data_sb(NS16550_t


com_port, int baudrate, uint8 parity, uint8 data,
uint8 stopbit)
Arguments Port number,int baudrate, uint8 parity, uint8
data, uint8 stopbit.
Return value None.

struct NS16550 {
unsigned char rbr;
int pad1:24;
unsigned char ier;
int pad2:24;
unsigned char fcr;

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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;

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

15.ULK_TIMER_PWM_API’S

15.1Table of API
Table 1:Timer and PWM Functions

Timer API’S (All functions)


SL No Function_name Purpose
1 ulk_proc_delay Includes specified amount of delay in calling
function.
2 ulk_proc_timer_stop stop the timer module

3 Call-back with non blocking time out. Call-back


function will be executed afer specified timeout
without blocking the process.
PWM API’S
1 ulk_proc_pwm_init Initialize the specified PWM timer.

2 ulk_proc_pwm_config Configure the PWM (set period and duty cycle).

3 ulk_proc_pwm_start Start the PWM timer.

4 ulk_proc_pwm_pad_config Pad used for PWM

5 ulk_proc_pwm_stop Stop the PWM timer.

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.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Return value Always return 0.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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)

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Return value Succes: PROC_SUCCESS 0


Error code: /* Timer Number not supported in this processor */
PROC_TIMER_UNAVAIL (-1)

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

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

16. ULK_SDMA_API’S

16.1Table of API

SDMA Driver API (All functions)


Sl No Function_name Purpose
1 ulk_proc_sdma_init Initialize SDMA channel.

2 ulk_proc_sdma_start Start/enable the sdma channel.

3 ulk_proc_sdma_stop Stop/disable the sdma channel.

4 ulk_proc_sdma_set_ch Set/configure the sdma channel settings.

5 ulk_proc_sdma_get_ch Get the sdma channel settings.

6 ulk_proc_sdma_set_reqline Assign request line and enable or disable the


request.
7 ulk_proc_sdma_get_reqline Get the assigned sdma request line for the
channel.
8 ulk_proc_sdma_set_data Set the address and data size for the channel.

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

11 ulk_proc_set_index set the source and the destination element and


the frame indexes
12 ulk_proc_set_en_fn To set the number of elements and frames to
transfer via DMA
13 ulk_proc_set_parms Set the source and the destination parameters

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

14 ulk_proc_get_parms get the source and the destination parameters

15 ulk_proc_get_ctrl_parms get the control parameters for the channel

16 ulk_proc_set_ctrl_parms Set the control parameters for the channel

17 ulk_proc_sdma_master_callback sdma master isr callback to serve all sdma irq lines

18 ulk_proc_sdma_enable_irq to enable all sdma irq lines

19 ulk_proc_sdma_get_index Get the current element and frame number of the


channel.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

16.2 Data Structures for API

typedef struct ulk_sdma_config_tag {


uint8 data_type;
uint8 src_amode;
int32 src_ei;
int32 src_fi;
uint8 src_pack;
uint8 src_burst;
uint8 src_endian;
uint8 dest_amode;
int32 dest_ei;
int32 dest_fi;
uint8 dest_pack;
uint8 dest_burst;
uint8 dest_endian;
uint8 sync_mode;
uint8 src_or_dest_sync;
uint8 read_prio;
uint8 write_prio;
uint8 intr_enable;
uint8 intr_line;
uint8 lnk_channel;

} ulk_sdma_config_t;

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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

Function Definition uint8 ulk_proc_sdma_init_ch(uint8 channel)


Arguments channel(in):SDMA channel number. 0 to 31.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Return value Success: PROC_SUCCESS 0


Error code: /*Invalid sdma channel number*/
PROC_SDMA_INVALID_CHANNEL -81

16.3.2ulk_proc_sdma_start

Function Definition uint8 ulk_proc_sdma_start (uint8 channel, ulk_sdma_cb call_back)


Arguments channel(in):SDMA channel number. 0 to 31.
call_back(in): Call-back function pointer for SDMA.
Return value Success: PROC_SUCCESS 0
Error code: /*Invalid sdma channel number*/
PROC_SDMA_INVALID_CHANNEL -81

16.3.3ulk_proc_sdma_stop

Function Definition uint8 ulk_proc_sdma_stop (uint8 channel)


Arguments channel(in):SDMA channel number. 0 to 31.
Return value Success: PROC_SUCCESS 0
Error code: /*Invalid sdma channel number*/
PROC_SDMA_INVALID_CHANNEL -81

16.3.4ulk_proc_sdma_set_ch

Function Definition uint8 ulk_proc_sdma_set_ch (uint8 channel, ulk_sdma_config_t


*sdma_config)
Arguments channel(in):SDMA channel number. 0 to 31.
sdma_config(in): Pointer to an sdma configuration structure

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

(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

Function Definition uint8 ulk_proc_sdma_get_ch (uint8 channel, ulk_sdma_config_t


*sdma_config)
Arguments channel(in):SDMA channel number. 0 to 31.
sdma_config(out): sdma configuration structure (ulk_sdma_config_t)
pointer.
Return value Success: PROC_SUCCESS 0
Error code: /*Invalid sdma channel number*/
PROC_SDMA_INVALID_CHANNEL -81

16.3.6ulk_proc_sdma_set_reqline

Function Definition uint8 ulk_proc_sdma_set_reqline (uint8 channel, uint8 req_line, uint8


enable)
channel(in):SDMA channel number. 0 to 31.
Arguments req_line(in): SDMA request line. 1 to 95 (except reserved).
enable(in): Enable/disable sdma request

16.3.7ulk_proc_sdma_get_reqline

Function Definition uint8 ulk_proc_sdma_get_reqline (uint8 channel, uint8 *req_line)


Arguments channel(in):SDMA channel number. 0 to 31.
req_line(out): SDMA request line assigned for the channel.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Return value Success: PROC_SUCCESS 0


Error code: /*Invalid sdma channel number*/
PROC_SDMA_INVALID_CHANNEL -81

16.3.8ulk_proc_sdma_set_data

Function Definition Uint8 ulk_proc_sdma_set_data(uint8 channel, uint32 src_add, uint32


dest_add, uint32 elem_count, uint32 frame_count)
Arguments channel(in):SDMA channel number. 0 to 31.
src_add(in): Source addresss.
dest_add(in): Destination address.
elem_count(in): Element count. No of elements (of size data type) to be
transferred.
frame_count(in): Frame count. No of frames (of size element count) to
be transferred.
Return value Success: PROC_SUCCESS 0
Error code: /*Invalid sdma channel number*/
PROC_SDMA_INVALID_CHANNEL -81

16.3.9ulk_proc_sdma_get_data

Function Definition Uint8 ulk_proc_sdma_get_data(uint8 channel,uint32 *src_add, uint32


*dest_add, uint32 *elem_count, uint32 *frame_count)
Arguments channel(in):SDMA channel number. 0 to 31.
src_add(out): Pointer to hold Source address.
dest_add(out): Pointer to hold Destination address.
elem_count(out): Pointer to hold Element count.
frame_count(out): Pointer to hold Frame count.
Return value Success: PROC_SUCCESS 0
Error code: /*Invalid sdma channel number*/
PROC_SDMA_INVALID_CHANNEL -81

16.3.10ulk_proc_sdma_get_index

Function Definition uint8 ulk_proc_sdma_get_index(uint8 channel, uint32 *elem_count,

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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

Function Definition ulk_proc_set_src_dest_add (uint8 channel, uint32 src_add, uint32


dest_add )
Arguments Channel:Channel number
start_source - start address of the data
dest_source - destination address of the data
Return value none

16.3.13ulk_proc_set_index

Function Definition ulk_proc_set_index (uint8 channel,ulk_sdma_config_t *sdma_config)


Arguments channel : sdma channel number
sdma_config : sdma configuration structure pointer
Return value none

16.3.14ulk_proc_set_parms

Function Definition ulk_proc_set_parms (uint8 channel,ulk_sdma_config_t *sdma_config)


Arguments channel : sdma channel number
sdma_config : sdma configuration structure pointer
Return value none

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

16.3.15ulk_proc_get_parms

Function Definition ulk_proc_get_parms (uint8 channel,ulk_sdma_config_t *sdma_config)


Arguments channel : sdma channel number
sdma_config : sdma configuration structure pointer
Return value none

16.3.16ulk_proc_set_ctrl_parms

Function Definition ulk_proc_set_ctrl_parms (uint8 channel,ulk_sdma_config_t


*sdma_config)
Arguments channel : sdma channel number
sdma_config : sdma configuration structure pointer
Return value none

16.3.17ulk_proc_get_ctrl_parms

Function Definition ulk_proc_get_ctrl_parms (uint8 channel,ulk_sdma_config_t


*sdma_config)
Arguments channel : sdma channel number
sdma_config : sdma configuration structure pointer
Return value none

16.3.18ulk_proc_sdma_master_callback

Function Definition ulk_proc_sdma_master_callback(uint32 lch)


Arguments lch
Return value none

16.3.19ulk_proc_proc_sdma_enable_irq

Function Definition uint8 ulk_proc_proc_sdma_enable_irq(uint8 channel, uint8 irq_line)


Arguments channel : sdma channel number
irq_line: irq line for the channel
Return value Success: PROC_SUCCESS 0
Error code: /*Invalid irq line*/
PROC_INVALID_IRQ_LINE -82

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

17.RTC API

17.1Table of API’s

RTC API (All functions)


SL No Function_name Purpose
1 .ulk_proc_enable_rtc initialises the RTC

2 ulk_proc_rtc_get_time gets the current time from the RTC.

3 ulk_proc_rtc_set_time sets the time from the RTC registers .

17.2 Data Structures for API

struct rtc_time {

int8 tm_sec;

int8 tm_min;

int8 tm_hour;

int8 tm_day;

int8 tm_mon;

int8 tm_year;

};

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

17.3 Functions

17.3.1.ulk_proc_enable_rtc

Function Definition void ulk_proc_enable_rtc ( )


Arguments none
Return value 0-success, -51-failure

17.3.2ulk_proc_rtc_get_time

Function Definition void ulk_proc_rtc_get_time( strcuct *rtc_time)


Arguments pointer to the rtc_time structure
Return value Success PROC_SUCCESS 0
/*ERROR 0:RTC SET_TIME failed*/

PROC_RTC_GET_TIME_FAILED -57

17.3.3ulk_proc_rtc_set_time

Function Definition void ulk_proc_rtc_set_time( strcuct *rtc_time)


Arguments pointer to the rtc_time structure
Return value Success code:PROC_SUCCESS 0
Error code:/*ERROR 0:RTC stop failed*/

PROC_RTC_STOP_TIME_FAILED -58
/*ERROR 0:RTC start failed*/

PROC_RTC_START_TIME_FAILED -59

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

18.ULK_MCSPI_API’S

18.1Table of API

SPI API (All functions)


Sl No Function_name Purpose
1 ulk_proc_spi_init Get the spi device and the SPI channel

2 . ulk_spi_select_ch Configure the spi with the selected channel and the selected SPI

3 ulk_spi_read_single Read a single byte from the SPI device.

4 ulk_spi_write_single Write a single byte to the SPI device

5 ulk_spi_read Read the data from the bufer

6 ulk_spi_write Transmit the the size of datas to the spi device.

7 ulk_spi_read_nb Read datas via the dma

8 ulk_spi_write_nb Write datas via dma.

9 ulk_touch_spi_enable Print the x and y coordinates

18.2 Functions

18.2.1ulk_proc_spi_init

Function Definition ulk_proc_spi_init (uint8 device )

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Arguments device – spi device


Return value None

18.2.2. ulk_spi_select_ch

Function Definition ulk_spi_select_ch (uint8 dev, uint8 channel)


Arguments channel - channel number
device – spi device
Return value None

18.2.3ulk_spi_read_single

Function Definition ulk_spi_read_single (uint8 dev, uint8 *byte)


Arguments device – select the device
byte – pointer to the data byte
Return value pointer to the data

18.2.4ulk_spi_write_single

Function Definition ulk_spi_write_single (uint8 dev, uint8 byte)


Arguments device – device selected
byte – data byte
Return value none

18.2.5ulk_spi_read

Function Definition ulk_spi_read(uint8 dev, uint8 *buf, uint32 size)


Arguments dev – device selected
buf – pointer to the bufer
size -size of the data
Return value none

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

18.2.6 ulk_spi_write

Function Definition ulk_spi_write(uint8 dev, uint8 *buf, uint32 size)


Arguments dev – device selected
buf – pointer to the bufer
size -size of the data
Return value none

18.2.7ulk_spi_read_nb

Function Definition ulk_spi_read_nb (uint8 dev, (*func_ptr)(), read_arg )


Arguments SPI device selected
pointer to te dma function.
Arguments to the function.
Return value none

18.2.8ulk_spi_write_nb

Function Definition ulk_spi_write_nb (uint8 dev, (*func_ptr)(), read_arg )


Arguments SPI device selected
pointer to te dma function.
Arguments to the function.
Return value none

18.2.9ulk_touch_spi_enable

Function Definition ulk_touch_spi_enable (uint8 spi_device, uint8 spi_channel)


Arguments Spi channel and the spi device

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Return value none

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

19.ULK_MCSPI_API’S

19.1Table of API

Mcbsp Driver API (All functions)


Sl No Function_name Purpose
1 ulk_proc_mcbsp_pad_config Configure the system pad used for mcbsp.

2 ulk_proc_mcbsp_interface_reserve_request Request and initialize a mcbsp interface.

3 ulk_proc_mcbsp_interface_release Release the reserved interface.

4 ulk_proc_mcbsp_Tx_enable Enable/Disable mcbsp transmitter.

5 ulk_proc_mcbsp_Rx_enable Enable/Disable mcbsp receiver.

6 ulk_proc_mcbsp_Rx_reset_enable Enable/Reset mcbsp receiver.

7 ulk_proc_mcbsp_Tx_reset_enable Enable/Reset mcbsp transmitter.

8 Enable/Disable mcbsp sample rate generator.

9 ulk_proc_mcbsp_fsg_enable Enable/Disable mcbsp frame Synchronization


generator.
10 ulk_proc_mcbsp_srg_config Configure the mcbsp sample rate generator.

11 ulk_proc_mcbsp_fsync_config Configure the mcbsp frame Synchronization


generator.
12 ulk_proc_mcbsp_RxClk_config Configure the receiver clock.

13 ulk_proc_mcbsp_TxClk_confi Configure the transmitter clock.

14 ulk_proc_mcbsp_Rx_param_config Set the receiver parameters.

15 ulk_proc_mcbsp_Tx_param_config Set the transmitter parameters.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

16 ulk_proc_mcbsp_read Read from mcbsp input (receiver) register.

17 ulk_proc_mcbsp_write Write to mcbsp output (transmitter) register.

18 ulk_mcbsp_interface_reset Reset the mcbsp interface using sofware reset.

19 Uint8 Start the transmission using sdma.

20 ulk_proc_mcbsp_Tx_stop Stop the transmitter.

21 ulk_proc_mcbsp_Rx_start Start the receiving using sdma.

22 uint8 Stop the receiver.

23 ulk_proc_mcbsp_Rx_dma_callback This is a callbac function for mcbsp dma receiver

24 ulk_proc_mcbsp_Tx_dma_callback This is a callbac function for mcbsp dma


transmission

19.2Data Structures for API

typedef struct ulk_mcbsp_srg_tag


{
uint32 sample_rate;
uint32 bits_per_sample;
uint32 clk_rate;
uint8 srg_src;
uint8 sync_mode;
uint8 polarity;

} ulk_mcbsp_srg_t;

typedef struct ulk_mcbsp_fsync_tag


{

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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;

typedef struct ulk_mcbsp_transfer_param_tag


{
uint8 phase;
uint8 data_delay;
uint32 word_length1;
uint32 word_length2;
uint32 frame_length1;
uint32 frame_length2;
uint8 sdma_channel;
ulk_sdma_config_t *mcbsp_sdma_cfg;

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

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Indicates 1 to 128 words per frame.


In dual phase only 1 word per frame supported.
frame_length2 Frame length of second phase sample. 0 to 127 i.e. Masked values of 7
bits will be used by discarding other bits.
Indicates 1 to 128 words per frame.
In single phase neglected.
In dual phase only 1 word per frame supported.

19.3 Functions

19.3.1ulk_proc_mcbsp_pad_config

Function Definition uint8 ulk_proc_mcbsp_pad_config(uint8 pin, uint8 dir)


Arguments pin (in):Gpio pin number of the pad to be configured for mcbsp
interface.the values are from 116 to 119
dir (in): Pad interface direction on processor (input-1 or output-0).
Return value #return PROC_SUCCESS 0

19.3.2ulk_proc_mcbsp_interface_reserve_request

Function Definition uint8 ulk_proc_mcbsp_interface_reserve_request


(uint32 mcbsp_id, uint8 interface_mode,uint8 fclk_source)
Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
interface_mode (in): Mcbsp interface mode or processor role (master-1
or slave-0).
fclk_source (in): Functional clock source. (External-2 or internal PRCM-
1).
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91
//McBSP interface already reserved
McBSPI_ALREADY_USED -92
//Invalid interface mode
INVALID_MODE -93

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

19.3.3ulk_proc_mcbsp_interface_release

Function Definition uint8 ulk_proc_mcbsp_interface_release(uint32 mcbsp_id)


Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91
//McBSP id was not reserved
McBSP_WAS_NOT_RESERVED -94

19.3.4ulk_proc_mcbsp_Tx_enable

Function Definition uint8 ulk_proc_mcbsp_Tx_enable(uint32 mcbsp_id, uint8 state)


Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
State: Transmitter states (enable-1 or disable-0).
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91
//Invalid XEN state
INVALID_XEN -111

19.3.5ulk_proc_mcbsp_Rx_enable

Function Definition uint8 ulk_mcbsp_Rx_enable(uint32 mcbsp_id, uint8 state)


Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
State: Receiver states (enable-1 or disable-0).
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91
//Invalid RRST state
INVALID_RRST -112

19.3.6ulk_proc_mcbsp_Rx_reset_enable

Function Definition uint8 ulk_proc_mcbsp_Rx_reset_enable(uint32 mcbsp_id, uint8 state)

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).


State: Receiver reset states (enable-1 or disable-0).
Return value Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91

19.3.7ulk_proc_mcbsp_Tx_reset_enable

Function Definition uint8 ulk_proc_mcbsp_Tx_reset_enable(uint32 mcbsp_id, uint8 state)


Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
State: Transmitter reset states (enable-1 or disable-0).
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

19.3.8ulk_proc_mcbsp_srg_enable

Function Definition uint8 ulk_proc_mcbsp_srg_enable(uint32 mcbsp_id, uint8 state)


Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
State: Sample rate generator states (enable-1 or disable-0).
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91
//Invalid SRG source
INVALID_SRG -100

19.3.9ulk_proc_mcbsp_fsg_enable

Function Definition uint8 ulk_proc_mcbsp_fsg_enable(uint32 mcbsp_id, uint8 state)


Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
State: Frame synchronise generator states (enable-1 or disable-0).
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91
//Invalid FSG state
INVALID_FSG -113

19.3.10ulk_proc_mcbsp_srg_config

Function Definition Uint8 ulk_proc_mcbsp_srg_config(uint32 mcbsp_id, ulk_mcbsp_srg_t


*srg_config)
Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
srg_config: Sample rate generator configuration structure pointer.
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91
//Invalid CLKX polarity
INVALID_CLKX -101
//Invalid CLKR polarity
INVALID_CLKR -102
//Invalid CLKS polarity

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

INVALID_CLKS -103

19.3.11ulk_proc_mcbsp_fsync_config

Function Definition uint8 ulk_proc_mcbsp_fsync_config(uint32 mcbsp_id,


ulk_mcbsp_fsync_t *fsync_config)
Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
fsync_config: Frame synchronise generator configuration structure
pointer.
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91
//Invalid tx polarity
INVALID_TX_POL -108
//Invalid Rx polarity
INVALI_RX_POL -109

19.3.12ulk_proc_mcbsp_RxClk_config

Function Definition uint8 ulk_proc_mcbsp_RxClk_config(uint32 mcbsp_id, uint8 clk_mode,


uint8 polarity)
Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
clk_mode (in): Mcbsp receiver clock mode or source (internal-2 or
external-1).
polarity (in): Receiver clock polarity (rising-1 or falling-2 edge).
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91
//Invalid Rx Clock Source
INVALID_RX_CLK -105
//Invalid CLKR polarity
INVALID_CLKR -102

19.3.13ulk_proc_mcbsp_TxClk_config

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Function Definition uint8 ulk_proc_mcbsp_TxClk_config(uint32 mcbsp_id, uint8 clk_mode,


uint8 polarity)
Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
clk_mode (in): Mcbsp transmitter clock mode or source (internal-2 or
external-1).
polarity (in): Transmitter clock polarity (rising-1 or falling-2 edge).
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91
//Invalid CLKX polarity
INVALID_CLKX -101
//Invalid CLK Tx Source
INVALID_CLK_TX -104

19.3.14ulk_proc_mcbsp_Rx_param_config

Function Definition uint8 ulk_proc_mcbsp_Rx_param_config(uint32 mcbsp_id,


ulk_mcbsp_transfer_param_t * rp)
Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
Rp: Receiver parameter configuration structure pointer.
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91

19.3.15ulk_proc_mcbsp_Tx_param_config

Function Definition uint8 ulk_proc_mcbsp_Tx_param_config(uint32 mcbsp_id,


ulk_mcbsp_transfer_param_t * tp)
Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
Tp: Transmitter parameter configuration structure pointer.
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91
//Inivalid tx word_length
INVALID_LENGTH -99

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

19.3.16ulk_proc_mcbsp_read

Function Definition uint32 ulk_proc_mcbsp_read(uint32 mcbsp_id)


Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
Return value 16bit value read from mcbsp.

19.3.17ulk_proc_mcbsp_write

Function Definition uint8 ulk_proc_mcbsp_write(uint32 mcbsp_id, int32 data)


Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
data (in): Data to be sent in mcbsp interface.
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91

19.3.18ulk_mcbsp_interface_reset

Function Definition uint8 ulk_mcbsp_interface_reset(uint32 mcbsp_id)


Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91

19.3.19Uint8

19.3.20 ulk_proc_mcbsp_Tx_start

Function Definition uint8


ulk_proc_mcbsp_Tx_start(uint32 mcbsp_id, uint32 data_add, uint32
data_size, uint32 call_back)
Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
data_add(in): Source data address for transmition.
data_size(in): Data size in bytes to be sent.
call_back(in): Callback function pointer for transmition completion.
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

19.3.21ulk_proc_mcbsp_Tx_stop

Function Definition ulk_proc_mcbsp_Tx_stop(uint32 mcbsp_id)


Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91

19.3.22ulk_proc_mcbsp_Rx_start

Function Definition uint 8ulk_proc_mcbsp_Rx_start(uint32 mcbsp_id, uint32 data_add,


uint32 data_size, uint32 call_back)
Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).
data_add(in): Source data address for transmission.
data_size(in): Data size in bytes to be received.
call_back(in): Call-back function pointer for receive completion.
Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91

19.3.23 uint8

19.3.24 ulk_proc_mcbsp_Rx_stop

Function Definition Uint8


ulk_proc_mcbsp_Rx_stop(uint32 mcbsp_id)

Arguments mcbsp_id (in):Mcbsp interface number. (0 to 4).


Return value Success code:PROC_SUCCESS 0
Error code: /*Invalid McBSP interface id*/
INVALID_McBSP_ID -91

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

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

19.3.26 ulk_proc_mcbsp_Tx_dma_callback

Function Definition void ulk_proc_mcbsp_Tx_dma_callback(uint8 ch_id)


Arguments ch_id: sdma channel number
Return value void

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

20.ULK_PROC_LED_API’S

20.1 Table of API

LED API (All functions)


Sl No Function_name Purpose
1 ulk_proc_led_config Configure and initialize specified LED GPIO line.

2 ulk_proc_led_drive Power on/of the LED.

3 ulk_proc_led_blink Blink the led with specified timing for a specified


counts.

20.2 Functions

20.2.1ulk_proc_led_config

Function Definition uint8 ulk_proc_led_config (uint8 led_line)


Arguments led_line (in):LED to be configured and initialized 0 to 9.
Return value Success: PROC_SUCCESS 0
error code: /*invalid led. valid 0 to 7*/

PROC_INVALID_LED -76

20.2.2ulk_proc_led_drive

Function Definition uint8 ulk_proc_led_drive (uint8 led_line, uint8 led_on)


Arguments led_line (in):LED to be controlled 0 to 9.
led_on (in): Power on/of condition, 0-of and 1-on.
Return value Success: PROC_SUCCESS 0
Error code: /*invalid led. valid 0 to 7*/

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

PROC_INVALID_LED -76

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

20.2.3ulk_proc_led_blink

Function Definition uint8 ulk_led_blink (uint8 led_line, uint32 led_blink_udelay , uint32


led_blink_count)
Arguments led_line (in):LED to be blinked 0 to 9.
led_blink_udelay (in): Delay count between blink. Using
ULK_USE/ULK_MSEC/ULK_SEC
led_blink_count (in): Number of times LED blink to be performed.
Return value Success: PROC_SUCCESS 0
Error code: /*invalid led. valid 0 to 7*/

PROC_INVALID_LED -76

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

21.ULK_PROC_KEYPAD_API’S

21.1 Table of API

APIs supported for keypad with the OMAP processor


Sl No Function_name Purpose
1 ulk_proc_keypad_i2c_init Initialize the keypad controller

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

Function Definition uint32 ulk_proc_keypad_i2c_init (void)


Arguments void
Return value PROC SUCCESS 0

21.2.2ulk_proc_keypad_i2c_getkey

Function Definition uint32 ulk_proc_keypad_i2c_getkey (void)


Arguments void
Return value returns the character pressed on the keypad

21.2.3ulk_proc_keypad_i2c_getkey_nb

Function Definition uint32 ulk_keypad_i2c_getkey_nb (&funcptr, void *)


Arguments funcptr

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Return value returns the character pressed on the keypad

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

22.ULK_PROC_I2C_API’S

22.1Table of API

I2C API (All functions)


Sl No Function_name Purpose
1 ulk_proc_i2c_init Initialize the i2c line.

2 ulk_proc_i2c_read_byte Read a byte data from an i2c device.

3 ulk_proc_i2c_write_byte Write a byte data on to the i2c device.

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

Function Definition uint8 ulk_proc_i2c_read_byte (uint8 devaddr, uint8 regofset, uint8 *


value)
Arguments devaddr (in):I2c target device address.
regoffset (in): I2c device register ofset address for reading.
value (out): Value read from the specified address.
Return value Error code: /*Invalid i2c bus no*/
PROC_BUS_UNAVAIL -38

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

22.2.3ulk_proc_i2c_write_byte

Function Definition uint8 ulk_proc_i2c_write_byte (uint8 devaddr, uint8 regofset, uint8


value)
Arguments devaddr (in):I2c target device address.
regoffset (in): I2c device register ofset address for reading.
value (in): Value to be written to the specified address.
Return value Error code: /*Invalid i2c bus no*/
PROC_BUS_UNAVAIL -38

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

23.ULK_PROC_GPIO_API’S

23.1Table of API

GPIO Driver API (All functions)


Sl No Function_name Purpose
1 ulk_proc_gpio_init Initialize the GPIO banks.

2 ulk_proc_gpio_reset Reset the GPIO.

3 ulk_proc_gpio_set_dir Set the GPIO direction.

4 ulk_proc_gpio_get_dir Get the GPIO direction.

5 ulk_proc_gpio_get_data_in Get the GPIO input data.

6 ulk_proc_gpio_set_data_out Set the GPIO output data.

7 ulk_gpio_enable_wakeup Enable/Disable GPIO wakeup.

8 ulk_proc_gpio_enable_debounce Enable/Disable GPIO de-bounces.

9 ulk_proc_gpio_get_debounce_time Get the GPIO de-bounce time.

10 ulk_proc_gpio_set_debounce_time Set the GPIO de-bounce time.

11 ulk_proc_gpio_irq _enable _mpu Enable/Disable GPIO irq1.

12 ulk_proc_gpio_irq _clear _mpu Clear the irq1 status.

13 ulk_proc_gpio_irq _enable _iva Enable/Disable GPIO irq2.

14 ulk_proc_gpio_irq _clear _iva Clear the irq2 status.

15 ulk_proc_gpio_irq_trig_level_0 Set GPIO level low trigger to.

16 ulk_proc_gpio_irq_trig_level_1 Set GPIO level high trigger.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

17 ulk_proc_gpio_irq_trig_edge_r Enable/Disable GPIO rising edge trigger.

18 ulk_proc_gpio_irq_trig_edge_f Enable/Disable GPIO falling edge trigger.

System pad configuration API’S

1 ulk_proc_sys_pad_set_muxmode Set the multiplexing mode of GPIO pad.

2 ulk_proc_sys_pad_get_muxmode Get the multiplexing mode of GPIO pad.

3 ulk_proc_sys_pad_set_pull PULL_UP/PULL_DOWN/OPEN_DRAIN

4 ulk_sys_pad_get_pull Get the GPIO pad pull up condition.

5 ulk _proc_sys_pad_set_dir Set the GPIO pad direction.

6 ulk _proc_sys_pad_get_dir Get the GPIO pad direction.

7 ulk _proc_sys_pad_set_wakeup Enable/Disable the GPIO pad wakeup.

8 ulk _proc_sys_pad_get_wakeup Get the GPIO pad wakeup setting.

23.2Function

23.2.1ulk_proc_gpio_init

Function Definition uint8 ulk_proc_gpio_init (void)


Arguments void
Return value Success 0.
Error: invalid gpio pin (-51)

23.2.2ulk_proc_gpio_reset

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Function Definition uint8 ulk_proc_gpio_reset (uint8 pin)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
Return value Success 0.
Error: invalid gpio pin (-51)

23.2.3ulk_proc_gpio_set_dir

Function Definition uint8 ulk_proc_gpio_set_dir (uint8 pin, uint8 direction)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
direction (in): Direction indicator. 0-output, 1-input, other values leads
to default input direction
Return value Success 0.
Error: invalid gpio pin (-51)

23.2.4ulk_proc_gpio_get_dir

Function Definition uint8 ulk_proc_gpio_get_dir(uint8 pin, uint8 *direction)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
direction (out): Pointer to hold the current direction of the pin.
Return value Success 0.
Error: invalid gpio pin (-51)

23.2.5ulk_proc_gpio_get_data_in

Function Definition uint8 ulk_proc_gpio_get_data_in (uint8 pin, uint8 *datain)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
datain (out): Pointer to hold the input data in the pin.

Return value Success 0.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Error: invalid gpio pin (-51)

23.2.6ulk_proc_gpio_set_data_out

Function Definition uint8 ulk_proc_gpio_set_data_out (uint8 pin, uint8 dataout)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
dataout (in): Data to be sent to the pin. 0-low, 1-high, other values leads
to default low value
Return value Success 0.
Error: invalid gpio pin (-51)

23.2.7ulk_gpio_enable_wakeup

Function Definition uint8 ulk_proc_gpio_enable_wakeup (uint8 pin, uint8 enable)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
enable (in): Wakeup indicator. 0-disable, 1-enable, other values leads to
default disable condition.
Return value Success 0.
Error: invalid gpio pin (-51)

23.2.8ulk_proc_gpio_enable_debounce

Function Definition uint8 ulk_proc_gpio_enable_debounce (uint8 pin, uint8 enable)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
debounce (in): De bounce indicator. 0-disable, 1-enable, other values
leads to default disable condition.
Return value Success 0.
Error: invalid gpio pin (-51).

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

23.2.9ulk_proc_gpio_get_debounce

Function Definition uint8 ulk_proc_gpio_get_debounce_time (uint8 pin, uint32


*debounce_time)
Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
debounce_time (out): Pointer to hold the ‘currant de bounce time
setting’.
Return value Success 0.
Error: invalid gpio pin (-51)

23.2.10ulk_proc_gpio_set_debounce_time

Function Definition uint8 ulk_proc_gpio_set_debounce_time (uint8 pin, uint32


debounce_time)
Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
debounce_time (in): De-bounce time in micro seconds. Multiples of 31
(31, 62… 255*31). Other value leads to set its round down value in
multiples of 31. Less than 31 lead to minimum supported value (31).
Return value Success 0.
Error: invalid gpio pin (-51).

23.2.11ulk_proc_gpio_irq _enable _mpu

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

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

23.2.12ulk_proc_gpio_irq _clear _mpu

Function Definition uint8 ulk_proc_gpio_irq _clear _mpu (uint8 pin)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
Return value Success 0.
Error: invalid gpio pin (-51).

23.2.13ulk_proc_gpio_irq _enable _iva

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.14ulk_proc_gpio_irq _clear _iva

Function Definition uint8 ulk_proc_gpio_irq _clear _iva (uint8 pin)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
Return value Success 0.
Error: invalid gpio pin (-51).

23.2.15ulk_proc_gpio_irq_trig_level_0

Function Definition uint8 ulk_proc_gpio_irq_trig_level_0 (uint8 pin, uint8 enable)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
enable (in): Low level trigger. 0-disable, 1-enable, other values leads to
default disable condition.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Return value Success 0.


Error: invalid gpio pin (-51).

23.2.16ulk_proc_gpio_irq_trig_level_1

Function Definition uint8 ulk_proc_gpio_irq_trig_level_1(uint8 pin, uint8 enable)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
enable (in): High level trigger. 0-disable, 1-enable, other values leads to
default disable condition.
Return value Success 0.
Error: invalid gpio pin (-51)

23.2.17ulk_proc_gpio_irq_trig_edge_r

Function Definition uint8 ulk_proc_gpio_irq_trig_edge_r (uint8 pin, uint8 enable)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
enable (in): Rising edge trigger. 0-disable, 1-enable, other values leads
to default disable condition.
Return value Success 0.
Error: invalid gpio pin (-51)

23.2.18ulk_proc_gpio_irq_trig_edge_f

Function Definition uint8 ulk_proc_gpio_irq_trig_edge_f (uint8 pin, uint8 enable)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
enable (in): Falling edge trigger. 0-disable, 1-enable, other values leads
to default disable condition.
Return value Success 0.
Error: invalid gpio pin (-51)

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

23.2.19ulk_proc_sys_pad_set_muxmode

Function Definition uint8 ulk_proc_sys_pad_set_muxmode (uint8 pin, uint8 muxmode)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
muxmode (in): Multiplexing mode for the GPIO pad. 0 to 7 (indicates
mode0 to mode7). Other value will be ignored.
Return value Success 0.
Error: invalid gpio pin (-51)

23.2.20ulk_proc_sys_pad_get_muxmode

Function Definition uint8 ulk_proc_sys_pad_get_muxmode (uint8 pin, uint8 *muxmode)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
muxmode (out): Pointer to hold currant multiplexing mode of GPIO pad.
Return value Success 0.
Error: invalid gpio pin (-51).

23.2.21ulk_proc_sys_pad_set_pull

Function Definition uint8 ulk_proc_sys_pad_set_pull (uint8 pin, uint8 pull)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
pull (in): Pull indicator for the GPIO pad. 0-pull down, 1-pull up, 2-open
drain other values leads to default open drain condition.
Return value Success 0.
Error: invalid gpio pin (-51).

23.2.22ulk_sys_pad_get_pull

Function Definition uint8 ulk_proc_sys_pad_get_pull (uint8 pin, uint8 *pull)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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

Function Definition uint8 ulk _proc_sys_pad_set_dir (uint8 pin, uint8 direction)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
direction (in): Pad direction indicator. 0-output, 1-input, other values
leads to default input direction.
Return value Success 0.
Error: invalid gpio pin (-51).

23.2.24ulk _proc_sys_pad_get_dir

Function Definition uint8 ulk _proc_sys_pad_get_dir (uint8 pin, uint8 *direction)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
direction (out): Pointer to hold the current direction of the pad.
Return value Success 0.
Error: invalid gpio pin (-51).

23.2.25ulk _proc_sys_pad_set_wakeup

Function Definition uint8 ulk _proc_sys_pad_set_wakeup(uint8 pin, uint8 pad_wakeup)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
pad_ wakeup (in): Pad wakeup indicator. 0-enable, 1-disable, other
values leads to default disable condition.
Return value Success 0.
Error: invalid gpio pin (-51).

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

23.2.26ulk _proc_sys_pad_get_wakeup

Function Definition uint8 ulk _proc_sys_pad_get_wakeup (uint8 pin, uint8 *pad_wakeup)


Arguments pin (in):Pin number to indicate the GPIO pin. (0 to 191 except some
pins).
pad_ wakeup (out): Pointer to hold the current wakeup setting for the
pad.
Return value Success 0.
Error: invalid gpio pin (-51).

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

24.ULK_PROC_EEPROM_API’S

24.1Table of API

UART API (All functions)


Sl No Function_name Purpose
1 ulk_proc_eeprom_init To initialize the EEPROM

2 ulk_proc_eeprom_write_byte To write a byte of data on the EEPROM.

3 ulk_proc_eeprom_read_byte To read a byte of data from the EEPROM.

4 ulk_proc_eeprom_write_N_bytes To write N bytes of data sequentially on the


EEPROM.

5 ulk_eeprom_read_N_bytes To read N bytes of data sequentially from the


EEPROM.

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

Function Definition uint8 ulk_proc_eeprom_write_byte (uint8 devaddr,


uint16 regofset, uint8 value)
Arguments devaddr: The address of EEPROM device(slave address)
regoffset: The array address in the EEPROM(ofset address of the
EEPROM) where the data is to be written

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

value: The data to be written in the EEPROM


Return value Success: PROC_SUCCESS 0

24.2.3ulk_proc_eeprom_read_byte

Function Definition uint8 ulk_proc_eeprom_read_byte (uint8 devaddr,


uint16 regofset, uint8 *value)
Arguments devaddr: The address of EEPROM device(slave address)
regoffset: The array address in the EEPROM(ofset address of the
EEPROM) from where the data is to be read
*value: The address of the location where the data read from the
EEPROM is to be stored
Return value Success: PROC_SUCCESS 0
Error code: Invalid bus(bus_no!=3)
PROC_READ_BUS_UNAVAIL -37

24.2.4ulk_proc_eeprom_write_N_bytes

Function Definition uint8 ulk_epprom_write_N_bytes (uint8 devaddr,


uint16 regofset, uint16 count, uint8 *value)
Arguments devaddr: The address of EEPROM device(slave address)
regoffset: The array address in the EEPROM(ofset address of the
EEPROM) where the data is to be written
count: Number of bytes to be written
*value: The reference address of array from which data to be written on
the EEPROM is retrieved
Return value Success: PROC_SUCCESS 0
Error code : //EEPROM array size limit violation check
PROC_COUNT_UNAVAIL -39
/*Count value exceeding EEPROM array size(0x7FFF)*/
PROC_COUNT_VALUE_EXCEEDED -40
/*i2c invalid bus*/
PROC_I2C_BUS_UNAVAIL -38

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

24.2.5ulk_eeprom_read_N_bytes

Function Definition uint8 ulk_eeprom_read_N_bytes (uint8 devaddr,


uint16 regofset, uint16 count, uint8 *value)
Arguments bus_no :The I2C bus number allocated for EEPROM
devaddr: The address of EEPROM device(slave address)
regoffset: The array address in the EEPROM(ofset address of the
EEPROM) where the data is to be written
count: Number of bytes to be written
*value: The reference address of array where data read from the EEPROM
is to be stored
Return value Success: PROC_SUCCESS 0
Error code : //EEPROM array size limit violation check
PROC_COUNT_UNAVAIL -39
Error code: /*Count value exceeding EEPROM array size(0x7FFF)*/
PROC_COUNT_VALUE_EXCEEDED -40

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

25.ULK_PROC_AUDIO_API’S

25.1Table of API

Audio Driver API (All functions)


Sl No Function_name Purpose
1 ulk_proc_audio_init Initialize audio with default configurations.

2 ulk _proc_audio_get_dflt_config Get the default audio configuration settings.

3 ulk _proc_audio_set_dflt_config Set the default audio configuration settings.

4 ulk_proc_audio_get_config Get the current audio configuration settings.

5 ulk_proc_audio_set_config Set the current audio configuration settings.

6 ulk_proc_audio_get_mute_get_s Get the audio mute state.


tate
7 ulk_proc_audio_mute_enable Set the audio mute state.

8 ulk_proc_audio_codec_ Get the audio enable state.

9 Set the audio enable state.

10 ulk_proc_audio_loopback_isEna Get the audio loop back state.


bled
11 ulk_proc_audio_ loopback_enabl Set the audio loop back state.
e
12 ulk_proc_audio_get_mic_gain Get the audio input gain.

13 ulk_proc_audio_set_mic_gain Set the audio input gain.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

14 ulk_proc_audio_get_spkr_gain Get the audio output gain.

15 ulk_proc_audio_set_spkr_gain Set the audio output gain.

16 ulk_proc_audio_ Capture the input audio data in a bufer. Blocking


function.
17 ulk_proc_audio_ Output the audio data from a bufer. Blocking function.

18 ulk_proc_audio_record_nb Capture the input audio data in a bufer using sdma.


Non blocking function.
19 ulk_proc_audio_play_nb Output the audio data from a bufer using sdma. Non
blocking function.

25.2 Data Structures for API

typedef struct ulk_audio_config_tag


{
int32 SAMPLE_RATE
int32 BOOST_EFFECT
int32 MIC_L_GAIN
int32 MIC_R_GAIN
int32 SPK_L_GAIN
int32 SPK_R_GAIN
uint8 OUT_MODE
} ulk_audio_config_t;

typedef struct ulk_audio_pcm_tag


{
uint8 pcm_type;
uint8 *pcm_data_p;
uint32 pcm_size;
uint8 *call_back;
} ulk_audio_pcm_t;

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

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.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

call_back Pointer to the call back routine. (ignored in ulk_audio_in_pcm &


ulk_audio_out_pcm functions)

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

25.3 Functions

25.3.1ulk_proc_audio_init

Function Definition uint8 ulk_proc_audio_init (void)


Arguments Void
Return value Success: return 0.
Error: -141

25.3.2ulk _proc_audio_get_dflt_config

Function Definition uint8 ulk _proc_audio_get_dflt_config (ulk_audio_config_t *config_p)


Arguments config_p (out):Pointer to an audio configuration structure
(ulk_audio_config_t). This holds the default configuration values.
Return value Always return 0.

25.3.3ulk _proc_audio_set_dflt_config

Function Definition uint8 ulk _proc_audio_set_dflt_config (void)


Arguments void
Return value Always return 0.

25.3.4ulk_proc_audio_get_config

Function Definition uint8 ulk_proc_audio_get _config (ulk_audio_config_t *config_p)


Arguments config_p (out):Pointer to an audio configuration structure
(ulk_audio_config_t). This holds the current configuration values.
Return value Always return 0.

25.3.5ulk_proc_audio_set_config

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Function Definition uint8 ulk_proc_audio_set _config (ulk_audio_config_t *config_p)


Arguments config_p (in):Pointer to an audio configuration structure
(ulk_audio_config_t). This holds the current configuration values.
Return value Always return 0.

25.3.6ulk_proc_audio_get_mute

Function Definition uint8 ulk_proc_audio_get_mute (void)


Arguments Void
Return value Return the audio mute state.

25.3.7ulk_proc_audio_mute_enable

Function Definition uint8 ulk_proc_audio_mute_enable (uint8 mute)


Arguments mute (in):The audio mute state (0-disable 1-enable). Other than 0 will
enable the mute.
Return value Return the audio mute state.

25.3.8ulk_proc_audio_codec_isEnable

Function Definition uint8 ulk_proc_audio_codec_isEnable (void)


Arguments Void
Return value Return the audio enable state.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

25.3.9ulk_proc_audio_codec_enable

Function Definition uint8 ulk_proc_audio_codec_enable (uint8 enable)


Arguments enable (in):The audio enable state.
Return value Return the audio enable state.

25.3.10ulk_proc_audio_loopback_isEnable

Function Definition uint8 ulk_proc_audio_loopback_isEnable (void)


Arguments Void
Return value Return the audio loopback state.

25.3.11ulk_proc_audio_ loopback_enable

Function Definition uint8 ulk_proc_audio_loopback_enable (uint8 loopback)


Arguments enable (in):The audio loop back state (0-disable 1-enable). Other than 0
will enable the loopback.
Return value Return the audio loop back state.

25.3.12ulk_proc_audio_get_mic_gain

Function Definition uint8 ulk_proc_audio_get_mic_gain(int32 *l_gain, int32 *r_gain)


Arguments l_gain (out):The audio lef channel input gain.
r_gain (out): The audio right channel input gain.
Return value Always return 0.

25.3.13ulk_proc_audio_set_mic_gain

Function Definition uint8 ulk_proc_audio_set_mic_gain(int32 l_gain, int32 r_gain)


Arguments l_gain (in):The audio lef channel input gain (-6 to 24) in db. Other
values will set unpredictable setting.
r_gain (in): The audio right channel input gain (-6 to 24) in db. Other
values will set unpredictable setting.
Return value Always return 0.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

25.3.14ulk_proc_audio_get_spkr_gain

Function Definition uint8 ulk_proc_audio_get_spkr_gain(int32 *l_gain, int32 *r_gain)


Arguments l_gain (out):The audio lef channel output gain.
r_gain (out): The audio right channel output gain.
Return value Always return 0.

25.3.15ulk_proc_audio_set_spkr_gain

Function Definition uint8 ulk_proc_audio_set_spkr_gain( int32 l_gain, int32 r_gain)


Arguments l_gain (in):The audio lef channel output gain (-50 to 12) in db. Only in
step of 2db. Other values will set unpredictable setting.
r_gain (in): The audio right channel output gain (-50 to 12) in db. Only in
step of 2db. Other values will set unpredictable setting.
Return value Always return 0.

25.3.16ulk_proc_audio_record

Function Definition uint8 ulk_proc_audio_record (ulk_audio_pcm_t *pcm_in_p)


Arguments pcm_in_p (in):Pointer to an audio pcm structure (ulk_audio_pcm_t).
This holds the input pcm values.
Return value Always return 0.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

25.3.17ulk_proc_audio_play

Function Definition uint8 ulk_proc_audio_play (ulk_audio_pcm_t *pcm_out_p)


Arguments pcm_out_p (in):Pointer to an audio pcm structure (ulk_audio_pcm_t).
This holds the output pcm values.
Return value Always return 0.

25.3.18ulk_proc_audio_record_nb

Function Definition uint8 ulk_proc_audio_record_nb (ulk_audio_pcm_t *pcm_in_p)


Arguments pcm_in_p (in):Pointer to an audio pcm structure (ulk_audio_pcm_t).
This holds the input pcm values.
Return value Always return 0.

25.3.19ulk_proc_audio_play_nb

Function Definition uint8 ulk_proc_audio_play_nb (ulk_audio_pcm_t *pcm_out_p)


Arguments pcm_out_p (in):Pointer to an audio pcm structure (ulk_audio_pcm_t).
This holds the output pcm values.
Return value Always return 0.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

26.ULK_PROC_CHARACTER_LCD_API’S

26.1Table of API

Char proc LCD Driver API (All functions)


Sl No Function name Purpose
1 ulk_proc_clcd_init Initialize LCD with default configurations.

2 ulk_proc_clcd_display_on Switches on the display.

3 ulk_proc_clcd_display_off Switches of the display.

4 ulk_proc_clcd_cursor_home This sets the cursor at the home position.

5 ulk_proc_clcd_display_clear Clears the display.

6 ulk_proc_clcd_shift_left This lef shifs the display by ‘count’ number of times.

7 ulk_proc_clcd_shift_right This right shifs the display by ‘count’ number of times.

8 ulk_proc_clcd_row_swap Swaps the display rows.

9 ulk_proc_clcd_display_string Displays a string.

10 config_io_expander Initializes the I2C Cycles.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

11 ulk_set_for_write_cmd Sends the Command/Data to the Character LCD

26.2 Functions

26.2.1ulk_proc_clcd_init

Function Definition ulk_proc_clcd_init ( )


Arguments None
Return value None.

26.2.2ulk_proc_clcd_display_on

Function Definition ulk_proc_clcd_display_on ()


Arguments None
Return value None.

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

Function Definition ulk_proc_clcd_cursor_home ()


Arguments None.
Return value None.

26.2.5ulk_proc_clcd_display_clear

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Function Definition ulk_proc_clcd_display_clear ()


Arguments None.

Return value None.

26.2.6ulk_proc_clcd_shift_left

Function Definition ulk_proc_clcd_shif_lef (uint8 count)


Arguments count :The number of times to lef shif.
Return value None.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

26.2.7ulk_proc_clcd_shift_right

Function Definition ulk_proc_clcd_shif_lef (uint8 count)


Arguments count :The number of times to right shif.
Return value None.

26.2.8ulk_proc_clcd_row_swap

Function Definition ulk_proc_clcd_disp_row_swap (uint8 *bufer1,uint8 *bufer2)


Arguments buffer1:Bufer Containing the data to be swapped
buffer2: Bufer Containing the data to be swapped
Return Value None.

26.2.9ulk_proc_clcd_display_string

Function Definition ulk_proc_clcd_display_string (uint8 *buf)


Arguments buf :Bufer Containing the data to be Displayed on the character LCD.
Return value None.

26.2.10config_io_expander

Function Definition config_io_expander ()


Arguments None
Return value None.

26.2.11ulk_set_for_write_cmd

Function Definition ulk_set_for_write_cmd (uint8 cmd, uint8 value)


Arguments cmd :Command to be sent to the character LCD.
Value: Data Value to be sent to the character LCD.
Return value None.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

27.ULK_INTERRUPT_API’S

27.1Table of API

Interrupt API (All functions)


Function_name Purpose
ulk_swi_installer Can be Used as sofware interrupt

ulk_irq_installer Can be used as a normal interrupt

ulk_fiq_installer Fast interrupt Function

27.2Functions.

27.2.1ulk_swi_installer

Function Definition ulk_swi_installer()


Arguments int32 swi_number, uint64 call_back_address, uint32 *arg
Return value
None

27.2.2ulk_irq_installer

Function Definition ulk_irq_installer()


Arguments int32 irq_number, uint64 call_back_address, void *arg
Return value

None

27.2.3ulk_fiq_installer
Function Definition Ulk_fiq_installer
Arguments int32 fiq_number, uint64 call_back_address, uint32 *arg

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Return value None

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

28.ULK_FPGA_7SEGLED_API’S

28.1 Table of API

API Function
Sl No Function_name Purpose
1 ulk_gpmc_init Initialize gpmc with default configurations.

2 ulk_fpga_gpmc_config Configure the gpmc.

3 ulk_fpga_led_enable Initialize gpmc and ON 7 segment led.

4 ulk_fpga_led_disable This will of the 7 segment led.

5 ulk_fpga_led_write Display the value in 7 segment led.

28.2 Functions

28.2.1ulk_fpga_led_enable

Function Definition ulk_fpga_7seg_led_enable ()


Arguments None
Return value None.

28.2.2ulk_fpga_led_disable

Function Definition ulk_fpga_7seg_led_disable()


Arguments None
Return value None.

28.2.3ulk_fpga_led_write

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Function Definition ulk_fpga_7seg_led_write(unsigned short c)


Arguments Unsigned short c :This indicates which led’s value should display.
Return value None.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

29.ULK_FPGA_ADC_API’S

29.1 Table of API

Adc Driver API (All functions)


Sl No Function name Purpose
1 ulk_gpmc_init Initialize gpmc with default configurations.

2 ulk_gpmc_config Configure the gpmc.

3 ulk_fpga_adc_get_voltage Read the adc value.

29.2Functions

29.2.1 ulk_fpga_adc_get_voltage
Function definition ulk_fpga_adc_get_voltage()
Arguments val
Return value Float val.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

30.ULK_FPGA_DAC_API’S

30.1 Table of API

DAC Driver API (All functions)


Sl No Function_name Purpose
1 ulk_fpga_dac_set_voltage Initialize gpmc and write the value in dac.

2 ulk_gpmc_init Initialize gpmc with default configurations.

3 ulk_gpmc_config Configure the gpmc.

30.2 Functions

30.2.1ulk_fpga_dac_set_voltage

Function Definition ulk_fpga_dac_set_voltage(float voltage)


Arguments voltage
Return value None

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

31.ULK_FPGA_DIP SWITCH_API’S

31.1 Table of API

Audio Driver API (All functions)


Sl No Function_name Purpose
1 ulk_gpmc_init Initialize gpmc with default configurations.

2 ulk_gpmc_config Configure the gpmc.

3 ulk_fpga_dip_switch_read Initialize the gpmc and read the dip_switch register


value.

31.2 Functions

31.2.1 ulk_fpga_dip_switch_read

Function Definition ulk_fpga_dip_switch_read()


Arguments None.
Return value dipswitch.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

32.ULK_FPGA_DDR_API’S

32.1 Table of API

DDR Driver API (All functions)


Sl No Function_name Purpose
1 ulk_gpmc_init Initialize gpmc with default configurations.
2 ulk_gpmc_config Configure the gpmc.
3 ulk_fpga_ddr_write Write the values in TDR register.
4 ulk_fpga_read_ddr Read the values from RDR and SR register.

32.2Functions

32.2.1ulk_fpga_ddr_write

Function Definition ulk_fpga_ddr_write(uint32 addr, uint16 value)


Arguments Addr, Value
Return value Success: FPGA_SUCCESS 0
Error code: /*write Error. status reg not equal to zero */
FPGA_DDR_WRITE_ERROR -21

32.2.2ulk_fpga_read_ddr

Function Definition ulk_fpga_read_ddr(uint32 addr)


Arguments addr
Return value Success: FPGA_SUCCESS 0
Error code: /*Read Error. status reg not equal to zero*/
FPGA_DDR_READ_ERROR -22

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

33.ULK_FPGA_KEYPAD_API’S

33.1 Table of API

APIs supported for keypad with the OMAP processor


Sl No Function_name Purpose
1 ulk_fpga_keypad_init Initialize the keypad controller

2 ulk_checking_interrupt to check the interrupt from the keypad

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

Function Definition Ulk_fpga_keypad_init(void)


Arguments Void
Return value None

33.2.2ulk_checking_interrupt

Function Definition ulk_checking_interrupt (void)


Arguments void
Return value None

33.2.3ulk_fpga_keypad_getkey

Function Definition ulk_fpga_keypad_getkey (void)


Arguments Void
Return value returns the character pressed on the keypad

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

34.ULK_FPGA_LED_API’S

34.1 Table of API

LED Driver API (All functions)


Sl No Function_name Purpose
1 ulk_gpmc_init Initialize gpmc with default configurations.

2 ulk_gpmc_config Configure the gpmc.

3 ulk_fpga_led_init Initialize the gpmc and write the led value.

4 ulk_fpga_led_drive Glow the led according to the data byte.

34.2 Functions

34.2.1ulk_fpga_led_init

Function Definition ulk_fpga_led_init(uint8 data)


Arguments char c :Indicates value to be written in led.
Return value None.

34.2.2ulk_fpga_led_drive

Function Definition ulk_fpga_led_drive(uint8 led_no, uint8 led_on)


Arguments led_no (in):led no to be 0 to 8.
led_on (in): Power on/of condition, 0-of and 1-on..
Return value None.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

35.ULK_FPGA_PROGRAMMING _API’S

35.1 Table of API

Program Driver API (All functions)


Sl No Function name Purpose
1 ulk_ fpga_load_init Initialize TMS, TCK, TDI, TDO Gpio lines.
TMS, TCK, TDI set to input.
TDO set to output.
2 setPort This will set variables in debugging mode.

3 pulseClock Toggle TCK low and high.

4 readByte Read in a byte of data from the prom.

5 readTDOBit Read the TDO bit from port.

6 waitTime Program FPGA

7 fpga_prog_main Pulse TCK for specified microsec.

35.2Functions

35.2.1ulk_ fpga_load_init

Function Definition ulk_fpga_load_init( void)


Arguments Void
Return value None.

35.2.2setPort

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Function Definition setPort(short p,short val)


Arguments short p :To set the named JTAG signal(p).
short val: To the new value.
Return value None.

35.2.3pulseClock
Function Definition pulseClock()
Arguments None
Return value None.

35.2.4readByte

Function Definition readByte(unsigned char *data)


Arguments data :Need to be read.s
Return value To source the next byte from your XSVF file location

35.2.5readTDOBit

Function Definition readTDOBit()


Arguments None
Return value Current value of the JTAG TDO signal.

35.2.6waitTime

Function Definition waitTime(long microsec)


Arguments microsec :Number of microsec.
Return value None.

35.2.7fpga_prog_main

Function Definition fpga_prog_main (unsigned long addr_base)


Arguments addr_base:XSVF file address
Return value None

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

36.ULK_FPGA_UART _API’S

36.1 Table of API

Fpga Uart Driver API (All functions)

Sl No Function name Purpose


1 ulk_gpmc_init Initialize lcd gpmc.

2 ulk _gpmc_config Configure the gpmc.

3 FPGA_init Initialize the FPGA uart register

4 ulk_fpga_uart_reg_init Initialize gpmc and FPGA uart register.

5 ulk_fpga_uart_getc Used to get the value.

6 ulk_fpga_uart_putc Used to put the value.

7 calc_divisor Calculate the divisor value.

8 NS16550_puts_fpga Used to write the value in FPGA transmit reg.

9 NS16550_getc_fpga Used to read the value from FPGA receive


register.
10 config_io_expander Initialize the i2c cycles.

11 ulk__set_ for_write_cmd Sends the commands to display.

12 uint8 NS16500_set_parity_data_sb Will set the configuration for uart


(baudrate,number of stop bits, number of
databits, parity)

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

36.2Functions

36.2.1 ulk_gpmc_init

Function Definition ulk_gpmc_init( )


Arguments None
Return value None.

36.2.2ulk _gpmc_config

Function Definition ulk_gpmc_config(uint8 chip_sel)


Arguments chip_sel :Indicates which chp need to be configured.
Return value None.

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

Function Definition ulk_fpga_uart_init()


Arguments val
Return value Zero

36.2.5ulk_fpga_uart_getc

Function Definition ulk_uart_getc()


Arguments None
Return value NS16550_getc_fpga() value.

36.2.6ulk_fpga_uart_putc

Function Definition ulk_fpga_uart_putc(uint8 val)

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Arguments val :Value to be put.


Return value None

36.2.7calc_divisor

Function Definition calc_divisor()


Arguments None.
Return value Divisor value

36.2.8NS16550_puts_fpga

Function Definition NS16550_putc_fpga(char c)


Arguments Char c
Return value Zero

36.2.9NS16550_getc_fpga

Function Definition NS16550_getc_fpga()


Arguments None
Return value read char

36.2.10config_io_expander

Function Definition config_io_expander()


Arguments None
Return value None.

36.2.11ulk__set_ for_write_cmd

Function Definition ulk_set_for_write_cmd(uint8 cmd,uint8 value)


Arguments Cmd and value
Return value None.

36.2.12uint8 NS16500_set_parity_data_sb

Function Definitions uint8 NS16500_set_parity_data_sb(NS16550_t com_port, int


baudrate, uint8 parity, uint8 data, uint8 stopbit)

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Arguments Port number,int baudrate, uint8 parity, uint8 data, uint8 stopbit.
Return value None.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

37.ULK_FPGA_CHARACTER_LCD _API’S

37.1 Table of API

Char fpga lcd Driver API (All functions)


Sl No Function name Purpose
1 ulk_fpga_clcd_init Initialize lcd with default configurations.

2 ulk _fpga_clcd_display_on Switches on the display.

3 ulk _fpga_clcd_display_off Switches of the display.

4 ulk_fpga_clcd_cursor_home This sets the cursor at the home position.

5 ulk_fpga_clcd_display_clear Clears the display.

6 ulk_fpga_clcd_shift_left This lef shifs the display by ‘count’ number of


times.
7 ulk_fpga_clcd_shift_right This right shifs the display by ‘count’ number
of times.
8 ulk_fpga_clcd_row_swap Swaps the display rows.

9 ulk_fpga_clcd_display_string Displays a string.

10 ulk_fpga_gpmc_init Initializes the gpmc.

11 ulk_fpga_gpmc_config Configures the gpmc cycles.

12 ulk_fpga_gpmc_read_version Reads the version of FPGA.

13 ulk_fpga_clcd_hw_init Initializes in the character LCD.

14 ulk_fpga_clcd_poll_busy_flag Polls the busy flag of display.

37.2Functions

37.2.1ulk_fpga_clcd_init

Function Definition ulk_fpga_clcd_init( )

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Arguments None
Return value None.

37.2.2ulk _fpga_clcd_display_on

Function Definition ulk_fpga_clcd_display_on()


Arguments None
Return value None.

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

Function Definition ulk_fpga_clcd_cursor_home()


Arguments None
Return value None.

37.2.5ulk_fpga_clcd_display_clear

Function Definition ulk_fpga_clcd_display_clear()


Arguments None
Return value None.

37.2.6ulk_fpga_clcd_shift_left

Function Definition ulk_fpga_clcd_shif_lef(uint8 count)


Arguments count :The number of times to lef shif.
Return value None.

37.2.7ulk_fpga_clcd_shift_right

Function Definition ulk_fpga_clcd_shif_right(uint8 count)


Arguments count :The number of times to lef shif.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

Return value None.

37.2.8ulk_fpga_clcd_row_swap

Function Definition ulk_fpga_clcd_row_swap(uint8 *bufer1,uint8 *bufer2)


Arguments Buffer1:The bufer1 holds the first string
Buffer2:The bufer2 holds the second string
Return value None.

37.2.9ulk_fpga_clcd_display_string

Function Definition ulk_fpga_clcd_display_string(uint8 *buf)


Arguments buf:Holds the string to display on charecter LCD
Return value None

37.2.10ulk_fpga_gpmc_init

Function Definition ulk_fpga_gpmc_init()


Arguments None
Return value None.

37.2.11ulk_fpga_gpmc_config

Function Definition ulk_fpga_gpmc_config(uint8 chip_sel)


Arguments chip_sel :Indicates the number of cycles.
Return value None.

37.2.12ulk_fpga_gpmc_read_version

Function Definition ulk_fpga_gpmc_read_version(uint8 chip_sel)


Arguments chip _sel :Indicates the chip.
Return value None.

iWave Systems Technologies confidential


API Reference Document for EMDBY
R 2.0

37.2.13ulk_fpga_clcd_hw_init

Function Definition ulk_fpga_clcd_hw_init()


Arguments None
Return value None

37.2.14ulk_fpga_clcd_poll_busy_flag

Function Definition ulk_fpga_clcd_poll_busy_flag(void)


Arguments Void
Return value None

iWave Systems Technologies confidential

You might also like