InPlay API
Platform globally initialization, suspend, and resume functions

HAL_GLOBAL. More...

Functions

void hal_global_pre_init (void)
 Globally initialize system (such as clock...) before OS starting. More...
 
void hal_global_post_init (void)
 Globally initialize system (such as debug, RTC...) after OS starting. More...
 
void hal_global_suspend (void)
 Globally save system (such as system tick...) registers before deep sleep. More...
 
void hal_global_resume (void)
 Globally resume system (such as system tick...) registers after wake up. More...
 
void hal_global_cpu_reset (void)
 Reset the CPU (cold boot) More...
 
void hal_global_sys_reset (void)
 Reset the system (cold boot) More...
 
void hal_global_close_sys_uart (void)
 Close debug uart. More...
 
int hal_bod_enable (int bod_thrd_mv, void *arg, void(*callback)(void *arg))
 Enable BOD , set a bod_thrd_mv will return a closest value. Detail please see: <<IN602F0 reference manual.docx>> in chapter 17: Brown-out Detector the hardware accuracy about 25mv. More...
 
void hal_bod_disable (void)
 Disable BOD. More...
 
int RTC_timer_start (void)
 Start the RTC timer. More...
 
void RTC_timer_stop (void)
 Stop the RTC timer. More...
 
uint64_t RTC_timer_get_tick (void)
 Get the RTC timer ticks (64 bits) More...
 
uint64_t RTC_timer_get_time (void)
 Get the RTC timer in micro second. More...
 
uint64_t RTC_timer_diff (uint64_t s_tick, uint64_t e_tick)
 Calculate tick difference convert to time. More...
 
uint32_t RTC_timer_get_tick_low (void)
 Get the RTC timer ticks low part. More...
 
uint32_t RTC_timer_diff_low (uint32_t s_tick, uint32_t e_tick)
 Calculate tick difference convert to time. More...
 
void hal_ble_isr_register (void *arg, void(*callback)(void *))
 Register BLE interupt. More...
 
void hal_ble_isr_deregister (void)
 Deregister BLE interupt. More...
 
void hal_glb_isr_register (int irq_id, int prio, void *arg, void(*callback)(void *))
 Globally manage shared interupts. More...
 
void hal_glb_isr_deregister (int irq_id)
 Deregister global shared interupts. More...
 
int hal_swi_int_prio (int prio)
 Set Software interrupt priority. There are max 4 SWI. More...
 
int hal_swi_register (void *arg, void(*callback)(void *))
 Register a Software interrupt index. There are max 4 SWI. More...
 
void hal_swi_deregister (int index)
 Deregister a Software interrupt index. More...
 
void hal_swi_set (int index)
 Trigger a Software interrupt. More...
 
void hal_osc_xo_isr_register (int irq_id, int prio, void *arg, void(*callback)(void *))
 Register Osc and XO shared interupts. More...
 
void hal_osc_xo_isr_deregister (int irq_id)
 Deregister an Osc and XO shared interupt. More...
 
void hal_nmi_register (int irq_id, void *arg, void(*callback)(void *))
 Register a NMI interrupt. More...
 
void hal_nmi_deregister (int irq_id)
 Deregister a NMI interrupt. More...
 
void * hal_sys_uart_hdl (void)
 Enable/disable external PA. More...
 
void RAM_PM delay_us (uint32_t us)
 Delay in tight loop. More...
 

Detailed Description

HAL_GLOBAL.

Function Documentation

◆ delay_us()

void RAM_PM delay_us ( uint32_t  us)

Delay in tight loop.

Parameters
[in]usdelay time in microsecond unit
Returns
NONE

◆ hal_ble_isr_deregister()

void hal_ble_isr_deregister ( void  )

Deregister BLE interupt.

Returns
NONE

◆ hal_ble_isr_register()

void hal_ble_isr_register ( void *  arg,
void(*)(void *)  callback 
)

Register BLE interupt.

Parameters
[in]argCall back argument from user
[in]callbackISR call back
Returns
NONE

◆ hal_bod_disable()

void hal_bod_disable ( void  )

Disable BOD.

Parameters
[in]bod_idBOD id select,
See also
enum bod_num_t for possible value
Returns
No return

◆ hal_bod_enable()

int hal_bod_enable ( int  bod_thrd_mv,
void *  arg,
void(*)(void *arg)  callback 
)

Enable BOD , set a bod_thrd_mv will return a closest value. Detail please see: <<IN602F0 reference manual.docx>> in chapter 17: Brown-out Detector the hardware accuracy about 25mv.

Parameters
[in]bod_thrd_mvBOD threshold, rang: 1600 to 1800 unit:mv
[in]argPointer to the user's provided parameter for the BOD ISR call back
[in]callbackBOD ISR call back: if the Vbat smaller than the bod_thrd_mv arg: The provided pointer,
Returns
int 0: fail; or the voltage of bod threshold.
See also
enum bod_thrd

◆ hal_glb_isr_deregister()

void hal_glb_isr_deregister ( int  irq_id)

Deregister global shared interupts.

Parameters
[in]irq_idThe ID of interrupt source,
See also
enum glb_irq_id
Returns
NONE

◆ hal_glb_isr_register()

void hal_glb_isr_register ( int  irq_id,
int  prio,
void *  arg,
void(*)(void *)  callback 
)

Globally manage shared interupts.

Parameters
[in]irq_idThe ID of interrupt source,
See also
enum glb_irq_id
Parameters
[in]prioInterrupt priority,
See also
in_irq.h
Parameters
[in]argCall back argument from user
[in]callbackISR call back
Returns
NONE

◆ hal_global_close_sys_uart()

void hal_global_close_sys_uart ( void  )

Close debug uart.

Returns
No return

◆ hal_global_cpu_reset()

void hal_global_cpu_reset ( void  )

Reset the CPU (cold boot)

Returns
No return

◆ hal_global_post_init()

void hal_global_post_init ( void  )

Globally initialize system (such as debug, RTC...) after OS starting.

Returns
No return

◆ hal_global_pre_init()

void hal_global_pre_init ( void  )

Globally initialize system (such as clock...) before OS starting.

Returns
No return

◆ hal_global_resume()

void hal_global_resume ( void  )

Globally resume system (such as system tick...) registers after wake up.

Returns
No return

◆ hal_global_suspend()

void hal_global_suspend ( void  )

Globally save system (such as system tick...) registers before deep sleep.

Returns
No return

◆ hal_global_sys_reset()

void hal_global_sys_reset ( void  )

Reset the system (cold boot)

Returns
No return

◆ hal_nmi_deregister()

void hal_nmi_deregister ( int  irq_id)

Deregister a NMI interrupt.

Parameters
[in]irq_idThe ID of interrupt source,
See also
enum nmi_irq_id
Returns
NONE

◆ hal_nmi_register()

void hal_nmi_register ( int  irq_id,
void *  arg,
void(*)(void *)  callback 
)

Register a NMI interrupt.

Parameters
[in]irq_idThe ID of interrupt source,
See also
enum nmi_irq_id
Parameters
[in]argCall back argument from user
[in]callbackISR call back
Returns
NONE

◆ hal_osc_xo_isr_deregister()

void hal_osc_xo_isr_deregister ( int  irq_id)

Deregister an Osc and XO shared interupt.

Parameters
[in]irq_idThe ID of interrupt source,
See also
enum osc_xo_irq_id
Returns
NONE

◆ hal_osc_xo_isr_register()

void hal_osc_xo_isr_register ( int  irq_id,
int  prio,
void *  arg,
void(*)(void *)  callback 
)

Register Osc and XO shared interupts.

Parameters
[in]irq_idThe ID of interrupt source,
See also
enum osc_xo_irq_id
Parameters
[in]prioInterrupt priority,
See also
in_irq.h
Parameters
[in]argCall back argument from user
[in]callbackISR call back
Returns
NONE

◆ hal_swi_deregister()

void hal_swi_deregister ( int  index)

Deregister a Software interrupt index.

Parameters
[in]indexIndex from SWI register API calls
Returns
NONE

◆ hal_swi_int_prio()

int hal_swi_int_prio ( int  prio)

Set Software interrupt priority. There are max 4 SWI.

Parameters
[in]prioInterrupt priority,
See also
in_irq.h.
Returns
0 if success, otherwise fail.

◆ hal_swi_register()

int hal_swi_register ( void *  arg,
void(*)(void *)  callback 
)

Register a Software interrupt index. There are max 4 SWI.

Parameters
[in]argCall back argument from user
[in]callbackSWI ISR call back
Returns
SWI INDEX >= 0, otherwise FAIL

◆ hal_swi_set()

void hal_swi_set ( int  index)

Trigger a Software interrupt.

Parameters
[in]indexIndex from SWI register API calls
Returns
NONE

◆ hal_sys_uart_hdl()

void* hal_sys_uart_hdl ( void  )

Enable/disable external PA.

Parameters
[in]bias_portPA bias pin port
[in]bias_pinPA bias pin pin
[in]en_portPA EN pin port. When use one pin mode, set en_port same as bias_port
[in]en_pinPA EN pin pin. When use one pin mode, set en_pin same as biad_pin
Returns
NONE

◆ RTC_timer_diff()

uint64_t RTC_timer_diff ( uint64_t  s_tick,
uint64_t  e_tick 
)

Calculate tick difference convert to time.

Parameters
[in]s_tickStart ticks
[in]e_tickEnd ticks
Returns
64 bits time in micro second

◆ RTC_timer_diff_low()

uint32_t RTC_timer_diff_low ( uint32_t  s_tick,
uint32_t  e_tick 
)

Calculate tick difference convert to time.

Parameters
[in]s_tickStart ticks
[in]e_tickEnd ticks
Returns
32 bits time in micro second

◆ RTC_timer_get_tick()

uint64_t RTC_timer_get_tick ( void  )

Get the RTC timer ticks (64 bits)

Returns
64 bits timer tick

◆ RTC_timer_get_tick_low()

uint32_t RTC_timer_get_tick_low ( void  )

Get the RTC timer ticks low part.

Returns
32 bits timer tick

◆ RTC_timer_get_time()

uint64_t RTC_timer_get_time ( void  )

Get the RTC timer in micro second.

Returns
64 bits time in micro second

◆ RTC_timer_start()

int RTC_timer_start ( void  )

Start the RTC timer.

Returns
0: Failed, 1: Success

◆ RTC_timer_stop()

void RTC_timer_stop ( void  )

Stop the RTC timer.

Returns
No return