Vijayaraghavan Narayanan / VLX6180X_API
Embed: (wiki syntax)

« Back to documentation index

platform.h File Reference

platform.h File Reference

All platform specific declarations to be used by the High Level API are defined here. More...

Go to the source code of this file.

Typedefs

typedef unsigned char bool_t
 Typedef defining 8 bit unsigned char type.
typedef unsigned long long uint64_t
 Typedef defining 64 bit unsigned long type.
typedef long long long64_t
 Typedef defining 64 bit long type.
typedef unsigned int uint32_t
 Typedef defining 32 bit unsigned int type.
typedef int int32_t
 Typedef defining 32 bit int type.
typedef unsigned short uint16_t
 Typedef defining 16 bit unsigned short type.
typedef short int16_t
 Typedef defining 16 bit short type.
typedef unsigned char uint8_t
 Typedef defining 8 bit unsigned char type.
typedef signed char int8_t
 Typedef defining 8 bit char type.
typedef double double_t
 Typedef defining 64 bit double type.
typedef float float_t
 Typedef defining 32 bit float type.

Functions

void debug1_print (char *pBuffer)
 Method to print a given string to the program output.
void debug2_print (char *pBuffer)
 Method to print a given string to the program output.
void i2c_initialise (uint32_t addr)
 Method to initialise a given I2C device for a given I2C address.
void i2c_close ()
 Method to close device if opened.
void i2c_write_byte (uint32_t reg, uint8_t data, uint8_t baseAddr)
 Method to write a single byte to a given I2C reg index.
void i2c_write_word (uint32_t reg, uint16_t data, uint8_t baseAddr)
 Method to write a single word to a given I2C reg index.
void i2c_write (uint32_t reg, uint8_t *data, int32_t size, uint8_t baseAddr)
 Method to write an array of bytes to a given I2C reg index.
uint8_t i2c_read_byte (uint32_t reg, uint8_t baseAddr)
 Method to read a single byte from a given I2C reg index.
uint16_t i2c_read_word (uint32_t reg, uint8_t baseAddr)
 Method to read a two byte word from a given I2C reg index.
uint32_t i2c_read_uint32 (uint32_t reg, uint8_t baseAddr)
 Method to read an int32 from a given I2C reg index.
void i2c_read (uint32_t reg, uint8_t *data, int32_t size, uint8_t baseAddr)
 Method to read multiple bytes from a given I2C reg index.
void timer_start ()
 Method to start the timer.
double_t timer_elapsedTime ()
 Method reporting the number of seconds elapsed since the timer was started.
void timer_stop ()
 Method to stop the timer.
void timer_wait_ms (int32_t ms)
 Method to wait a given number of ms.
void timer_wait_us (int32_t us)
 Method to wait a given number of us.
uint32_t timer_get_clock_time_usecs ()
 Method to report the current clock time in us.
uint32_t timer_get_clock_time_msecs ()
 Method to report the current clock time in ms.

Detailed Description

All platform specific declarations to be used by the High Level API are defined here.

The developer is responsible for providing the implementation of the prototypes declared.

Definition in file platform.h.


Typedef Documentation

typedef unsigned char bool_t

Typedef defining 8 bit unsigned char type.


The developer should modify this to suit the platform being deployed.

Definition at line 50 of file platform.h.

typedef double double_t

Typedef defining 64 bit double type.


The developer should modify this to suit the platform being deployed.

Definition at line 99 of file platform.h.

typedef float float_t

Typedef defining 32 bit float type.


The developer should modify this to suit the platform being deployed.

Definition at line 104 of file platform.h.

typedef short int16_t

Typedef defining 16 bit short type.


The developer should modify this to suit the platform being deployed.

Definition at line 82 of file platform.h.

typedef int int32_t

Typedef defining 32 bit int type.


The developer should modify this to suit the platform being deployed.

Definition at line 72 of file platform.h.

typedef signed char int8_t

Typedef defining 8 bit char type.


The developer should modify this to suit the platform being deployed.

Definition at line 92 of file platform.h.

typedef long long long64_t

Typedef defining 64 bit long type.


The developer should modify this to suit the platform being deployed.

Definition at line 62 of file platform.h.

typedef unsigned short uint16_t

Typedef defining 16 bit unsigned short type.


The developer should modify this to suit the platform being deployed.

Definition at line 77 of file platform.h.

typedef unsigned int uint32_t

Typedef defining 32 bit unsigned int type.


The developer should modify this to suit the platform being deployed.

Definition at line 67 of file platform.h.

typedef unsigned long long uint64_t

Typedef defining 64 bit unsigned long type.


The developer should modify this to suit the platform being deployed.

Definition at line 57 of file platform.h.

typedef unsigned char uint8_t

Typedef defining 8 bit unsigned char type.


The developer should modify this to suit the platform being deployed.

Definition at line 87 of file platform.h.


Function Documentation

void debug1_print ( char *  pBuffer )

Method to print a given string to the program output.

Definition at line 36 of file platform.cpp.

void debug2_print ( char *  pBuffer )

Method to print a given string to the program output.

Definition at line 42 of file platform.cpp.

void i2c_close (  )

Method to close device if opened.

Definition at line 53 of file platform.cpp.

void i2c_initialise ( uint32_t  addr )

Method to initialise a given I2C device for a given I2C address.

Definition at line 48 of file platform.cpp.

void i2c_read ( uint32_t  reg,
uint8_t data,
int32_t  size,
uint8_t  baseAddr 
)

Method to read multiple bytes from a given I2C reg index.

Throws ReadFail upon error.

Definition at line 98 of file platform.cpp.

uint8_t i2c_read_byte ( uint32_t  reg,
uint8_t  baseAddr 
)

Method to read a single byte from a given I2C reg index.

Throws ReadFail upon error.

Definition at line 77 of file platform.cpp.

uint32_t i2c_read_uint32 ( uint32_t  reg,
uint8_t  baseAddr 
)

Method to read an int32 from a given I2C reg index.

Throws ReadFail upon error.

Definition at line 91 of file platform.cpp.

uint16_t i2c_read_word ( uint32_t  reg,
uint8_t  baseAddr 
)

Method to read a two byte word from a given I2C reg index.

Throws ReadFail upon error.

Definition at line 84 of file platform.cpp.

void i2c_write ( uint32_t  reg,
uint8_t data,
int32_t  size,
uint8_t  baseAddr 
)

Method to write an array of bytes to a given I2C reg index.

Throws WriteFail upon failure.

Definition at line 71 of file platform.cpp.

void i2c_write_byte ( uint32_t  reg,
uint8_t  data,
uint8_t  baseAddr 
)

Method to write a single byte to a given I2C reg index.

Throws WriteFail upon failure.

Definition at line 58 of file platform.cpp.

void i2c_write_word ( uint32_t  reg,
uint16_t  data,
uint8_t  baseAddr 
)

Method to write a single word to a given I2C reg index.

Throws WriteFail upon failure.

Definition at line 65 of file platform.cpp.

double_t timer_elapsedTime (  )

Method reporting the number of seconds elapsed since the timer was started.

Definition at line 109 of file platform.cpp.

uint32_t timer_get_clock_time_msecs (  )

Method to report the current clock time in ms.

Definition at line 134 of file platform.cpp.

uint32_t timer_get_clock_time_usecs (  )

Method to report the current clock time in us.

Definition at line 129 of file platform.cpp.

void timer_start (  )

Method to start the timer.

Definition at line 104 of file platform.cpp.

void timer_stop (  )

Method to stop the timer.

Definition at line 114 of file platform.cpp.

void timer_wait_ms ( int32_t  ms )

Method to wait a given number of ms.

Definition at line 119 of file platform.cpp.

void timer_wait_us ( int32_t  us )

Method to wait a given number of us.

Definition at line 124 of file platform.cpp.