HPM SDK
HPMicro Software Development Kit
hpm_owr_drv.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 #ifndef HPM_OWR_DRV_H
8 #define HPM_OWR_DRV_H
9 
10 #include "hpm_common.h"
11 #include "hpm_owr_regs.h"
12 
19 /*---------------------------------------------------------------------
20  * Macro Constant Declarations
21  *-------------------------------------------------------------------*/
22 #ifndef OWR_RPP_TIMEOUT
23 #define OWR_RPP_TIMEOUT (50000U)
24 #endif
25 
26 #ifndef OWR_WR_TIMEOUT
27 #define OWR_WR_TIMEOUT (50000U)
28 #endif
29 
30 /*---------------------------------------------------------------------
31  * Typedef Enum Declarations
32  *-------------------------------------------------------------------*/
33 
35 typedef enum {
42 
44 typedef struct {
46 } owr_config_t;
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
59 
68 
76 
84 hpm_stat_t owr_get_presence_status(OWR_Type *ptr, uint32_t *status);
85 
93 
109 hpm_stat_t owr_write_data(OWR_Type *ptr, uint8_t data);
110 
127 hpm_stat_t owr_read_data(OWR_Type *ptr, uint8_t *data);
128 
136 hpm_stat_t owr_clear_irq_status(OWR_Type *ptr, uint32_t mask);
137 
145 hpm_stat_t owr_enable_interrupts(OWR_Type *ptr, uint32_t mask);
146 
154 hpm_stat_t owr_disable_interrupts(OWR_Type *ptr, uint32_t mask);
155 
163 hpm_stat_t owr_get_irq_status(OWR_Type *ptr, uint32_t *status);
164 
165 #ifdef __cplusplus
166 }
167 #endif /* __cplusplus */
168 
173 #endif /* HPM_OWR_DRV_H */
174 
uint32_t hpm_stat_t
Definition: hpm_common.h:135
hpm_stat_t owr_enable_interrupts(OWR_Type *ptr, uint32_t mask)
Enable interrupts.
Definition: hpm_owr_drv.c:147
owr_irq_event_t
OWR IRQ Event Type.
Definition: hpm_owr_drv.h:35
hpm_stat_t owr_get_presence_status(OWR_Type *ptr, uint32_t *status)
Get presence status.
Definition: hpm_owr_drv.c:52
hpm_stat_t owr_clear_irq_status(OWR_Type *ptr, uint32_t mask)
Clear irq status.
Definition: hpm_owr_drv.c:140
hpm_stat_t owr_read_data(OWR_Type *ptr, uint8_t *data)
Read one byte data from OWR bus.
Definition: hpm_owr_drv.c:113
hpm_stat_t owr_get_irq_status(OWR_Type *ptr, uint32_t *status)
Get irq status.
Definition: hpm_owr_drv.c:161
hpm_stat_t owr_reset_and_presence_pulses(OWR_Type *ptr)
Reset and presence pulses.
Definition: hpm_owr_drv.c:35
hpm_stat_t owr_init(OWR_Type *ptr, owr_config_t *config)
Init OWR.
Definition: hpm_owr_drv.c:18
hpm_stat_t owr_disable_interrupts(OWR_Type *ptr, uint32_t mask)
Disable interrupts.
Definition: hpm_owr_drv.c:154
hpm_stat_t owr_write_data(OWR_Type *ptr, uint8_t data)
Write one byte data to OWR bus.
Definition: hpm_owr_drv.c:88
hpm_stat_t owr_release_bus(OWR_Type *ptr)
Release bus.
Definition: hpm_owr_drv.c:63
hpm_stat_t owr_sw_reset(OWR_Type *ptr)
Software Reset OWR.
Definition: hpm_owr_drv.c:10
@ owr_irq_transmit_shift_register_empty
Definition: hpm_owr_drv.h:38
@ owr_irq_receive_shift_register_full
Definition: hpm_owr_drv.h:36
@ owr_irq_presence_detected
Definition: hpm_owr_drv.h:40
@ owr_irq_receive_buff_full
Definition: hpm_owr_drv.h:37
@ owr_irq_transmit_buffer_empty
Definition: hpm_owr_drv.h:39
#define OWR_IRQ_STS_RBF_MASK
Definition: hpm_owr_regs.h:170
#define OWR_IRQ_STS_RSRF_MASK
Definition: hpm_owr_regs.h:158
#define OWR_IRQ_STS_TEMT_MASK
Definition: hpm_owr_regs.h:180
#define OWR_IRQ_STS_PST_DET_MASK
Definition: hpm_owr_regs.h:200
#define OWR_IRQ_STS_TBE_MASK
Definition: hpm_owr_regs.h:190
Definition: hpm_owr_regs.h:12
OWR config struct.
Definition: hpm_owr_drv.h:44
uint32_t clock_source_frequency
Definition: hpm_owr_drv.h:45