HPM SDK
HPMicro Software Development Kit
OWR driver APIs

OWR driver APIs. More...

Data Structures

struct  owr_config_t
 OWR config struct. More...
 

Macros

#define OWR_RPP_TIMEOUT   (50000U)
 
#define OWR_WR_TIMEOUT   (50000U)
 

Enumerations

enum  owr_irq_event_t {
  owr_irq_receive_shift_register_full = OWR_IRQ_STS_RSRF_MASK , owr_irq_receive_buff_full = OWR_IRQ_STS_RBF_MASK , owr_irq_transmit_shift_register_empty = OWR_IRQ_STS_TEMT_MASK , owr_irq_transmit_buffer_empty = OWR_IRQ_STS_TBE_MASK ,
  owr_irq_presence_detected = OWR_IRQ_STS_PST_DET_MASK
}
 OWR IRQ Event Type. More...
 

Functions

hpm_stat_t owr_sw_reset (OWR_Type *ptr)
 Software Reset OWR. More...
 
hpm_stat_t owr_init (OWR_Type *ptr, owr_config_t *config)
 Init OWR. More...
 
hpm_stat_t owr_reset_and_presence_pulses (OWR_Type *ptr)
 Reset and presence pulses. More...
 
hpm_stat_t owr_get_presence_status (OWR_Type *ptr, uint32_t *status)
 Get presence status. More...
 
hpm_stat_t owr_release_bus (OWR_Type *ptr)
 Release bus. More...
 
hpm_stat_t owr_write_data (OWR_Type *ptr, uint8_t data)
 Write one byte data to OWR bus. More...
 
hpm_stat_t owr_read_data (OWR_Type *ptr, uint8_t *data)
 Read one byte data from OWR bus. More...
 
hpm_stat_t owr_clear_irq_status (OWR_Type *ptr, uint32_t mask)
 Clear irq status. More...
 
hpm_stat_t owr_enable_interrupts (OWR_Type *ptr, uint32_t mask)
 Enable interrupts. More...
 
hpm_stat_t owr_disable_interrupts (OWR_Type *ptr, uint32_t mask)
 Disable interrupts. More...
 
hpm_stat_t owr_get_irq_status (OWR_Type *ptr, uint32_t *status)
 Get irq status. More...
 

Detailed Description

OWR driver APIs.

Macro Definition Documentation

◆ OWR_RPP_TIMEOUT

◆ OWR_WR_TIMEOUT

Enumeration Type Documentation

◆ owr_irq_event_t

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_owr_drv.h>

OWR IRQ Event Type.

Enumerator
owr_irq_receive_shift_register_full 
owr_irq_receive_buff_full 
owr_irq_transmit_shift_register_empty 
owr_irq_transmit_buffer_empty 
owr_irq_presence_detected 

Function Documentation

◆ owr_clear_irq_status()

hpm_stat_t owr_clear_irq_status ( OWR_Type ptr,
uint32_t  mask 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_owr_drv.h>

Clear irq status.

Parameters
[in]ptrOWR base address
[in]maskmask of irq status to clear owr_irq_event_t
Returns
hpm_stat_t result of clearing irq status. hpm_stat_t

◆ owr_disable_interrupts()

hpm_stat_t owr_disable_interrupts ( OWR_Type ptr,
uint32_t  mask 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_owr_drv.h>

Disable interrupts.

Parameters
[in]ptrOWR base address
[in]maskmask of interrupts to disable owr_irq_event_t
Returns
hpm_stat_t result of disabling interrupts. hpm_stat_t

◆ owr_enable_interrupts()

hpm_stat_t owr_enable_interrupts ( OWR_Type ptr,
uint32_t  mask 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_owr_drv.h>

Enable interrupts.

Parameters
[in]ptrOWR base address
[in]maskmask of interrupts to enable owr_irq_event_t
Returns
hpm_stat_t result of enabling interrupts. hpm_stat_t

◆ owr_get_irq_status()

hpm_stat_t owr_get_irq_status ( OWR_Type ptr,
uint32_t *  status 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_owr_drv.h>

Get irq status.

Parameters
[in]ptrOWR base address
[out]statuspointer to status for storing irq status
Returns
hpm_stat_t result of getting irq status. hpm_stat_t

◆ owr_get_presence_status()

hpm_stat_t owr_get_presence_status ( OWR_Type ptr,
uint32_t *  status 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_owr_drv.h>

Get presence status.

Parameters
[in]ptrOWR base address
[out]statuspointer to status for storing presence status
Returns
hpm_stat_t result of getting presence status. hpm_stat_t

◆ owr_init()

hpm_stat_t owr_init ( OWR_Type ptr,
owr_config_t config 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_owr_drv.h>

Init OWR.

Parameters
[in]ptrOWR base address
[in]configpointer to config for initializing OWR. owr_config_t
Returns
hpm_stat_t result of init. hpm_stat_t

◆ owr_read_data()

hpm_stat_t owr_read_data ( OWR_Type ptr,
uint8_t *  data 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_owr_drv.h>

Read one byte data from OWR bus.

This function reads one byte of data from the OWR (One-Wire) bus. It first releases the bus by calling owr_release_bus to send 0xFF, then polls for the receive buffer full interrupt to ensure data has been received. The received data is read from the DATA register and the interrupt status is cleared.

Parameters
[in]ptrOWR base address
[out]dataPointer to buffer for storing the read data (must not be NULL)
Returns
hpm_stat_t Operation result

◆ owr_release_bus()

hpm_stat_t owr_release_bus ( OWR_Type ptr)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_owr_drv.h>

Release bus.

Parameters
[in]ptrOWR base address
Returns
hpm_stat_t result of releasing bus. hpm_stat_t

◆ owr_reset_and_presence_pulses()

hpm_stat_t owr_reset_and_presence_pulses ( OWR_Type ptr)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_owr_drv.h>

Reset and presence pulses.

Parameters
[in]ptrOWR base address
Returns
hpm_stat_t result of reset and presence pulses. hpm_stat_t

◆ owr_sw_reset()

hpm_stat_t owr_sw_reset ( OWR_Type ptr)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_owr_drv.h>

Software Reset OWR.

Parameters
[in]ptrOWR base address
Returns
hpm_stat_t result of software reset. hpm_stat_t

◆ owr_write_data()

hpm_stat_t owr_write_data ( OWR_Type ptr,
uint8_t  data 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_owr_drv.h>

Write one byte data to OWR bus.

This function writes one byte of data to the OWR (One-Wire) bus. It clears the transmit shift register empty interrupt status, writes the data to the DATA register, and then polls for the transmit shift register empty interrupt to ensure the data has been transmitted. A dummy read is performed after clearing the interrupt to ensure proper status clearing.

Parameters
[in]ptrOWR base address
[in]dataOne byte data to write to OWR bus (0x00-0xFF)
Returns
hpm_stat_t Operation result