mikroSDK Reference Manual
Microcontroller Peripherals

This section includes the mikroSDK API Reference for the Microcontroller Peripherals. More...

Modules

 Driver Layer
 This section includes the mikroSDK API Reference for the Driver.
 
 Hardware Abstraction Layer
 This section includes the mikroSDK API Reference for the Hardware Abstraction Layer.
 

Detailed Description

Important information in regards to CUSTOM One Wire timing.

Microcontroller Peripherals can be separated into two hierarchical layers - Driver and Hardware Abstraction Layer :

Device drivers are the software libraries that initialize the hardware and manage access to the hardware by higher layers of software. Device drivers are the architecture independent liaison between the hardware and the middleware, application layers and plugins.

Hardware Abstraction Layer is a layer of code that allows driver interaction with a hardware device at a general or abstract level rather than at a detailed hardware level. HAL can be called from either the DRV layer or directly from user code. In either case, the calling program can interact with the device in a more general way than it would otherwise.

Note
All mikroSDK.HAL and mikroSDK.Driver layers prototypes are architecture independent with the goal of having one unique code base supporting cross-platform devices.

WARNING

One Wire library is currently utilizing recommended "Maxim Integrated" One Wire timing sequences. If, by any chance, end-user needs custom timing sequences, "weak" functions shall be overwritten by end-user functions. Declaration of those functions can be found at following location: "\mikrosdk-2.0\hal\lib\include\hal_one_wire.h"

Declarations: void one_wire_timing_value_a( void ); void one_wire_timing_value_b( void ); void one_wire_timing_value_c( void ); void one_wire_timing_value_d( void ); void one_wire_timing_value_e( void ); void one_wire_timing_value_f( void ); void one_wire_timing_value_h( void ); void one_wire_timing_value_i( void ); void one_wire_timing_value_j( void );

Example

// Configure custom timing "a" sequence value (delay).
asm nop; // To give an example...
}

Implementation example:

// One Wire driver initialization configuration structure.
static one_wire_t one_wire_object_1;
// Configure default One Wire properties.
one_wire_configure_default( &one_wire_object_1 );
// Specify desired One Wire pin.
one_wire_object_1.data_pin = MIKROBUS_1_PWM;
// Allocate resources for One Wire protocol.
if ( ONE_WIRE_SUCCESS != one_wire_open( &one_wire_object_1 ) ) {
// Error handling strategy.
return ONE_WIRE_ERROR; // To give an example...
}
// Send reset sequence on One Wire bus.
// This funtion will now utilize custom timing
// defined at the top of this code.
one_wire_reset( &one_wire );

WARNING

One Wire library is currently utilizing recommended "Maxim Integrated" One Wire timing sequences. If, by any chance, end-user needs custom timing sequences, "weak" functions shall be overwritten by end-user functions. Declaration of those functions can be found at following location: "\mikrosdk-2.0\hal\lib\include\hal_one_wire.h"

Declarations: void one_wire_timing_value_a( void ); void one_wire_timing_value_b( void ); void one_wire_timing_value_c( void ); void one_wire_timing_value_d( void ); void one_wire_timing_value_e( void ); void one_wire_timing_value_f( void ); void one_wire_timing_value_h( void ); void one_wire_timing_value_i( void ); void one_wire_timing_value_j( void );

Example

// Configure custom timing "a" sequence value (delay).
asm nop; // To give an example...
}

Implementation example:

// One Wire driver initialization configuration structure.
static hal_one_wire_t hal_one_wire_object_1;
// Configure default One Wire properties.
hal_one_wire_configure_default( &hal_one_wire_object_1 );
// Specify desired One Wire pin.
hal_one_wire_object_1.data_pin = MIKROBUS_1_PWM;
// Allocate resources for One Wire protocol.
if ( ONE_WIRE_SUCCESS != hal_one_wire_open( &hal_one_wire_object_1 ) ) {
// Error handling strategy.
return ONE_WIRE_ERROR; // To give an example...
}
// Send reset sequence on One Wire bus.
// This funtion will now utilize custom timing
// defined at the top of this code.
hal_one_wire_reset( &hal_one_wire );
one_wire_open
err_t one_wire_open(one_wire_t *obj)
Opens One Wire Driver object.
one_wire_t::data_pin
pin_name_t data_pin
Definition: drv_one_wire.h:77
one_wire_timing_value_h
void one_wire_timing_value_h(void)
Configures device-specific timing "h" sequence value.
ONE_WIRE_SUCCESS
Definition: drv_one_wire.h:57
hal_one_wire_t::data_pin
hal_pin_name_t data_pin
Definition: hal_one_wire.h:68
hal_one_wire_reset
err_t hal_one_wire_reset(hal_one_wire_t *obj)
Resets One Wire bus.
one_wire_t
One Wire Driver initialization configuration structure.
Definition: drv_one_wire.h:76
one_wire_configure_default
void one_wire_configure_default(one_wire_t *obj)
Configures One Wire Driver configuration structure.
one_wire_reset
err_t one_wire_reset(one_wire_t *obj)
Resets One Wire bus.
hal_one_wire_configure_default
void hal_one_wire_configure_default(hal_one_wire_t *obj)
Configures One Wire HAL configuration structure.
ONE_WIRE_ERROR
Definition: drv_one_wire.h:58
hal_one_wire_t
One Wire HAL initialization configuration structure.
Definition: hal_one_wire.h:67
hal_one_wire_open
err_t hal_one_wire_open(hal_one_wire_t *obj)
Opens One Wire HAL object.