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)
      • Write once file system (WOFS)
    • 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
      • Flash
        • 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
        • The system timer
      • UART
        • Overview
        • Data structures
          • UART parity
          • UART stop bits
          • 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
      • mbed
        • pio
          • Overview
          • Functions
      • mizar32
        • lcd
          • Overview
          • Functions
        • rtc
          • Overview
          • Functions

eLua reference manual - Mizar32 Real Time Clock module

Overview

This module contains functions to drive the Real-Time Clock present on the Mizar32's ethernet module.

The functions accept and return the time and date as a table in the same format at Lua's os.date() and os.time() functions, with fields year (1900-2099), month (1-12), day (1-31), wday (1-7), hour (0-23), min (0-59) and sec (0-59). For wday, the day of the week, by convention, 1 is Sunday.

Functions

mizar32.rtc.set mizar32.rtc.get

mizar32.rtc.set(datetime)

Sets the time and/or date into the RTC hardware.

Arguments: datetime - A table with the time and/or date fields to set. Any fields which are not present (or are nil) are not changed, so you can set the time, the date or individual fields separately. Setting nonexistent dates like the 31st of February is possible but what will happen next is unpredictable.

Returns: nothing.

datetime = mizar32.rtc.get()

Reads the current date and time from the RTC hardware.

Arguments: none.

Returns: datetime - A table with fields year, month, day, wday, hour, min and sec.



© 2011 eLua Project. All rights reserved.