TinySTM  1.0.5
Functions
wrappers.h File Reference

STM wrapper functions for different data types. More...

Go to the source code of this file.

Functions

uint8_t stm_load_u8 (volatile uint8_t *addr)
 Transactional load of an unsigned 8-bit value. More...
 
uint16_t stm_load_u16 (volatile uint16_t *addr)
 Transactional load of an unsigned 16-bit value. More...
 
uint32_t stm_load_u32 (volatile uint32_t *addr)
 Transactional load of an unsigned 32-bit value. More...
 
uint64_t stm_load_u64 (volatile uint64_t *addr)
 Transactional load of an unsigned 64-bit value. More...
 
char stm_load_char (volatile char *addr)
 Transactional load of a char value. More...
 
unsigned char stm_load_uchar (volatile unsigned char *addr)
 Transactional load of an unsigned char value. More...
 
short stm_load_short (volatile short *addr)
 Transactional load of a short value. More...
 
unsigned short stm_load_ushort (volatile unsigned short *addr)
 Transactional load of an unsigned short value. More...
 
int stm_load_int (volatile int *addr)
 Transactional load of an int value. More...
 
unsigned int stm_load_uint (volatile unsigned int *addr)
 Transactional load of an unsigned int value. More...
 
long stm_load_long (volatile long *addr)
 Transactional load of a long value. More...
 
unsigned long stm_load_ulong (volatile unsigned long *addr)
 Transactional load of an unsigned long value. More...
 
float stm_load_float (volatile float *addr)
 Transactional load of a float value. More...
 
double stm_load_double (volatile double *addr)
 Transactional load of a double value. More...
 
void * stm_load_ptr (volatile void **addr)
 Transactional load of a pointer value. More...
 
void stm_load_bytes (volatile uint8_t *addr, uint8_t *buf, size_t size)
 Transactional load of a memory region. More...
 
void stm_store_u8 (volatile uint8_t *addr, uint8_t value)
 Transactional store of an unsigned 8-bit value. More...
 
void stm_store_u16 (volatile uint16_t *addr, uint16_t value)
 Transactional store of an unsigned 16-bit value. More...
 
void stm_store_u32 (volatile uint32_t *addr, uint32_t value)
 Transactional store of an unsigned 32-bit value. More...
 
void stm_store_u64 (volatile uint64_t *addr, uint64_t value)
 Transactional store of an unsigned 64-bit value. More...
 
void stm_store_char (volatile char *addr, char value)
 Transactional store of a char value. More...
 
void stm_store_uchar (volatile unsigned char *addr, unsigned char value)
 Transactional store of an unsigned char value. More...
 
void stm_store_short (volatile short *addr, short value)
 Transactional store of a short value. More...
 
void stm_store_ushort (volatile unsigned short *addr, unsigned short value)
 Transactional store of an unsigned short value. More...
 
void stm_store_int (volatile int *addr, int value)
 Transactional store of an int value. More...
 
void stm_store_uint (volatile unsigned int *addr, unsigned int value)
 Transactional store of an unsigned int value. More...
 
void stm_store_long (volatile long *addr, long value)
 Transactional store of a long value. More...
 
void stm_store_ulong (volatile unsigned long *addr, unsigned long value)
 Transactional store of an unsigned long value. More...
 
void stm_store_float (volatile float *addr, float value)
 Transactional store of a float value. More...
 
void stm_store_double (volatile double *addr, double value)
 Transactional store of a double value. More...
 
void stm_store_ptr (volatile void **addr, void *value)
 Transactional store of a pointer value. More...
 
void stm_store_bytes (volatile uint8_t *addr, uint8_t *buf, size_t size)
 Transactional store of a memory region. More...
 
void stm_set_bytes (volatile uint8_t *addr, uint8_t byte, size_t count)
 Transactional write of a byte to a memory region. More...
 

Detailed Description

STM wrapper functions for different data types.

This library defines transactional loads/store functions for unsigned data types of various sizes and for basic C data types.

Author
Pascal Felber pasca.nosp@m.l.fe.nosp@m.lber@.nosp@m.unin.nosp@m.e.ch Patrick Marlier patri.nosp@m.ck.m.nosp@m.arlie.nosp@m.r@un.nosp@m.ine.c.nosp@m.h
Date
2007-2014

Function Documentation

void stm_load_bytes ( volatile uint8_t *  addr,
uint8_t *  buf,
size_t  size 
)

Transactional load of a memory region.

The address of the region does not need to be word aligned and its size may be longer than a word. The values are copied into the provided buffer, which must be allocated by the caller.

Parameters
addrAddress of the memory location.
bufBuffer for storing the read bytes.
sizeNumber of bytes to read.
char stm_load_char ( volatile char *  addr)

Transactional load of a char value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
double stm_load_double ( volatile double *  addr)

Transactional load of a double value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
float stm_load_float ( volatile float *  addr)

Transactional load of a float value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
int stm_load_int ( volatile int *  addr)

Transactional load of an int value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
long stm_load_long ( volatile long *  addr)

Transactional load of a long value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
void* stm_load_ptr ( volatile void **  addr)

Transactional load of a pointer value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
short stm_load_short ( volatile short *  addr)

Transactional load of a short value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
uint16_t stm_load_u16 ( volatile uint16_t *  addr)

Transactional load of an unsigned 16-bit value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
uint32_t stm_load_u32 ( volatile uint32_t *  addr)

Transactional load of an unsigned 32-bit value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
uint64_t stm_load_u64 ( volatile uint64_t *  addr)

Transactional load of an unsigned 64-bit value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
uint8_t stm_load_u8 ( volatile uint8_t *  addr)

Transactional load of an unsigned 8-bit value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
unsigned char stm_load_uchar ( volatile unsigned char *  addr)

Transactional load of an unsigned char value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
unsigned int stm_load_uint ( volatile unsigned int *  addr)

Transactional load of an unsigned int value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
unsigned long stm_load_ulong ( volatile unsigned long *  addr)

Transactional load of an unsigned long value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
unsigned short stm_load_ushort ( volatile unsigned short *  addr)

Transactional load of an unsigned short value.

Parameters
addrAddress of the memory location.
Returns
Value read from the specified address.
void stm_set_bytes ( volatile uint8_t *  addr,
uint8_t  byte,
size_t  count 
)

Transactional write of a byte to a memory region.

The address of the region does not need to be word aligned and its size may be longer than a word. The provided byte is repeatedly copied to the whole memory region.

Parameters
addrAddress of the memory location.
byteByte to write.
countNumber of bytes to write.
void stm_store_bytes ( volatile uint8_t *  addr,
uint8_t *  buf,
size_t  size 
)

Transactional store of a memory region.

The address of the region does not need to be word aligned and its size may be longer than a word. The values are copied from the provided buffer.

Parameters
addrAddress of the memory location.
bufBuffer with the bytes to write.
sizeNumber of bytes to write.
void stm_store_char ( volatile char *  addr,
char  value 
)

Transactional store of a char value.

Parameters
addrAddress of the memory location.
valueValue to be written.
void stm_store_double ( volatile double *  addr,
double  value 
)

Transactional store of a double value.

Parameters
addrAddress of the memory location.
valueValue to be written.
void stm_store_float ( volatile float *  addr,
float  value 
)

Transactional store of a float value.

Parameters
addrAddress of the memory location.
valueValue to be written.
void stm_store_int ( volatile int *  addr,
int  value 
)

Transactional store of an int value.

Parameters
addrAddress of the memory location.
valueValue to be written.
void stm_store_long ( volatile long *  addr,
long  value 
)

Transactional store of a long value.

Parameters
addrAddress of the memory location.
valueValue to be written.
void stm_store_ptr ( volatile void **  addr,
void *  value 
)

Transactional store of a pointer value.

Parameters
addrAddress of the memory location.
valueValue to be written.
void stm_store_short ( volatile short *  addr,
short  value 
)

Transactional store of a short value.

Parameters
addrAddress of the memory location.
valueValue to be written.
void stm_store_u16 ( volatile uint16_t *  addr,
uint16_t  value 
)

Transactional store of an unsigned 16-bit value.

Parameters
addrAddress of the memory location.
valueValue to be written.
void stm_store_u32 ( volatile uint32_t *  addr,
uint32_t  value 
)

Transactional store of an unsigned 32-bit value.

Parameters
addrAddress of the memory location.
valueValue to be written.
void stm_store_u64 ( volatile uint64_t *  addr,
uint64_t  value 
)

Transactional store of an unsigned 64-bit value.

Parameters
addrAddress of the memory location.
valueValue to be written.
void stm_store_u8 ( volatile uint8_t *  addr,
uint8_t  value 
)

Transactional store of an unsigned 8-bit value.

Parameters
addrAddress of the memory location.
valueValue to be written.
void stm_store_uchar ( volatile unsigned char *  addr,
unsigned char  value 
)

Transactional store of an unsigned char value.

Parameters
addrAddress of the memory location.
valueValue to be written.
void stm_store_uint ( volatile unsigned int *  addr,
unsigned int  value 
)

Transactional store of an unsigned int value.

Parameters
addrAddress of the memory location.
valueValue to be written.
void stm_store_ulong ( volatile unsigned long *  addr,
unsigned long  value 
)

Transactional store of an unsigned long value.

Parameters
addrAddress of the memory location.
valueValue to be written.
void stm_store_ushort ( volatile unsigned short *  addr,
unsigned short  value 
)

Transactional store of an unsigned short value.

Parameters
addrAddress of the memory location.
valueValue to be written.