eLua Project

  • Site
  • Downloads
  • Doc
  • Wiki
  • Builder
  • Tracker
  • Repos

eLua Doc

  • Introduction
  • Status
    • Supported platforms
    • Modules per platform table
    • Modules overview status
    • Roadmap
  • Generic info
    • Using eLua
      • Over UART
      • Over TCP/IP
      • On PC
      • The shell
      • Linenoise
      • Cross-compiling
      • LuaRPC
      • The serial multiplexer
    • Code examples
    • FAQ
    • eLua file systems
      • Read-Only FS in MCU Flash
      • R/W FAT FS in SD/MMC Cards
      • Remote file system (RFS)
    • eLua interrupt handlers
      • In Lua
      • In C
    • Building eLua
      • Building eLua in Linux
      • Building eLua in Windows
  • eLua internals
    • Overview
      • eLua's Architecture
      • Common code
      • Interface architecture
      • Booting eLua
      • Platforms and ports
      • Adding a new port
      • Implementing interrupts
        • Interrupt list
    • Platform interface
      • ADC
        • Overview
        • Functions
      • CAN
        • Overview
        • Data structures
          • CAN ID types
        • Functions
      • CPU
        • Overview
        • Functions
      • Ethernet
        • Overview
        • Functions
      • I2C
        • Overview
        • Data structures
          • I2C speed
          • I2C transfer direction
        • Functions
      • Low-level
        • Overview
        • Data structures
          • Status codes
        • Functions
      • PIO
        • Overview
        • Data structures
          • PIO operations
          • PIO data type
        • Functions
      • PWM
        • Overview
        • Data structures
          • PWM operations
        • Functions
      • SPI
        • Overview
        • Data structures
          • Chip select
          • SPI mode
          • SPI data type
        • Functions
      • Timers
        • Overview
        • Data structures
          • Timer data type
          • Timer operations
        • Functions
        • Virtual timers
      • UART
        • Overview
        • Data structures
          • UART parity
          • UART stop bits
          • UART timeout
          • Virtual UART IDs
          • Flow control type
        • Functions
    • More information
      • Consoles and terminals
      • TCP/IP in eLua
      • LTR (Lua Tiny RAM) in eLua
      • EGC (Emergency GC) in eLua
      • Booting on a PC
      • Booting from a PenDrive
      • Using OpenOCD
      • eLua toolchains
      • Building toolchains
        • ARM7 and ARM9
        • ARM Cortex-M3
        • i386
      • eLua coding style
  • Reference Manual
    • Generic modules
      • adc
        • Overview
        • Functions
      • bit
        • Overview
        • Functions
      • can
        • Overview
        • Data structures
          • CAN ID types
        • Functions
      • cpu
        • Overview
        • Data structures
          • CPU constants
        • Functions
      • elua
        • Overview
        • Functions
      • i2c
        • Overview
        • Functions
      • net
        • Overview
        • Data structures
          • Error codes
        • Functions
      • pack
        • Overview
        • Functions
      • pd
        • Overview
        • Functions
      • pio
        • Overview
        • Functions
      • pwm
        • Overview
        • Functions
      • rpc
        • Overview
        • Functions
      • spi
        • Overview
        • Functions
      • term
        • Overview
        • Functions
      • tmr
        • Overview
        • Functions
      • uart
        • Overview
        • Data structures
          • UART constants
        • Functions
    • Platform modules
      • lm3s
        • disp
          • Overview
          • Functions
      • str9
        • pio
          • Overview
          • Functions
        • rtc
          • Overview
          • Functions
      • mbed
        • pio
          • Overview
          • Functions

eLua reference manual - STR9 rtc module

Overview

This module contains functions for accesing the particular features of the RTC - Real Time Clock - subsystem of the STR9 family of CPUs. This internal subsystem offers functions to keep track of a real time clock calendar, as well as some other features like alarms and auxiliar functions. Reference manual, available from ST at this address.

Functions

str9.rtc.settime str9.rtc.gettime str9.rtc.setdate str9.rtc.getdate

str9.rtc.settime( time )

Sets the Real Time Clock time to a specific time of the day.

Arguments: time - a string in the format 'hh:mm:ss' or a Lua table with 'hour', 'min' and 'sec' string fields.

Returns: nothing.

str9.rtc.gettime( format )

Gets the time kept by the Real Time Clock.

Arguments: format - the string '*s' to return the time as a string 'hh:mm:ss' or '*t' to return as a Lua table with string fields 'hour', 'min' and 'sec'.

Returns: a string or a Lua table, according to the format argument.

str9.rtc.setdate( date )

Sets the Real Time Clock date to a specific date.

Arguments: date - a string in the format 'dd/mm/yyyy' or a Lua table with 'day', 'month' and 'year' string fields.

Returns: nothing.

str9.rtc.getdate( format )

Gets the date kept by the Real Time Clock.

Arguments: format - the string '*s' to return the date as a string 'dd/mm/yyyy' or '*t' to return as a Lua table with string fields 'day', 'month' and 'year'.

Returns: a string or a Lua table, according to the format argument.



© 2011 eLua Project. All rights reserved.