Page 3
R
R
S
S
9
9
1
1
1
1
3
3
W
W
i
i
S
S
e
e
C
C
o
o
n
n
n
n
e
e
c
c
t
t
T
T
M
M
S
S
i
i
m
m
p
p
l
l
e
e
A
A
P
P
I
I Porting Guide
V
V
e
e
r
r
s
s
i
i
o
o
n
n
0
0
.
.
5
5
Table Of Contents
1 Overview .................................................................................................................................. 7
2 Hardware Abstraction Layer ..................................................................................................... 8
2.1 SPI interface handling API .............................................................................................................. 8
2.1.1 rsi_spi_transfer ................................................................................................................................................. 8
2.2 UART interface handling API ......................................................................................................... 10
2.2.1 2.6.1 rsi_uart_send ......................................................................................................................................... 11
2.3 Interrupt handling API .................................................................................................................. 15
2.3.1 rsi_hal_intr_config .......................................................................................................................................... 15
2.3.2 rsi_hal_intr_mask ............................................................................................................................................ 16
2.3.3 rsi_hal_intr_unmask ........................................................................................................................................ 17
2.3.4 rsi_hal_intr_clear ............................................................................................................................................ 18
2.3.5 rsi_hal_intr_pin_status ................................................................................................................................... 18
2.4 GPIO Port handling API ................................................................................................................ 19
2.4.1 rsi_hal_config_gpio ......................................................................................................................................... 19
2.4.2 rsi_hal_set_gpio .............................................................................................................................................. 21
2.4.3 rsi_hal_get_gpio .............................................................................................................................................. 22
2.4.4 rsi_hal_clear_gpio ........................................................................................................................................... 23
2.5 Random number generation API .................................................................................................. 24
2.5.1 rsi_get_random_number ................................................................................................................................ 24
2.6 Timer handling API ....................................................................................................................... 25
2.6.1 rsi_timer_start................................................................................................................................................. 25
2.6.2 rsi_timer_stop ................................................................................................................................................. 26
2.6.3 rsi_timer_read ................................................................................................................................................. 27
2.6.4 rsi_delay_ms ................................................................................................................................................... 27
2.6.5 rsi_delay_us .................................................................................................................................................... 28
3 OS Interface Layer .................................................................................................................. 29
3.1 rsi_critical_section_enrty ............................................................................................................. 29
3.2 rsi_critical_section_exit ................................................................................................................ 29
3.3 rsi_mutex_create ......................................................................................................................... 30
3.4 rsi_mutex_lock ............................................................................................................................ 31
3.5 rsi_mutex_unlock ........................................................................................................................ 31
3.6 rsi_mutex_destory ....................................................................................................................... 32
3.7 rsi_semaphore_create ................................................................................................................. 32
3.8 rsi_semaphore_destroy................................................................................................................ 33
3.9 rsi_semaphore_wait .................................................................................................................... 34
3.10 rsi_semaphore_post ................................................................................................................. 34
3.11 rsi_semaphore_reset ................................................................................................................ 35
3.12 rsi_task_create ......................................................................................................................... 36
3.13 rsi_task_destroy ....................................................................................................................... 36
4 Creation of a project for porting ............................................................................................. 38
4.1 Interfaces supported .................................................................................................................... 38
4.2 Supported modes......................................................................................................................... 38
4.3 Directory structure ....................................................................................................................... 38
4.4 Steps to create a project .............................................................................................................. 39
4.4.1 WLAN only project .......................................................................................................................................... 39