Contiki-Inga 3.x
Modules | Files | Data Structures | Macros | Functions | Variables
The STM32W MBXXX platform.

The STM32W MBXXX platform. More...

Modules

 Board
 ST board abstraction layer.
 

Files

file  board-sensors.h
 
    Declarations for sensor-related functions that are
    common to all stm32w platforms.

 
file  cfs-coffee-arch.c
 Coffee architecture-dependent functionality for the STM32W108-based mb851 platform.
 
file  cfs-coffee-arch.h
 Coffee architecture-dependent header for the STM32W108-based mb851 platform.
 
file  clock.c
 
           Clock.

 
file  leds-arch.c
 
           Leds.

 
file  rand.c
 
           Random number functions for STM32W.

 
file  rtimer-arch.c
 
           Real-timer specific implementation for STM32W.

 
file  rtimer-arch.h
 
    Real-timer header file for STM32W.

 
file  slip-uart1.c
 
           Machine dependent STM32W SLIP routines for UART1.

 
file  uip-arch.c
 
           uip-arch.c

 
file  watchdog.c
 
           Watchdog

 
file  board.c
 
    Software layer to support all the ST kits boards

 
file  board.h
 
    Header file x STM32W108 Kits boards abstraction.

 
file  contiki-conf.h
 
    Contiki-conf.h for MBXXX.

 
file  contiki-init-net.c
 
    Functions for net initialization.

 
file  contiki-init-net.h
 
    Functions for net initialization.

 
file  contiki-main.c
 
    Contiki main file.

 
file  platform-conf.h
 
    Platform-conf.h for MBXXX.

 
file  shell-sensors.c
 
    Shell function for temp and acc sensors.

 
file  shell-sensors.h
 
    Header file for Contik shell sensors command.

 
file  acc-sensor.c
 
           Accelerometer.

 
file  acc-sensor.h
 
           Accelerometer header file.

 
file  button-sensor.c
 
           Button sensor.

 
file  contact-sensor.c
 
           Contact sensor.

 
file  contact-sensor.h
 
           Contact magnetic sensor header file.

 
file  temperature-sensor.c
 
           Temperature sensor.

 
file  temperature-sensor.h
 
           Temperature sensor.

 

Data Structures

struct  t_mems_data
 Mems data type: three acceleration values each related to a specific direction Watch out: only lower data values (e.g. More...
 

Macros

#define BUTTON_S1   PORTx_PIN(boardDescription->io->buttons[0].gpioPort, boardDescription->io->buttons[0].gpioPin)
 Port and pin for BUTTON0.
 
#define BUTTON_S1_SEL()   do { GPIO_IRQCSEL = BUTTON_S1; } while(0)
 Point the proper IRQ at the desired pin for BUTTON0.
 
#define BUTTON_S1_ISR   halIrqCIsr
 The interrupt service routine for BUTTON_S1.
 
#define BUTTON_S1_INTCFG   GPIO_INTCFGC
 The interrupt configuration register for BUTTON_S1.
 
#define BUTTON_S1_INT_EN_BIT   INT_IRQC
 The interrupt bit for BUTTON_S1.
 
#define BUTTON_S1_FLAG_BIT   INT_IRQCFLAG
 The interrupt bit for BUTTON_S1.
 
#define BUTTON_S1_MISS_BIT   INT_MISSIRQC
 The missed interrupt bit for BUTTON_S1.
 
#define SUPPLY_OFFSET   500
 NOTE: For the temperature measurement, the ADC extended range mode is needed; but this is inaccurate due to the high voltage mode bug of the general purpose ADC (see STM32W108 errata).
 

Functions

void board_sensors_power_down (void)
 Remember state of sensors (if active or not), in order to resume their original state after calling board_sensors_power_up(). More...
 
void board_sensors_power_up (void)
 Resume the state of all on-board sensors on to the state that they had when board_sensors_power_down() was called. More...
 
void clock_init (void)
 Initialize the clock library. More...
 
clock_time_t clock_time (void)
 Get the current clock time. More...
 
void clock_delay (unsigned int i)
 Delay the CPU for a multiple of TODO.
 
void clock_wait (clock_time_t i)
 Wait for a multiple of 1 ms. More...
 
unsigned long clock_seconds (void)
 Get the current value of the platform seconds. More...
 
void * elfloader_arch_allocate_ram (int size)
 Allocate RAM for a new module. More...
 
void * elfloader_arch_allocate_rom (int size)
 Allocate program memory for a new module. More...
 
void elfloader_arch_write_rom (int fd, unsigned short textoff, unsigned int size, char *mem)
 Write to read-only memory (for example the text segment). More...
 
void elfloader_arch_relocate (int fd, unsigned int sectionoffset, char *sectionaddr, struct elf32_rela *rela, char *addr)
 Perform a relocation. More...
 
void leds_arch_init (void)
 Leds implementation.
 
void halBoardInit (void)
 Initialize the board description data structure after autodetect of the boards based on the CIB Board name field content. More...
 
BoardResourcesType const * halBoardGetDescription (void)
 Return pointer to board description structure. More...
 
void halBoardPowerDown (void)
 Perform board specific action to power down the system, usually before going to deep sleep. More...
 
void halBoardPowerUp (void)
 Perform board specific action to power up the system. More...
 
int main (void)
 Main routine for the cc2538dk platform.
 

Variables

SENSORSbutton_sensor
 
struct sensors_sensor temperature_sensor
 NOTE: For the temperature measurement, the ADC extended range mode is needed; but this is inaccurate due to the high voltage mode bug of the general purpose ADC (see STM32W108 errata).
 

Detailed Description

The STM32W MBXXX platform.

Function Documentation

void board_sensors_power_down ( void  )

Remember state of sensors (if active or not), in order to resume their original state after calling board_sensors_power_up().

Useful when entering in sleep mode, since all system peripherals have to be reinitialized.

void board_sensors_power_up ( void  )

Resume the state of all on-board sensors on to the state that they had when board_sensors_power_down() was called.

Useful when sensors have to be used after the micro was put in deep sleep mode.

void clock_init ( void  )

Initialize the clock library.

Start the clock by enabling the timer comparison interrupts.

This function initializes the clock library and should be called from the main() function of the system.

Definition at line 85 of file clock.c.

References ATOMIC, SysTick_CLKSourceConfig(), SysTick_CounterCmd(), SysTick_ITConfig(), and SysTick_SetReload().

unsigned long clock_seconds ( void  )

Get the current value of the platform seconds.

Return seconds, default is time since startup.

This could be the number of seconds since startup, or since a standard epoch.

Returns
The value.

The comparison avoids the need to disable clock interrupts for an atomic read of the four-byte variable.

Definition at line 129 of file clock.c.

clock_time_t clock_time ( void  )

Get the current clock time.

Return the tick counter.

This function returns the current system clock time.

Returns
The current clock time, measured in system ticks.

When 16 bit it typically wraps every 10 minutes. The comparison avoids the need to disable clock interrupts for an atomic read of the multi-byte variable.

Definition at line 97 of file clock.c.

void clock_wait ( clock_time_t  i)

Wait for a multiple of 1 ms.

Wait for a given number of ticks.

Definition at line 120 of file clock.c.

References clock_time().

void* elfloader_arch_allocate_ram ( int  size)

Allocate RAM for a new module.

Parameters
sizeThe size of the requested memory.
Returns
A pointer to the allocated RAM
        This function is called from the Contiki ELF loader to
        allocate RAM for the module to be loaded into.

Definition at line 64 of file elfloader-arch.c.

Referenced by elfloader_load().

void* elfloader_arch_allocate_rom ( int  size)

Allocate program memory for a new module.

Parameters
sizeThe size of the requested memory.
Returns
A pointer to the allocated program memory
        This function is called from the Contiki ELF loader to
        allocate program memory (typically ROM) for the module
        to be loaded into.

Definition at line 73 of file elfloader-arch.c.

Referenced by elfloader_load().

void elfloader_arch_relocate ( int  fd,
unsigned int  sectionoffset,
char *  sectionaddr,
struct elf32_rela *  rela,
char *  addr 
)

Perform a relocation.

Parameters
fdThe file descriptor for the ELF file.
sectionoffsetThe file offset at which the relocation can be found.
sectionaddrThe section start address (absolute runtime).
relaA pointer to an ELF32 rela structure (struct elf32_rela).
addrThe relocated address.
        This function is called from the Contiki ELF loader to
        perform a relocation on a piece of code or data. The
        relocated address is calculated by the Contiki ELF
        loader, based on information in the ELF file, and it is
        the responsibility of this function to patch the
        executable code. The Contiki ELF loader passes a
        pointer to an ELF32 rela structure (struct elf32_rela)
        that contains information about how to patch the
        code. This information is different from processor to
        processor.

Definition at line 100 of file elfloader-arch.c.

References cfs_seek(), CFS_SEEK_CUR, CFS_SEEK_SET, and ELFLOADER_UNHANDLED_RELOC.

void elfloader_arch_write_rom ( int  fd,
unsigned short  textoff,
unsigned int  size,
char *  mem 
)

Write to read-only memory (for example the text segment).

Parameters
fdThe file descriptor for the ELF file.
textoffOffset of text segment relative start of file.
sizeThe size of the text segment.
memA pointer to the where the text segment should be flashed
        This function is called from the Contiki ELF loader to
        write the program code (text segment) of a loaded
        module into memory. The function is called when all
        relocations have been performed.

Definition at line 84 of file elfloader-arch.c.

References cfs_seek(), and CFS_SEEK_SET.

Referenced by elfloader_load().

BoardResourcesType const* halBoardGetDescription ( void  )

Return pointer to board description structure.

Returns
Pointer to board description structure

Definition at line 417 of file board.c.

void halBoardInit ( void  )

Initialize the board description data structure after autodetect of the boards based on the CIB Board name field content.

In case of invalid CIB data it will default to MB851A. Customer normally needs to modify this file to adapt it to their specific board.

Definition at line 387 of file board.c.

References NULL.

void halBoardPowerDown ( void  )

Perform board specific action to power down the system, usually before going to deep sleep.

This code depends on the actual board features and configure the stm32w and on board devices for minimal power consumption. Customer normally needs to modify this file to adapt it to their specific board.

Definition at line 422 of file board.c.

References BOARD_HAS_PA, BoardIOStruct::buttons, BoardResourcesStruct::buttons, halGpioConfig(), halGpioSet(), BoardResourcesStruct::io, BoardIOStruct::leds, BoardResourcesStruct::leds, PORTB_PIN, and PORTx_PIN.

void halBoardPowerUp ( void  )

Perform board specific action to power up the system.

This code depends on the actual board features and configure the stm32w and on board devices for proper operation. Customer normally needs to modify this file to adapt it to their specific board.

Definition at line 488 of file board.c.

References BOARD_HAS_EEPROM, BOARD_HAS_MEMS, BOARD_HAS_PA, BOARD_HAS_TEMP_SENSOR, BoardIOStruct::buttons, BoardResourcesStruct::buttons, TempSensorResourceStruct::gpioPin, TempSensorResourceStruct::gpioPort, halGpioConfig(), halGpioSet(), BoardResourcesStruct::io, BoardIOStruct::leds, BoardResourcesStruct::leds, PORTA_PIN, PORTB_PIN, PORTC_PIN, PORTx_PIN, and BoardResourcesStruct::temperatureSensor.

Variable Documentation

SENSORS& button_sensor
Author
Ian Martin marti.nosp@m.ni@r.nosp@m.edwir.nosp@m.ellc.nosp@m..com

Definition at line 99 of file contiki-main.c.