core/newlib/device.h File Reference

#include <reent.h>
#include <errno.h>

Go to the source code of this file.

Data Structures

struct  device_table_entry_t
 Describes what is found at driver level. More...
struct  device_table_array_t

Defines

#define SCEPTRE_STDIN   STDIN_FILENO
#define SCEPTRE_STDOUT   STDOUT_FILENO
#define SCEPTRE_STDERR   STDERR_FILENO
#define SCEPTRE_UART0   3
#define SCEPTRE_UART1   4
#define SCEPTRE_USB   5
#define SCEPTRE_I2C0   6
#define SCEPTRE_I2C1   7
#define SCEPTRE_SPI0   8
#define SCEPTRE_SPI1   9
#define SCEPTRE_THERMOMETER   10
#define SCEPTRE_ACCELEROMETER   11
#define SCEPTRE_BLUETOOTH   SCEPTRE_UART1
#define SCEPTRE_SDCARD   13
#define DEVICE_MAX_DESCRIPTORS   4
#define DEVICE(D)   (D<<8)
 Device number is high byte of FILE "pointer".
#define DEVICE_TYPE(D)   ((D>>8)&0xff)

Functions

int device_find (struct _reent *r, uint8_t device_type)
void device_init (void)
int device_find_by_name (const char *p_name, int *p_len)

Variables

device_table_array_t device_table_list [DEVICE_MAX_DESCRIPTORS]

Detailed Description

Low-level device driver interface.

Definition in file device.h.


Function Documentation

int device_find ( struct _reent *  p_reent,
uint8_t  device_type 
)

Search the device table for a device.

Parameters:
p_reent Pointer to a structure that will receive the return value.
device_type Device type to find.
Returns:
Index of device on success, -1 if not found.

Definition at line 33 of file device.c.

int device_find_by_name ( const char *  p_name,
int *  p_len 
)

Search the device table for a device by name.

Parameters:
p_name Pointer to the device name to find.
p_len Length of the device name.
Returns:
Index of device on success, -1 if not found.

Definition at line 86 of file device.c.

void device_init ( void   ) 

Initialize the device table.

Definition at line 58 of file device.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Defines

Generated by  doxygen 1.6.2