This commit does not include as much new functionality as the last major release (which included the VideoCore IV support) but adds many new features and enhancements as well as a significant number of fixes.
List of changes:
- New SenseHAT driver for 8x8 LED matrix and joystick
- Mouse cursor (pointer) support for all framebuffer types
- Text caret (cursor) support for all console types
- Line editing and history capability for text console and console shell
- New graphics window functions for plotting diagonal lines and circles
- New options for ShellUpdate unit to update firmware files or user defined files
- New option to allow use of a proxy server by ShellUpdate unit
- Implementation of many IP Helper API functions
- Add new WARN level to all logging functions
- Fix for PL011 UART0 driver not reporting first byte when using PEEK_BUFFER or NON_BLOCK
- New Serial and UART functions for SetProperties, Get/SetStatus and Wait
- Fix UDP, RAW, ICMP SendTo functions to bind on first use as per Winsock spec
- Fix GraphicsWindowDrawChar/DrawCharEx/DrawText/DrawTextEx off by one calculating max width and height
- Fix FramebufferDeviceWrite adding extra row to dirty region mark when not required
- Fix UDP/TCPClient.RemoteHost using DNS to resolve a numeric address
- Fix DNS Client sends request for A record when name is an IP address
- Implement realpath, fsync, inet_pton, inet_ntop, getaddrinfo, getnameinfo and freeaddrinfo in Syscalls unit
- Fix incorrect check for COLOR_NONE in FramebufferDeviceFillRect
- Change TSystemCallRequest parameters to PtrUInt for architecture independence
- Fix UART0 RTS/CTS when using 4 wire serial port
- Update PlatformRPi2, PlatformRPi3 to support RPi2B revision 2 (BCM2837)
- Change STARTUP_ADDRESS to be based on _text_start instead of a fixed value
- Fix console rows and columns value not updating correctly when changing to a smaller font
- New console window activate, deactivate, next and previous functions
- Updates to support detection of new Raspberry Pi 3B+
This commit includes a partial driver for the official Raspberry Pi SenseHAT which provides support for the 8x8 LED matrix and the joystick, to use the new driver simply include the RPiSenseHAT unit in your project.
The LED matrix is represented as a framebuffer device and can be accessed using the standard framebuffer or console API, in particular the graphics console unit can be used to draw individual pixels or even shapes and text.
The joystick appears as a keyboard device so the buttons are presented as the up, down, left, right and enter keys, this means input from the joystick will appear in the standard keyboard functions and also in ConsoleReadKey etc.
It is expected that the remaining functions of the SenseHAT, including the temperature, pressure and humidity sensors as well as the gyroscope and accelerometer will be supported in a future update.
Mouse cursor support
As part of expanding support to include all of the elements needed to create useful graphical interfaces and to allow uniform behavior of APIs across all platforms this update includes mouse cursor (pointer) support for all framebuffer devices. Some devices, such as the Raspberry Pi, provide a hardware mouse cursor while others require the cursor to be implemented in software. This means that mouse cursor support now works on QEMU and on TFT LCD devices as well as on the Raspberry Pi HDMI and touch displays, you can even have cursors on multiple displays and track them independently with different mice or pointing devices.
The framebuffer API now includes the following functions which can be used to display and update the mouse cursor regardless of whether it is implemented in software or hardware:
- FramebufferDeviceSetCursor - Set the mouse cursor image and properties
- FramebufferDeviceUpdateCursor - Update the position and state of the mouse cursor
Text caret support
The console device has up to now lacked the ability to display a text caret (cursor) at the current point in the line in order to indicate where text input will occur. This commit provides a complete implementation of text caret support for the console framebuffer device (any console device that is backed by a framebuffer) to allow creating and manipulating multiple carets on the display. Other console devices can provide caret support if required by implementing 3 simple functions in their driver.
In addition the console window API has been extended to support showing, hiding, positioning and changing the shape of the text cursor for any current window, see the ConsoleWindowGetCursor*, ConsoleWindowGetCursor* and ConsoleWindowCursor* functions for more information. The cursor support is also available on graphics console windows.
When using the cursor via the console window API it is not necessary to directly call any of the new console device functions (ConsoleDeviceAddCaret, ConsoleDeviceDeleteCaret, ConsoleDeviceUpdateCaret) as the window functions perform all of the required calls for you.
Console line editing and history
Using the new text caret support the console window API has now been enhanced to include a complete line editing and history capability. When calling ConsoleReadLn the line editing and history is automatically enabled to allow use of the left, right, up, down, home, end, delete and insert keys to perform both insert and overtype actions.
A number of new console window functions have also been added to support targeting a specific console window and customizing the behavior, these include:
- ConsoleWindowRead - As per ConsoleRead but targeted to a specific console window
- ConsoleWindowReadLn - As per ConsoleReadLn but targeted to a specific console window
- ConsoleWindowReadLnEx - Extended version to allow controlling all aspects of the read including history, scrolling, colors and tab completion callbacks.
New ShellUpdate unit options
Based on a number of suggestions the ShellUpdate unit has been expanded to include support for updating the Raspberry Pi firmware files as well as updating any file specified on the command line.
A check or update of the firmware files can be initiated by typing UPDATE CHECK FIRMWARE (or UPDATE GET FIRMWARE) at the shell prompt, this will look in the same location as the standard kernel update so you can copy the required firmware files (bootcode.bin, start.elf and fixup.dat) to the same directory on your webserver where you place your kernel images.
Any file can be checked or updated using the command UPDATE CHECK FILE <FILENAME> (or UPDATE GET FILE <FILENAME>) at the shell prompt, again this looks in the same location on your webserver as for kernel updates. For more information and examples type HELP UPDATE at the shell prompt.
The ShellUpdate unit can also now use a proxy server for performing updates by specifying the server and port in the SHELL_UPDATE_HTTP_PROXY setting in cmdine.txt or using the UPDATE SET PROXY command.
New Serial and UART functions
A number of new functions have been added to expand the capability of the Serial and UART API in order to support different use cases. These include:
- SerialDeviceSetProperties / UARTDeviceSetProperties - Set the properties for the specified device (eg change the baud rate or other settings)
- SerialDeviceGetStatus / UARTDeviceGetStatus - Get the line status of the specified device (eg RTS, CTS, DTR etc)
- SerialDeviceSetStatus / UARTDeviceSetStatus - Set the line status of the specified device (eg RTS, CTS, DTR etc)
- SerialDeviceWait / UARTDeviceWait - Wait for data to be available in the receive or transmit buffers of the specified device
The Synapse synaser unit has also been updated to use a number of these functions resulting in a more efficient implementation.
New console window functions
This commit adds the concept of an active window to the console window API in addition to the existing default window. The active window is, by default, outlined in a different color to other windows and is the one that displays its text caret (if enabled).
For some cases this may require an additional check in your code if you are calling ConsoleReadLn to input text from the keyboard, normally if only one console window exists it will be both the active window and the default window. However if you create multiple windows then you may need to explicitly activate the correct window before calling ConsoleReadLn or ConsoleWindowReadLn to input text.
The new functions available are:
- ConsoleWindowActivate - Make an existing console window the active window
- ConsoleWindowDeactivate - Make an existing console window inactive
- ConsoleWindowNext - Get the next console window starting with the active window
- ConsoleWindowPrevious - Get the previous console window starting with the active window
Raspberry Pi 3B+ detection
The platform units have been updated to detect the new board identifier of the Raspberry Pi 3B+ and correctly configure the run time environment for it. The new gigabit ethernet interface is not yet supported as it requires a new driver to be written, all other functionality of the 3B+ appears to be working however extensive testing has not yet been completed.
Using the Raspberry Pi 3B+ requires the latest firmware files which are available from https://github.com/raspberrypi/firmware/
For details of how to apply the latest source to your Ultibo core installation and rebuild your run time library see the wiki page Building from Source or watch the Building the RTL video on YouTube.