#include <asm/io.h>
#include <linux/delay.h>
#include <linux/moduleparam.h>
#include <linux/module.h>
#include "w1.h"
#include "w1_log.h"
Go to the source code of this file.
|
| module_param_named (delay_coef, w1_delay_parm, int, 0) |
|
| module_param_named (disable_irqs, w1_disable_irqs, int, 0) |
|
void | w1_write_8 (struct w1_master *dev, u8 byte) |
|
| EXPORT_SYMBOL_GPL (w1_write_8) |
|
u8 | w1_triplet (struct w1_master *dev, int bdir) |
|
u8 | w1_read_8 (struct w1_master *dev) |
|
| EXPORT_SYMBOL_GPL (w1_read_8) |
|
void | w1_write_block (struct w1_master *dev, const u8 *buf, int len) |
|
| EXPORT_SYMBOL_GPL (w1_write_block) |
|
void | w1_touch_block (struct w1_master *dev, u8 *buf, int len) |
|
| EXPORT_SYMBOL_GPL (w1_touch_block) |
|
u8 | w1_read_block (struct w1_master *dev, u8 *buf, int len) |
|
| EXPORT_SYMBOL_GPL (w1_read_block) |
|
int | w1_reset_bus (struct w1_master *dev) |
|
| EXPORT_SYMBOL_GPL (w1_reset_bus) |
|
u8 | w1_calc_crc8 (u8 *data, int len) |
|
| EXPORT_SYMBOL_GPL (w1_calc_crc8) |
|
void | w1_search_devices (struct w1_master *dev, u8 search_type, w1_slave_found_callback cb) |
|
int | w1_reset_select_slave (struct w1_slave *sl) |
|
| EXPORT_SYMBOL_GPL (w1_reset_select_slave) |
|
int | w1_reset_resume_command (struct w1_master *dev) |
|
| EXPORT_SYMBOL_GPL (w1_reset_resume_command) |
|
void | w1_next_pullup (struct w1_master *dev, int delay) |
|
| EXPORT_SYMBOL_GPL (w1_next_pullup) |
|
module_param_named |
( |
delay_coef |
, |
|
|
w1_delay_parm |
, |
|
|
int |
, |
|
|
0 |
|
|
) |
| |
module_param_named |
( |
disable_irqs |
, |
|
|
w1_disable_irqs |
, |
|
|
int |
, |
|
|
0 |
|
|
) |
| |
u8 w1_calc_crc8 |
( |
u8 * |
data, |
|
|
int |
len |
|
) |
| |
Put out a strong pull-up of the specified duration after the next write operation. Not all hardware supports strong pullups. Hardware that doesn't support strong pullups will sleep for the given time after the write operation without a strong pullup. This is a one shot request for the next write, specifying zero will clear a previous request. The w1 master lock must be held.
- Parameters
-
delay | time in milliseconds |
- Returns
- 0=success, anything else=error
Definition at line 448 of file w1_io.c.
Reads 8 bits.
- Parameters
-
- Returns
- the byte read
Definition at line 234 of file w1_io.c.
Reads a series of bytes.
- Parameters
-
dev | the master device |
buf | pointer to the buffer to fill |
len | the number of bytes to read |
- Returns
- the number of bytes read
Definition at line 304 of file w1_io.c.
Issues a reset bus sequence.
- Parameters
-
- Returns
- 0=Device present, 1=No device present or error
Definition at line 327 of file w1_io.c.
int w1_reset_resume_command |
( |
struct w1_master * |
dev | ) |
|
When the workflow with a slave amongst many requires several successive commands a reset between each, this function is similar to doing a reset then a match ROM for the last matched ROM. The advantage being that the matched ROM step is skipped in favor of the resume command. The slave must support the command of course.
If the bus has only one slave, traditionnaly the match ROM is skipped and a "SKIP ROM" is done for efficiency. On multi-slave busses, this doesn't work of course, but the resume command is the next best thing.
The w1 master lock must be held.
- Parameters
-
Definition at line 426 of file w1_io.c.
int w1_reset_select_slave |
( |
struct w1_slave * |
sl | ) |
|
Resets the bus and then selects the slave by sending either a skip rom or a rom match. The w1 master lock must be held.
- Parameters
-
- Returns
- 0=success, anything else=error
Definition at line 393 of file w1_io.c.
void w1_search_devices |
( |
struct w1_master * |
dev, |
|
|
u8 |
search_type, |
|
|
w1_slave_found_callback |
cb |
|
) |
| |
Touches a series of bytes.
- Parameters
-
dev | the master device |
buf | pointer to the data to write |
len | the number of bytes to write |
Definition at line 278 of file w1_io.c.
Does a triplet - used for searching ROM addresses. Return bits: bit 0 = id_bit bit 1 = comp_bit bit 2 = dir_taken If both bits 0 & 1 are set, the search should be restarted.
- Parameters
-
dev | the master device |
bdir | the bit to write if both id_bit and comp_bit are 0 |
- Returns
- bit fields - see above
Definition at line 199 of file w1_io.c.
Writes 8 bits.
- Parameters
-
dev | the master device |
byte | the byte to write |
Definition at line 144 of file w1_io.c.
Writes a series of bytes.
- Parameters
-
dev | the master device |
buf | pointer to the data to write |
len | the number of bytes to write |
Definition at line 256 of file w1_io.c.