summaryrefslogtreecommitdiff
path: root/include/sbi/riscv_encoding.h
diff options
context:
space:
mode:
authorAdnan Rahman Chowdhury <adnan.chowdhury@sifive.com>2022-06-30 12:46:35 +0300
committerAnup Patel <anup@brainfault.org>2022-07-08 12:21:24 +0300
commit994c8cfb29d0b53bbcc774a728cad778aeece6ac (patch)
tree78169571385306969a1b507d6fa045879e3a30a2 /include/sbi/riscv_encoding.h
parent4489876e933d8ba0d8bc6c64bae71e295d45faac (diff)
downloadopensbi-994c8cfb29d0b53bbcc774a728cad778aeece6ac.tar.xz
lib: sbi_timer: Added a conditional wait function which can timeout
Motivation: Suppose a peripheral needs to be configured to transmit data. There is an SFR bit which indicates that the peripheral is ready to transmit. The firmware should check the bit and will only transmit data when the peripheral is ready. When the firmware starts polling the SFR, the peripheral could be busy transmitting/receiving other data so the firmware must wait till that completes. Assuming that there is no other way, the firmware shouldn't wait indefinitely. The function sbi_timer_waitms_until() will constantly check whether a certain condition is satisfied, or timeout occurs. It can be used for the cases when a timeout is required. Signed-off-by: Adnan Rahman Chowdhury <adnan.chowdhury@sifive.com> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'include/sbi/riscv_encoding.h')
0 files changed, 0 insertions, 0 deletions