#include <types.h>
#include <compiler.h>
#include <sdrv_common.h>
#include "../source/btm/sdrv_btm_hw.h"
Go to the source code of this file.
- Copyright
- Copyright (c) 2022 Semidrive Semiconductor. All rights reserved.
Revision History:
◆ btm_callback
| typedef void(* btm_callback) (void *arg) |
◆ btm_status_t
◆ btm_time_type_t
◆ btm_type_t
◆ sdrv_btm_cfg_t
◆ sdrv_btm_controller_module_t
◆ sdrv_btm_t
◆ btm_status
| Enumerator |
|---|
| BTM_STATUS_NULL | |
| BTM_STATUS_IDLE | |
| BTM_STATUS_BUSY | |
| BTM_STATUS_ERR | |
◆ btm_time_type
| Enumerator |
|---|
| BTM_TIME_MS | |
| BTM_TIME_US | |
| BTM_TIME_NS | |
◆ btm_type
| Enumerator |
|---|
| BTM_TYPE_ONESHOT | |
| BTM_TYPE_PERIOD | |
| BTM_TYPE_ERR | |
◆ sdrv_btm_clear_intr()
btm clear interupt status
- Parameters
-
| [in] | ctrl | btm ctrl instance |
- Returns
- succeed:0 fail:other
◆ sdrv_btm_continue()
btm continue
- Parameters
-
| [in] | ctrl | btm ctrl instance |
- Returns
- succeed:0 fail:other
◆ sdrv_btm_count_to_us()
| uint32_t sdrv_btm_count_to_us |
( |
sdrv_btm_t * |
ctrl, |
|
|
uint32_t |
cnt |
|
) |
| |
btm convert count to time in us
- Parameters
-
| [in] | ctrl | btm ctrl instance |
| [in] | cnt | btm count value |
- Returns
- time in microseconds.
◆ sdrv_btm_deinit()
btm deinit
Deinitial btm module instance.
- Parameters
-
| [in] | ctrl | btm ctrl instance |
- Returns
- succeed:0 fail:other
◆ sdrv_btm_force_reload()
btm force reset counter value
Btm force reset counter value to 0.
- Parameters
-
| [in] | ctrl | btm ctrl instance |
- Returns
- succeed:0 fail:other
◆ sdrv_btm_get_counter()
| uint32_t sdrv_btm_get_counter |
( |
sdrv_btm_t * |
ctrl | ) |
|
get btm counter value
- Parameters
-
| [in] | ctrl | btm ctrl instance |
- Returns
- btm counter value
◆ sdrv_btm_get_current_time()
| uint32_t sdrv_btm_get_current_time |
( |
sdrv_btm_t * |
ctrl | ) |
|
get btm Elapsed time (us)
- Parameters
-
| [in] | ctrl | btm ctrl instance |
- Returns
- btm Elapsed time (us)
◆ sdrv_btm_get_current_time_ex()
get btm Elapsed time (extend)
- Parameters
-
| [in] | ctrl | btm ctrl instance |
| [in] | time_type | time type |
- Returns
- btm Elapsed time (us)
◆ sdrv_btm_init()
btm init
Initial btm module instance.
- Parameters
-
| [in] | ctrl | btm ctrl instance |
| [in] | cfg | btm config |
- Returns
- succeed:0 fail:other
◆ sdrv_btm_is_overflowed()
is btm overflow.
Check btm overflow status.
- Parameters
-
| [in] | ctrl | btm ctrl instance |
- Returns
- true:overflow fail:not overflow
◆ sdrv_btm_pause()
btm pause
- Parameters
-
| [in] | ctrl | btm ctrl instance |
- Returns
- succeed:0 fail:other
◆ sdrv_btm_set_callback()
btm setup callback funciton
- Parameters
-
| [in] | ctrl | btm ctrl instance |
| [in] | callback | user callback function |
- Returns
- succeed:0 fail:other
◆ sdrv_btm_set_overflow()
set btm overflow value
- Parameters
-
| [in] | ctrl | btm ctrl instance |
| [in] | val | btm overflow value |
- Returns
- succeed:0 fail:other
◆ sdrv_btm_start()
btm start
In one-short mode, btm will auto stop while reaches overflow value. In continuous mode, btm will reset to 0 and restart once reaches overflow value.
- Parameters
-
| [in] | ctrl | btm ctrl instance |
| [in] | btm_type | timer type |
| [in] | time_type | timeout time unit |
| [in] | time_out | timeout |
- Returns
- succeed:0 fail:other
◆ sdrv_btm_stop()
btm stop
BTM stop to count.
- Parameters
-
| [in] | ctrl | btm ctrl instance |
- Returns
- succeed:0 fail:other