NEORV32 - Software Framework Documentation
Loading...
Searching...
No Matches
neorv32_onewire.h
Go to the documentation of this file.
1// ================================================================================ //
2// The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32 //
3// Copyright (c) NEORV32 contributors. //
4// Copyright (c) 2020 - 2024 Stephan Nolting. All rights reserved. //
5// Licensed under the BSD-3-Clause license, see LICENSE for details. //
6// SPDX-License-Identifier: BSD-3-Clause //
7// ================================================================================ //
8
18#ifndef neorv32_onewire_h
19#define neorv32_onewire_h
20
21/**********************************************************************/
26typedef volatile struct __attribute__((packed,aligned(4))) {
27 uint32_t CTRL;
28 uint32_t DATA;
30
32#define NEORV32_ONEWIRE ((neorv32_onewire_t*) (NEORV32_ONEWIRE_BASE))
33
55
64/**********************************************************************/
69int neorv32_onewire_setup(uint32_t t_base);
70void neorv32_onewire_enable(void);
72int neorv32_onewire_sense(void);
73
74int neorv32_onewire_busy(void);
75void neorv32_onewire_reset(void);
79void neorv32_onewire_write_bit(uint8_t bit);
82void neorv32_onewire_write_byte(uint8_t byte);
83
92#endif // neorv32_onewire_h
int neorv32_onewire_busy(void)
Definition neorv32_onewire.c:131
void neorv32_onewire_read_byte(void)
Definition neorv32_onewire.c:235
int neorv32_onewire_sense(void)
Definition neorv32_onewire.c:108
int neorv32_onewire_setup(uint32_t t_base)
Definition neorv32_onewire.c:44
void neorv32_onewire_write_byte(uint8_t byte)
Definition neorv32_onewire.c:266
void neorv32_onewire_reset(void)
Definition neorv32_onewire.c:148
int neorv32_onewire_reset_get_presence(void)
Definition neorv32_onewire.c:162
void neorv32_onewire_write_bit(uint8_t bit)
Definition neorv32_onewire.c:215
uint8_t neorv32_onewire_read_byte_get(void)
Definition neorv32_onewire.c:252
void neorv32_onewire_write_bit_blocking(uint8_t bit)
Definition neorv32_onewire.c:328
uint8_t neorv32_onewire_read_byte_blocking(void)
Definition neorv32_onewire.c:345
void neorv32_onewire_disable(void)
Definition neorv32_onewire.c:97
int neorv32_onewire_available(void)
Definition neorv32_onewire.c:27
uint8_t neorv32_onewire_read_bit_get(void)
Definition neorv32_onewire.c:196
void neorv32_onewire_read_bit(void)
Definition neorv32_onewire.c:179
void neorv32_onewire_write_byte_blocking(uint8_t byte)
Definition neorv32_onewire.c:365
uint8_t neorv32_onewire_read_bit_blocking(void)
Definition neorv32_onewire.c:308
NEORV32_ONEWIRE_CTRL_enum
Definition neorv32_onewire.h:35
@ ONEWIRE_CTRL_CLKDIV6
Definition neorv32_onewire.h:45
@ ONEWIRE_CTRL_CLKDIV4
Definition neorv32_onewire.h:43
@ ONEWIRE_CTRL_CLKDIV5
Definition neorv32_onewire.h:44
@ ONEWIRE_CTRL_TRIG_BIT
Definition neorv32_onewire.h:48
@ ONEWIRE_CTRL_CLKDIV7
Definition neorv32_onewire.h:46
@ ONEWIRE_CTRL_PRESENCE
Definition neorv32_onewire.h:52
@ ONEWIRE_CTRL_TRIG_RST
Definition neorv32_onewire.h:47
@ ONEWIRE_CTRL_BUSY
Definition neorv32_onewire.h:53
@ ONEWIRE_CTRL_CLKDIV3
Definition neorv32_onewire.h:42
@ ONEWIRE_CTRL_EN
Definition neorv32_onewire.h:36
@ ONEWIRE_CTRL_PRSC0
Definition neorv32_onewire.h:37
@ ONEWIRE_CTRL_CLKDIV0
Definition neorv32_onewire.h:39
@ ONEWIRE_CTRL_TRIG_BYTE
Definition neorv32_onewire.h:49
@ ONEWIRE_CTRL_CLKDIV2
Definition neorv32_onewire.h:41
@ ONEWIRE_CTRL_PRSC1
Definition neorv32_onewire.h:38
@ ONEWIRE_CTRL_SENSE
Definition neorv32_onewire.h:51
@ ONEWIRE_CTRL_CLKDIV1
Definition neorv32_onewire.h:40
void neorv32_onewire_enable(void)
Definition neorv32_onewire.c:88
NEORV32_ONEWIRE_DATA_enum
Definition neorv32_onewire.h:57
@ ONEWIRE_DATA_LSB
Definition neorv32_onewire.h:58
@ ONEWIRE_DATA_MSB
Definition neorv32_onewire.h:59
int neorv32_onewire_reset_blocking(void)
Definition neorv32_onewire.c:288
Definition neorv32_onewire.h:26
uint32_t DATA
Definition neorv32_onewire.h:28
uint32_t CTRL
Definition neorv32_onewire.h:27