Contiki-Inga 3.x
Modules | Files | Functions
Stm32w-cpu

Compiler and Platform specific definitions and typedefs common to all platforms. More...

Modules

 Status_codes
 Many StZNet API functions return an ::StStatus value to indicate the success or failure of the call.
 
 Adc
 Sample A/D converter driver.
 
 Led
 Sample API funtions for controlling LEDs.
 
 Micro
 Many of the supplied example applications use these microcontroller functions.
 
 System_timer
 Functions that provide access to the system clock.
 
 Definition and description of public flash manipulation routines.
 
 Nvm
 Cortex-M3 Non-Volatile Memory data storage system.
 
 Gnu
 Compiler and Platform specific definitions and typedefs for the GNU C ARM compiler.
 
 Iar
 Compiler and Platform specific definitions and typedefs for the IAR ARM C compiler.
 

Files

file  platform-common.h
 See platform_common for detailed documentation.
 
file  stm32w-radio.c
 
                           Machine dependent STM32W radio code.

 
file  stm32w-radio.h
 
    STM32W radio driver header file

 
file  uart1.c
 
                           Machine dependent STM32W UART1 code.

 
file  uart1.h
 
    A brief description of what this file is.

 

Functions

boolean ST_RadioDataPendingShortIdIsrCallback (uint16_t shortId)
 This function is called by the library after the short address fields of a packet have been received. More...
 
boolean ST_RadioDataPendingLongIdIsrCallback (uint8_t *longId)
 This function is called by the library after the long address fields of a packet have been received. More...
 
void ST_RadioOverflowIsrCallback (void)
 This function is called by the library in response to a receive overflow event if this notification is enabled by a call to ST_RadioEnableOverflowNotification().
 
void ST_RadioMacTimerCompareIsrCallback (void)
 This function is called by the library in response to MAC timer comparison event.
 
void SysTick_CLKSourceConfig (uint32_t SysTick_CLKSource)
 Configures the SysTick clock source. More...
 
void SysTick_SetReload (uint32_t Reload)
 Sets SysTick Reload value. More...
 
void SysTick_CounterCmd (uint32_t SysTick_Counter)
 Enables or disables the SysTick counter. More...
 
void SysTick_ITConfig (FunctionalState NewState)
 Enables or disables the SysTick Interrupt. More...
 
uint32_t SysTick_GetCounter (void)
 Gets SysTick counter value. More...
 
FlagStatus SysTick_GetFlagStatus (uint8_t SysTick_FLAG)
 Checks whether the specified SysTick flag is set or not. More...
 

Generic Types

#define TRUE   1
 An alias for one, used for clarity.
 
#define FALSE   0
 An alias for zero, used for clarity.
 
#define NULL   ((void *)0)
 The null pointer.
 

Bit Manipulation Macros

#define BIT(x)   (1U << (x))
 Useful to reference a single bit of a byte.
 
#define BIT32(x)   (((uint32_t) 1) << (x))
 Useful to reference a single bit of an uint32_t type.
 
#define SETBIT(reg, bit)   reg |= BIT(bit)
 Sets bit in the reg register or byte. More...
 
#define SETBITS(reg, bits)   reg |= (bits)
 Sets the bits in the reg register or the byte as specified in the bitmask bits. More...
 
#define CLEARBIT(reg, bit)   reg &= ~(BIT(bit))
 Clears a bit in the reg register or byte. More...
 
#define CLEARBITS(reg, bits)   reg &= ~(bits)
 Clears the bits in the reg register or byte as specified in the bitmask bits. More...
 
#define READBIT(reg, bit)   (reg & (BIT(bit)))
 Returns the value of bit within the register or byte reg.
 
#define READBITS(reg, bits)   (reg & (bits))
 Returns the value of the bitmask bits within the register or byte reg.
 

Byte Manipulation Macros

#define LOW_BYTE(n)   ((uint8_t)((n) & 0xFF))
 Returns the low byte of the 16-bit value n as an uint8_t.
 
#define HIGH_BYTE(n)   ((uint8_t)(LOW_BYTE((n) >> 8)))
 Returns the high byte of the 16-bit value n as an uint8_t.
 
#define HIGH_LOW_TO_INT(high, low)
 Returns the value built from the two uint8_t values high and low.
 
#define BYTE_0(n)   ((uint8_t)((n) & 0xFF))
 Returns the low byte of the 32-bit value n as an uint8_t.
 
#define BYTE_1(n)   ((uint8_t)(BYTE_0((n) >> 8)))
 Returns the second byte of the 32-bit value n as an uint8_t.
 
#define BYTE_2(n)   ((uint8_t)(BYTE_0((n) >> 16)))
 Returns the third byte of the 32-bit value n as an uint8_t.
 
#define BYTE_3(n)   ((uint8_t)(BYTE_0((n) >> 24)))
 Returns the high byte of the 32-bit value n as an uint8_t.
 

Time Manipulation Macros

#define elapsedTimeInt8u(oldTime, newTime)   ((uint8_t) ((uint8_t)(newTime) - (uint8_t)(oldTime)))
 Returns the elapsed time between two 8 bit values. More...
 
#define elapsedTimeInt16u(oldTime, newTime)   ((uint16_t) ((uint16_t)(newTime) - (uint16_t)(oldTime)))
 Returns the elapsed time between two 16 bit values. More...
 
#define elapsedTimeInt32u(oldTime, newTime)   ((uint32_t) ((uint32_t)(newTime) - (uint32_t)(oldTime)))
 Returns the elapsed time between two 32 bit values. More...
 
#define MAX_INT8U_VALUE   0xFF
 Returns TRUE if t1 is greater than t2. More...
 
#define timeGTorEqualInt8u(t1, t2)   (elapsedTimeInt8u(t2, t1) <= ((MAX_INT8U_VALUE + 1) / 2))
 
#define MAX_INT16U_VALUE   0xFFFF
 Returns TRUE if t1 is greater than t2. More...
 
#define timeGTorEqualInt16u(t1, t2)   (elapsedTimeInt16u(t2, t1) <= ((MAX_INT16U_VALUE + 1) / 2))
 
#define MAX_INT32U_VALUE   0xFFFFFFFF
 Returns TRUE if t1 is greater than t2. More...
 
#define timeGTorEqualInt32u(t1, t2)   (elapsedTimeInt32u(t2, t1) <= ((MAX_INT32U_VALUE + 1) / 2))
 

Detailed Description

Compiler and Platform specific definitions and typedefs common to all platforms.

platform-common.h provides PLATFORM_HEADER defaults and common definitions. This head should never be included directly, it should only be included by the specific PLATFORM_HEADER used by your platform.

See platform-common.h for source code.

Macro Definition Documentation

#define CLEARBIT (   reg,
  bit 
)    reg &= ~(BIT(bit))

Clears a bit in the reg register or byte.

Note
Assuming reg is an IO register, some platforms (such as the AVR) can implement this in a single atomic operation.

Definition at line 226 of file platform-common.h.

#define CLEARBITS (   reg,
  bits 
)    reg &= ~(bits)

Clears the bits in the reg register or byte as specified in the bitmask bits.

Note
This is never a single atomic operation.

Definition at line 233 of file platform-common.h.

#define elapsedTimeInt16u (   oldTime,
  newTime 
)    ((uint16_t) ((uint16_t)(newTime) - (uint16_t)(oldTime)))

Returns the elapsed time between two 16 bit values.

Result may not be valid if the time samples differ by more than 32767

Definition at line 314 of file platform-common.h.

#define elapsedTimeInt32u (   oldTime,
  newTime 
)    ((uint32_t) ((uint32_t)(newTime) - (uint32_t)(oldTime)))

Returns the elapsed time between two 32 bit values.

Result may not be valid if the time samples differ by more than 2147483647

Definition at line 321 of file platform-common.h.

#define elapsedTimeInt8u (   oldTime,
  newTime 
)    ((uint8_t) ((uint8_t)(newTime) - (uint8_t)(oldTime)))

Returns the elapsed time between two 8 bit values.

Result may not be valid if the time samples differ by more than 127

Definition at line 307 of file platform-common.h.

#define MAX_INT16U_VALUE   0xFFFF

Returns TRUE if t1 is greater than t2.

Can only account for 1 wrap around of the variable before it is wrong.

Definition at line 336 of file platform-common.h.

#define MAX_INT32U_VALUE   0xFFFFFFFF

Returns TRUE if t1 is greater than t2.

Can only account for 1 wrap around of the variable before it is wrong.

Definition at line 344 of file platform-common.h.

#define MAX_INT8U_VALUE   0xFF

Returns TRUE if t1 is greater than t2.

Can only account for 1 wrap around of the variable before it is wrong.

Definition at line 328 of file platform-common.h.

#define SETBIT (   reg,
  bit 
)    reg |= BIT(bit)

Sets bit in the reg register or byte.

Note
Assuming reg is an IO register, some platforms can implement this in a single atomic operation.

Definition at line 212 of file platform-common.h.

#define SETBITS (   reg,
  bits 
)    reg |= (bits)

Sets the bits in the reg register or the byte as specified in the bitmask bits.

Note
This is never a single atomic operation.

Definition at line 219 of file platform-common.h.

Function Documentation

boolean ST_RadioDataPendingLongIdIsrCallback ( u8 *  longId)

This function is called by the library after the long address fields of a packet have been received.

The library will set the frame pending bit in the outgoing ACK only if the return value is TRUE. The application must lookup the eui64 in its own data structures and return TRUE if there is data pending, FALSE otherwise. It is critical that this function complete as quickly as possible to ensure the frame pending bit can be set before the ACK is transmitted.

Returns
TRUE if the frame pending bit should be set in the outgoing ACK.

Definition at line 609 of file stm32w-radio.c.

References FALSE.

boolean ST_RadioDataPendingShortIdIsrCallback ( u16  shortId)

This function is called by the library after the short address fields of a packet have been received.

The library will set the frame pending bit in the outgoing ACK only if the return value is TRUE. The application must lookup shortId in its own data structures and return TRUE if there is data pending, FALSE otherwise. It is critical that this function complete as quickly as possible to ensure the frame pending bit can be set before the ACK is transmitted.

Returns
TRUE if the frame pending bit should be set in the outgoing ACK.

Definition at line 602 of file stm32w-radio.c.

References FALSE.

void SysTick_CLKSourceConfig ( uint32_t  SysTick_CLKSource)

Configures the SysTick clock source.

Parameters
SysTick_CLKSourcespecifies the SysTick clock source. This parameter can be one of the following values: SysTick_CLKSource_HCLK_Div8: AHB clock divided by 8 selected as SysTick clock source. SysTick_CLKSource_HCLK: AHB clock selected as SysTick clock source.

Definition at line 40 of file stm32w-systick.c.

Referenced by clock_init().

void SysTick_CounterCmd ( uint32_t  SysTick_Counter)

Enables or disables the SysTick counter.

Parameters
SysTick_Counternew state of the SysTick counter. This parameter can be one of the following values:
  • SysTick_Counter_Disable: Disable counter
  • SysTick_Counter_Enable: Enable counter
  • SysTick_Counter_Clear: Clear counter value to 0

Definition at line 73 of file stm32w-systick.c.

Referenced by clock_init().

u32 SysTick_GetCounter ( void  )

Gets SysTick counter value.

Returns
SysTick current value

Definition at line 110 of file stm32w-systick.c.

FlagStatus SysTick_GetFlagStatus ( uint8_t  SysTick_FLAG)

Checks whether the specified SysTick flag is set or not.

Parameters
SysTick_FLAGspecifies the flag to check. This parameter can be one of the following values:
  • SysTick_FLAG_COUNT
  • SysTick_FLAG_SKEW
  • SysTick_FLAG_NOREF

Definition at line 124 of file stm32w-systick.c.

void SysTick_ITConfig ( FunctionalState  NewState)

Enables or disables the SysTick Interrupt.

Parameters
NewStatenew state of the SysTick Interrupt. This parameter can be: ENABLE or DISABLE.

Definition at line 93 of file stm32w-systick.c.

Referenced by clock_init().

void SysTick_SetReload ( uint32_t  Reload)

Sets SysTick Reload value.

Parameters
ReloadSysTick Reload new value. Must be between 1 and 0xFFFFFF.

Definition at line 57 of file stm32w-systick.c.

Referenced by clock_init().