Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
w1_io.c File Reference
#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.

Functions

 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)
 

Function Documentation

EXPORT_SYMBOL_GPL ( w1_write_8  )
EXPORT_SYMBOL_GPL ( w1_read_8  )
EXPORT_SYMBOL_GPL ( w1_write_block  )
EXPORT_SYMBOL_GPL ( w1_touch_block  )
EXPORT_SYMBOL_GPL ( w1_read_block  )
EXPORT_SYMBOL_GPL ( w1_reset_bus  )
EXPORT_SYMBOL_GPL ( w1_calc_crc8  )
EXPORT_SYMBOL_GPL ( w1_reset_select_slave  )
EXPORT_SYMBOL_GPL ( w1_reset_resume_command  )
EXPORT_SYMBOL_GPL ( w1_next_pullup  )
module_param_named ( delay_coef  ,
w1_delay_parm  ,
int  ,
 
)
module_param_named ( disable_irqs  ,
w1_disable_irqs  ,
int  ,
 
)
u8 w1_calc_crc8 ( u8 data,
int  len 
)

Definition at line 364 of file w1_io.c.

void w1_next_pullup ( struct w1_master *  dev,
int  delay 
)

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
delaytime in milliseconds
Returns
0=success, anything else=error

Definition at line 448 of file w1_io.c.

u8 w1_read_8 ( struct w1_master *  dev)

Reads 8 bits.

Parameters
devthe master device
Returns
the byte read

Definition at line 234 of file w1_io.c.

u8 w1_read_block ( struct w1_master *  dev,
u8 buf,
int  len 
)

Reads a series of bytes.

Parameters
devthe master device
bufpointer to the buffer to fill
lenthe number of bytes to read
Returns
the number of bytes read

Definition at line 304 of file w1_io.c.

int w1_reset_bus ( struct w1_master *  dev)

Issues a reset bus sequence.

Parameters
devThe bus master pointer
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
devthe master device

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
slthe slave to select
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 
)

Definition at line 375 of file w1_io.c.

void w1_touch_block ( struct w1_master *  dev,
u8 buf,
int  len 
)

Touches a series of bytes.

Parameters
devthe master device
bufpointer to the data to write
lenthe number of bytes to write

Definition at line 278 of file w1_io.c.

u8 w1_triplet ( struct w1_master *  dev,
int  bdir 
)

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
devthe master device
bdirthe 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.

void w1_write_8 ( struct w1_master *  dev,
u8  byte 
)

Writes 8 bits.

Parameters
devthe master device
bytethe byte to write

Definition at line 144 of file w1_io.c.

void w1_write_block ( struct w1_master *  dev,
const u8 buf,
int  len 
)

Writes a series of bytes.

Parameters
devthe master device
bufpointer to the data to write
lenthe number of bytes to write

Definition at line 256 of file w1_io.c.