NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
|
1-Wire Interface Controller (ONEWIRE) HW driver header file. More...
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | neorv32_onewire_t |
Macros | |
ONEWIRE DCMD commands | |
#define | ONEWIRE_CMD_NOP (0b00) |
#define | ONEWIRE_CMD_BIT (0b01) |
#define | ONEWIRE_CMD_BYTE (0b10) |
#define | ONEWIRE_CMD_RESET (0b11) |
Functions | |
Prototypes | |
int | neorv32_onewire_available (void) |
int | neorv32_onewire_get_fifo_depth (void) |
int | neorv32_onewire_setup (uint32_t t_base) |
void | neorv32_onewire_enable (void) |
void | neorv32_onewire_disable (void) |
void | neorv32_onewire_flush (void) |
int | neorv32_onewire_sense (void) |
int | neorv32_onewire_busy (void) |
void | neorv32_onewire_reset (void) |
int | neorv32_onewire_reset_get_presence (void) |
void | neorv32_onewire_read_bit (void) |
uint8_t | neorv32_onewire_read_bit_get (void) |
void | neorv32_onewire_write_bit (uint8_t bit) |
void | neorv32_onewire_read_byte (void) |
uint8_t | neorv32_onewire_read_byte_get (void) |
void | neorv32_onewire_write_byte (uint8_t byte) |
int | neorv32_onewire_reset_blocking (void) |
uint8_t | neorv32_onewire_read_bit_blocking (void) |
void | neorv32_onewire_write_bit_blocking (uint8_t bit) |
uint8_t | neorv32_onewire_read_byte_blocking (void) |
void | neorv32_onewire_write_byte_blocking (uint8_t byte) |
IO Device: 1-Wire Interface Controller (ONEWIRE) | |
#define | NEORV32_ONEWIRE ((neorv32_onewire_t*) (NEORV32_ONEWIRE_BASE)) |
enum | NEORV32_ONEWIRE_CTRL_enum { ONEWIRE_CTRL_EN = 0 , ONEWIRE_CTRL_CLEAR = 1 , ONEWIRE_CTRL_PRSC0 = 2 , ONEWIRE_CTRL_PRSC1 = 3 , ONEWIRE_CTRL_CLKDIV0 = 4 , ONEWIRE_CTRL_CLKDIV7 = 11 , ONEWIRE_CTRL_FIFO_LSB = 15 , ONEWIRE_CTRL_FIFO_MSB = 18 , ONEWIRE_CTRL_TX_FULL = 28 , ONEWIRE_CTRL_RX_AVAIL = 29 , ONEWIRE_CTRL_SENSE = 30 , ONEWIRE_CTRL_BUSY = 31 } |
enum | NEORV32_ONEWIRE_DCMD_enum { ONEWIRE_DCMD_DATA_LSB = 0 , ONEWIRE_DCMD_DATA_MSB = 7 , ONEWIRE_DCMD_CMD_LO = 8 , ONEWIRE_DCMD_CMD_HI = 9 , ONEWIRE_DCMD_PRESENCE = 10 } |
1-Wire Interface Controller (ONEWIRE) HW driver header file.
#define NEORV32_ONEWIRE ((neorv32_onewire_t*) (NEORV32_ONEWIRE_BASE)) |
ONEWIRE module hardware access (neorv32_onewire_t)
ONEWIRE control register bits
ONEWIRE command and data register bits
int neorv32_onewire_available | ( | void | ) |
Check if ONEWIRE controller was synthesized.
int neorv32_onewire_busy | ( | void | ) |
Check if ONEWIRE module is busy.
void neorv32_onewire_disable | ( | void | ) |
Disable ONEWIRE controller.
void neorv32_onewire_enable | ( | void | ) |
Enable ONEWIRE controller.
void neorv32_onewire_flush | ( | void | ) |
Clear RTX FIFO.
int neorv32_onewire_get_fifo_depth | ( | void | ) |
Get ONEWIRE FIFO depth.
void neorv32_onewire_read_bit | ( | void | ) |
Initiate single-bit read.
uint8_t neorv32_onewire_read_bit_blocking | ( | void | ) |
Read single bit.
uint8_t neorv32_onewire_read_bit_get | ( | void | ) |
Get bit from previous single-bit read operation
void neorv32_onewire_read_byte | ( | void | ) |
Initiate read byte.
uint8_t neorv32_onewire_read_byte_blocking | ( | void | ) |
Read byte.
uint8_t neorv32_onewire_read_byte_get | ( | void | ) |
Get data from previous read byte operation.
void neorv32_onewire_reset | ( | void | ) |
Initiate reset pulse.
int neorv32_onewire_reset_blocking | ( | void | ) |
Generate reset pulse and check if any bus device is present.
int neorv32_onewire_reset_get_presence | ( | void | ) |
Get bus presence (after RESET).
int neorv32_onewire_sense | ( | void | ) |
Get current bus state.
int neorv32_onewire_setup | ( | uint32_t | t_base | ) |
Reset, configure and enable ONEWIRE interface controller.
[in] | t_base | Base tick time in ns. |
void neorv32_onewire_write_bit | ( | uint8_t | bit | ) |
Initiate single-bit write.
[in] | bit | Bit to be send. |
void neorv32_onewire_write_bit_blocking | ( | uint8_t | bit | ) |
Write single bit.
[in] | bit | Bit to be send. |
void neorv32_onewire_write_byte | ( | uint8_t | byte | ) |
Initiate write byte.
[in] | byte | Byte to be send. |
void neorv32_onewire_write_byte_blocking | ( | uint8_t | byte | ) |
Write byte.
[in] | byte | Byte to be send. |