Skip to content

Latest commit

 

History

History
This directory contains core logic of various applications.

Current applications are:

app_led_flash - This application flashes on-board led using arm timer
        to measure time. It changes led's state every half a second.
        
app_uart1_echo - This application configures and uses uart1 as its serial 
        terminal. It echoes every character back. The configuration is:
        Baud: 115200; Parity: None; Stop bits: 1; Flow control: off.
        
app_uart1_logging - This application configures and uses uart1 as its serial 
        output device. It uses output stream object to log the running counter
        value in both decimal and hexadecimal formats. Use your serial terminal
        application to view the output. The uart configuration is: 
        Baud: 115200; Parity: None; Stop bits: 1; Flow control: off.
        
app_uart1_morse - This application configures and uses uart1 as its serial 
        input device. It reads the incomming characters and flashes the led
        with Morse code specific to the character. The read characters are 
        accumulated in internal buffer until displayed using led. 
        The uart configuration is: 
        Baud: 115200; Parity: None; Stop bits: 1; Flow control: off.
        
app_button - This application responds to button presses and releases. Every
        button press "Button Pressed" and every button release "Button Released"
        strings are logged asynchronously to UART1. In addition to this, every 
        button press will activate on-board LED which will be on for exactly 
        1 second after the last press. The UART1 configuration is:
        Baud: 9600; Parity: None; Stop bits: 1; Flow control: off.
        Button configuration: GPIO 23, active (pressed) low
        
app_i2c0_eeprom - This application demonstrates parallel access to two eeproms
        via I2C0 interface. It also uses UART1 to log its read/write operations.
        The I2C0 is configured to run with 100Hz clock speed and the 
        uart configuration is: 
        Baud: 115200; Parity: None; Stop bits: 1; Flow control: off.        
        
app_uart1_comms - This application uses serial interface (UART1) to send and 
        receive messages. The main purpose of this application is to test "comms"
        module of the embxx library. 
        The format of every message is:
        <Synch - 2 bytes> | <Size - 1 byte> | <Message ID - 1 byte> | Message data | <Checksum - 2 bytes>
        All the fields are in "big endian" format.
        The first 2 synchronisation bytes are "0x48" and "0x69" which stand for
        "Hi" in ascii. They are followed by one byte of size field that 
        indicates length (in bytes) of the rest of the message including 
        checksum. Then there is 1 byte of message ID, followed by message data
        and 2 bytes of checksum. The checksum is a sum of all the bytes including
        first 2 synchronisation characters. The application expects the 
        following messages as an input: 
         - Led state control message. Has ID = 3, and 1 byte of intended new led 
           state, which is 0 for "off" and 1 for "on".
        The application emits the following messages as an output:
        - Hearbeat message. Has ID = 0, and 2 bytes of sequential number as
          its message data. It is emitted every 2 seconds.
        - Button state change message. Has ID = 1, and 1 byte of state 
          information which is 0 for "released" and "1" for pressed. This 
          message is emitted as a response to every button press/release
        - Led state change message. Has ID = 2, and 1 byte of state information 
          which is 0 for "off" and "1" for on. This message is emitted in
          response to incomming "Message state control" message which controls
          the state of the led.
        To see the output of this application use the "cat" in conjunction with
        "hexdump" commands on your Linux host machine:
          > cat /dev/ttyUSB0 | hexdump -v -C
        To emit the led control message on your host machine use printf 
        redirected to proper device file:
        Led on:  printf "\x48\x69\x04\x03\x01\x00\xb9" > /dev/ttyUSB0
        Led off: printf "\x48\x69\x04\x03\x00\x00\xb8" > /dev/ttyUSB0
        Don't forget to configure your serial device with stty utility.
        The UART1 configuration is:
        Baud: 115200; Parity: None; Stop bits: 1; Flow control: off.
        The Button configuration: GPIO 23, active (pressed) low.