Hardware Abstraction Layer for FreeRTOS
Collaboration diagram for Example driver:

Modules

 Driver View form Example driver
 

Data Structures

struct  example_ops
 
struct  example_generic
 

Functions

struct example * example_init (uint32_t index)
 
int32_t example_deinit (struct example *example)
 
int32_t example_funcname (struct example *example, uint32_t params)
 

Detailed Description

#include <example.h>

This is a implementation of a sample driver. This Driver interface has no function and is only for demonstration how to write a new driver interface and implement a driver.

Use a Instance of the driver:

#include <devs.h>
#include <example.h>
struct example *ex1;
struct example *ex2;
int32_t ret;
ex1 = example_init(EXAMPLE1); // EXAMPLE1 is defined by Hartware Interface
CONFIG_ASSERT(ex1 != NULL);
ex2 = example_init(EXAMPLE2);
CONFIG_ASSERT(ex1 != NULL);
//Call Funcname on device EXAMPLE1
ret = example_funcname(ex1, 0x42);
CONFIG_ASSERT(ret >= 0);
//Call Funcname on device EXAMPLE2
ret = example_funcname(ex2, 0x42);
CONFIG_ASSERT(ret >= 0);

Function Documentation

◆ example_deinit()

int32_t example_deinit ( struct example *  example)
inline

Deinit Driver Instants

Parameters
exampleInstant
Returns
0 on ok -1 on failure

◆ example_funcname()

int32_t example_funcname ( struct example *  example,
uint32_t  params 
)
inline

Sample Function for a driver

Parameters
exampleInstant
paramssample param
Returns
0 on ok -1 on error

◆ example_init()

struct example* example_init ( uint32_t  index)
inline

Init Function

Parameters
indexin examples Array
Returns
Example Instants or NULL
example_init
struct example * example_init(uint32_t index)
Definition: example.h:137
example_funcname
int32_t example_funcname(struct example *example, uint32_t params)
Definition: example.h:167
example.h