Skip to content

Commit

Permalink
Latest commits (Ultibo core 1.1.145)
Browse files Browse the repository at this point in the history
Major additions:

 GPIO driver
 UART (Serial) driver
 Prolific PL2303 USB to Serial driver

See the forum announcements for more information
  • Loading branch information
ultibohub committed May 11, 2016
1 parent d262126 commit 7a230c3
Show file tree
Hide file tree
Showing 45 changed files with 13,608 additions and 460 deletions.
3 changes: 2 additions & 1 deletion source/rtl/ultibo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ ULTIBO_DRIVER_UNITS=rtlwifi \
rt2x00lib \
rt2800lib \
rt2x00usb \
rt2800usb
rt2800usb \
pl2303
ULTIBO_CODEPAGE_UNITS=cp720oem \
cp737oem \
cp775oem \
Expand Down
3 changes: 2 additions & 1 deletion source/rtl/ultibo/Makefile.fpc
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ ULTIBO_DRIVER_UNITS=rtlwifi \
rt2x00lib \
rt2800lib \
rt2x00usb \
rt2800usb
rt2800usb \
pl2303

ULTIBO_CODEPAGE_UNITS=cp720oem \
cp737oem \
Expand Down
2,212 changes: 2,201 additions & 11 deletions source/rtl/ultibo/core/bcm2708.pas

Large diffs are not rendered by default.

2,216 changes: 2,204 additions & 12 deletions source/rtl/ultibo/core/bcm2709.pas

Large diffs are not rendered by default.

2,210 changes: 2,200 additions & 10 deletions source/rtl/ultibo/core/bcm2710.pas

Large diffs are not rendered by default.

305 changes: 255 additions & 50 deletions source/rtl/ultibo/core/bcm2835.pas

Large diffs are not rendered by default.

310 changes: 257 additions & 53 deletions source/rtl/ultibo/core/bcm2836.pas

Large diffs are not rendered by default.

308 changes: 255 additions & 53 deletions source/rtl/ultibo/core/bcm2837.pas

Large diffs are not rendered by default.

200 changes: 173 additions & 27 deletions source/rtl/ultibo/core/devices.pas

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions source/rtl/ultibo/core/dma.pas
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ TDMAHost = record
{DMA Properties}
DMAId:LongWord; {Unique Id of this DMA host in the DMA host table}
DMAState:LongWord; {DMA state (eg DMA_STATE_ENABLED)}
HostStart:TDMAHostStart; {A Host specific HostStart method implementing the standard DMA host interface}
HostStop:TDMAHostStop; {A Host specific HostStop method implementing the standard DMA host interface}
HostReset:TDMAHostReset; {A Host specific HostReset method implementing the standard DMA host interface}
HostSubmit:TDMAHostSubmit; {A Host specific HostSubmit method implementing the standard DMA host interface}
HostCancel:TDMAHostCancel; {A Host specific HostCancel method implementing the standard DMA host interface}
HostProperties:TDMAHostProperties; {A Host specific HostProperties method implementing the standard DMA host interface}
HostStart:TDMAHostStart; {A Host specific HostStart method implementing the standard DMA host interface (Manadatory)}
HostStop:TDMAHostStop; {A Host specific HostStop method implementing the standard DMA host interface (Manadatory)}
HostReset:TDMAHostReset; {A Host specific HostReset method implementing the standard DMA host interface (Or nil if the default method is suitable)}
HostSubmit:TDMAHostSubmit; {A Host specific HostSubmit method implementing the standard DMA host interface (Manadatory)}
HostCancel:TDMAHostCancel; {A Host specific HostCancel method implementing the standard DMA host interface (Manadatory)}
HostProperties:TDMAHostProperties; {A Host specific HostProperties method implementing the standard DMA host interface (Or nil if the default method is suitable)}
{Driver Properties}
Lock:TMutexHandle; {Host lock}
Alignment:LongWord; {Host data buffer alignment}
Expand Down
2 changes: 1 addition & 1 deletion source/rtl/ultibo/core/filesystem.pas
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ interface
FILESYS_LOG_LEVEL_NONE = LOG_LEVEL_NONE; {No FileSystem messages}

var
FILESYS_DEFAULT_LOG_LEVEL:LongWord = FILESYS_LOG_LEVEL_INFO; {Minimum level for FileSystem messages. Only messages with level greater than or equal to this will be printed}
FILESYS_DEFAULT_LOG_LEVEL:LongWord = FILESYS_LOG_LEVEL_DEBUG; {Minimum level for FileSystem messages. Only messages with level greater than or equal to this will be printed}

var
{FileSystem logging}
Expand Down
2 changes: 1 addition & 1 deletion source/rtl/ultibo/core/ftp.pas
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ interface
FTP_LOG_LEVEL_NONE = LOG_LEVEL_NONE; {No FTP messages}

var
FTP_DEFAULT_LOG_LEVEL:LongWord = FTP_LOG_LEVEL_DEBUG; //FTP_LOG_LEVEL_INFO; {Minimum level for FTP messages. Only messages with level greater than or equal to this will be printed}
FTP_DEFAULT_LOG_LEVEL:LongWord = FTP_LOG_LEVEL_DEBUG; {Minimum level for FTP messages. Only messages with level greater than or equal to this will be printed}

var
{FTP logging}
Expand Down
69 changes: 50 additions & 19 deletions source/rtl/ultibo/core/globalconfig.pas
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,11 @@ interface
TIMER_REGS_BASE:LongWord; {The base address of the Timer registers (If Applicable)}
GPIO_REGS_BASE:LongWord; {The base address of the GPIO registers (If Applicable)}
UART_REGS_BASE:LongWord; {The base address of the primary UART registers (If Applicable)}

SPI_REGS_BASE:LongWord; {The base address of the primary SPI registers (If Applicable)}
I2C_REGS_BASE:LongWord; {The base address of the primary I2C registers (If Applicable)}
I2S_REGS_BASE:LongWord; {The base address of the primary I2S registers (If Applicable)}
PWM_REGS_BASE:LongWord; {The base address of the primary PWM registers (If Applicable)}

{==============================================================================}
{Interrupt configuration (Set by PeripheralInit)}
//var
Expand All @@ -444,15 +448,17 @@ interface
{LED configuration (Set by specific PlatformInit)}
var
{Power LED}
POWER_LED_PIN:LongWord; {The GPIO Pin for the Power LED (Where Applicable)}
POWER_LED_FUNCTION:LongWord; {The GPIO Function Select for the Power LED (Where Applicable)}
POWER_LED_ACTIVE_LOW:LongBool; {If True the Power LED is Active Low (Clear Pin to Turn On) (Where Applicable)}
POWER_LED_PIN:LongWord = GPIO_PIN_UNKNOWN; {The GPIO Pin for the Power LED (Where Applicable)}
POWER_LED_PULL:LongWord = GPIO_PULL_UNKNOWN; {The GPIO Pull Select for the Power LED (Where Applicable)}
POWER_LED_FUNCTION:LongWord = GPIO_FUNCTION_UNKNOWN; {The GPIO Function Select for the Power LED (Where Applicable)}
POWER_LED_ACTIVE_LOW:LongBool; {If True the Power LED is Active Low (Clear Pin to Turn On) (Where Applicable)}

var
{Activity LED}
ACTIVITY_LED_PIN:LongWord; {The GPIO Pin for the Activity LED (Where Applicable)}
ACTIVITY_LED_FUNCTION:LongWord; {The GPIO Function Select for the Activity LED (Where Applicable)}
ACTIVITY_LED_ACTIVE_LOW:LongBool; {If True the Activity LED is Active Low (Clear Pin to Turn On) (Where Applicable)}
ACTIVITY_LED_PIN:LongWord = GPIO_PIN_UNKNOWN; {The GPIO Pin for the Activity LED (Where Applicable)}
ACTIVITY_LED_PULL:LongWord = GPIO_PULL_UNKNOWN; {The GPIO Pull Select for the Activity LED (Where Applicable)}
ACTIVITY_LED_FUNCTION:LongWord = GPIO_FUNCTION_UNKNOWN; {The GPIO Function Select for the Activity LED (Where Applicable)}
ACTIVITY_LED_ACTIVE_LOW:LongBool; {If True the Activity LED is Active Low (Clear Pin to Turn On) (Where Applicable)}

{==============================================================================}
{Console and FrameBuffer configuration}
Expand All @@ -474,8 +480,8 @@ interface
CONSOLE_DMA_CLEAR:LongBool = True; {If True then use DMA (If avaialable) to clear console windows (Sets CONSOLE_FLAG_DMA_CLEAR on device)}
CONSOLE_DMA_SCROLL:LongBool = True; {If True then use DMA (If avaialable) to scroll console windows (Sets CONSOLE_FLAG_DMA_SCROLL on device)}

CONSOLE_REGISTER_LOGGING:LongBool = False; {If True then register Console as a Logging device on boot}
CONSOLE_LOGGING_DEFAULT:LongBool = False; {If True then Console can be the default Logging device}
CONSOLE_REGISTER_LOGGING:LongBool = False; {If True then register any Console device as a Logging device (Only if Console unit included)}
CONSOLE_LOGGING_DEFAULT:LongBool = False; {If True then a Console device can be the default Logging device}
CONSOLE_LOGGING_POSITION:LongWord = CONSOLE_POSITION_RIGHT; {The default Console Window position for the console Logging device}

var
Expand Down Expand Up @@ -566,6 +572,13 @@ interface
{Host defaults}
HOST_SHARED_MEMORY:LongBool; {Hosts are allocated from Shared memory regions if True}

{==============================================================================}
{Serial configuration}
var
SERIAL_REGISTER_LOGGING:LongBool = False; {If True then register any Serial device as a Logging device (Only if Serial unit included)}
SERIAL_LOGGING_DEFAULT:LongBool = False; {If True then a Serial device can be the default Logging device}
SERIAL_LOGGING_PARAMETERS:String = '0,N,8,1'; {The default serial settings for the serial logging device (BaudRate,Parity,DataBits,StopBits)(BaudRate 0 equals use default rate)}

{==============================================================================}
{Logging configuration}
var
Expand All @@ -579,15 +592,9 @@ interface
var
{GPIO}
GPIO_PIN_COUNT:LongWord; {The number of GPIO pins available on this board}
//GPIO_FUNCTION_COUNT:LongWord; {The number of GPIO function selects available on this board}

//GPIO_PIN_VALUES:array of LongWord;
//GPIO_FUNCTION_VALUES:array of LongWord;
//To Do //More

{Virtual GPIO}
VIRTUAL_GPIO_PIN_COUNT:LongWord; {The number of Virtual GPIO pins available on this board}
//To Do

{USB}
USB_AUTOSTART:LongBool = True; {If True then auto start the USB subsystem on boot (Only if USB unit included)}
Expand Down Expand Up @@ -672,7 +679,8 @@ interface
BCM2708_REGISTER_PWM:LongBool = True; {If True then register the BCM2708 PWM device during boot (Only if BCM2708 unit included)}
BCM2708_REGISTER_PCM:LongBool = True; {If True then register the BCM2708 PCM device during boot (Only if BCM2708 unit included)}
BCM2708_REGISTER_GPIO:LongBool = True; {If True then register the BCM2708 GPIO device during boot (Only if BCM2708 unit included)}
BCM2708_REGISTER_UART:LongBool = True; {If True then register the BCM2708 UART device during boot (Only if BCM2708 unit included)}
BCM2708_REGISTER_UART0:LongBool = True; {If True then register the BCM2708 UART0 device during boot (Only if BCM2708 unit included)}
BCM2708_REGISTER_UART1:LongBool = True; {If True then register the BCM2708 UART1 device during boot (Only if BCM2708 unit included)}
BCM2708_REGISTER_SDHCI:LongBool = True; {If True then register the BCM2708 SDHCI host during boot (Only if BCM2708 unit included)}

BCM2708_REGISTER_CLOCK:LongBool = True; {If True then register the BCM2708 Clock device during boot (Only if BCM2708 unit included)}
Expand Down Expand Up @@ -701,7 +709,8 @@ interface
BCM2709_REGISTER_PWM:LongBool = True; {If True then register the BCM2709 PWM device during boot (Only if BCM2709 unit included)}
BCM2709_REGISTER_PCM:LongBool = True; {If True then register the BCM2709 PCM device during boot (Only if BCM2709 unit included)}
BCM2709_REGISTER_GPIO:LongBool = True; {If True then register the BCM2709 GPIO device during boot (Only if BCM2709 unit included)}
BCM2709_REGISTER_UART:LongBool = True; {If True then register the BCM2709 UART device during boot (Only if BCM2709 unit included)}
BCM2709_REGISTER_UART0:LongBool = True; {If True then register the BCM2709 UART0 device during boot (Only if BCM2709 unit included)}
BCM2709_REGISTER_UART1:LongBool = True; {If True then register the BCM2709 UART1 device during boot (Only if BCM2709 unit included)}
BCM2709_REGISTER_SDHCI:LongBool = True; {If True then register the BCM2709 SDHCI host during boot (Only if BCM2709 unit included)}

BCM2709_REGISTER_CLOCK:LongBool = True; {If True then register the BCM2709 Clock device during boot (Only if BCM2709 unit included)}
Expand Down Expand Up @@ -730,7 +739,8 @@ interface
BCM2710_REGISTER_PWM:LongBool = True; {If True then register the BCM2710 PWM device during boot (Only if BCM2710 unit included)}
BCM2710_REGISTER_PCM:LongBool = True; {If True then register the BCM2710 PCM device during boot (Only if BCM2710 unit included)}
BCM2710_REGISTER_GPIO:LongBool = True; {If True then register the BCM2710 GPIO device during boot (Only if BCM2710 unit included)}
BCM2710_REGISTER_UART:LongBool = True; {If True then register the BCM2710 UART device during boot (Only if BCM2710 unit included)}
BCM2710_REGISTER_UART0:LongBool = True; {If True then register the BCM2710 UART0 device during boot (Only if BCM2710 unit included)}
BCM2710_REGISTER_UART1:LongBool = True; {If True then register the BCM2710 UART1 device during boot (Only if BCM2710 unit included)}
BCM2710_REGISTER_SDHCI:LongBool = True; {If True then register the BCM2710 SDHCI host during boot (Only if BCM2710 unit included)}

BCM2710_REGISTER_CLOCK:LongBool = True; {If True then register the BCM2710 Clock device during boot (Only if BCM2710 unit included)}
Expand Down Expand Up @@ -972,6 +982,10 @@ interface
{==============================================================================}
{Specific Driver configuration}
var
{PL2303}
PL2303_MAX_TRANSMIT:LongWord; {The maximum transmit size of the PL2303 USB to Serial converter (Defaults to maximum supported by the device if not specified)}

{RT2800USB}
RT2800USB_HARDWARE_ENCRYPTION_DISABLED:LongBool; {If True then use software only encryption for RT2800USB}

{==============================================================================}
Expand All @@ -988,7 +1002,9 @@ function Max(A,B:LongInt):LongInt; inline;
function Clamp(Value,Low,High:LongInt):LongInt;

function RoundUp(Value,Multiple:LongWord):LongWord;
function RoundDown(Value,Multiple:LongWord):LongWord;
function RoundDown(Value,Multiple:LongWord):LongWord;

function DivRoundClosest(Value,Divisor:LongInt):LongWord;

function HIWORD(L:LongInt):Word; inline;
function LOWORD(L:LongInt):Word; inline;
Expand Down Expand Up @@ -1130,6 +1146,21 @@ function RoundDown(Value,Multiple:LongWord):LongWord;

{==============================================================================}

function DivRoundClosest(Value,Divisor:LongInt):LongWord;
begin
{}
if ((Value - 1) > 0) or ((Divisor - 1) > 0) or (Value > 0) then
begin
Result:=(Value + (Divisor div 2)) div Divisor;
end
else
begin
Result:=(Value - (Divisor div 2)) div Divisor;
end;
end;

{==============================================================================}

function HIWORD(L:LongInt):Word; inline;
begin
{}
Expand Down
60 changes: 57 additions & 3 deletions source/rtl/ultibo/core/globalconst.pas
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ interface
{Global constants}
const
{Version constants}
ULTIBO_RELEASE_DATE = '27/4/2016';
ULTIBO_RELEASE_DATE = '11/5/2016';
ULTIBO_RELEASE_NAME = 'Cucumber';
ULTIBO_RELEASE_VERSION = '1.1.127';
ULTIBO_RELEASE_VERSION = '1.1.145';
ULTIBO_RELEASE_VERSION_MAJOR = 1;
ULTIBO_RELEASE_VERSION_MINOR = 1;
ULTIBO_RELEASE_VERSION_REVISION = 127;
ULTIBO_RELEASE_VERSION_REVISION = 145;

{==============================================================================}
const
Expand Down Expand Up @@ -650,6 +650,10 @@ interface
GPIO_PIN_59 = 59;
GPIO_PIN_60 = 60;

GPIO_PIN_MAX = 60;

GPIO_PIN_UNKNOWN = LongWord(-1);

const
{GPIO Function constants}
GPIO_FUNCTION_IN = 0;
Expand All @@ -661,17 +665,36 @@ interface
GPIO_FUNCTION_ALT4 = 6;
GPIO_FUNCTION_ALT5 = 7;

GPIO_FUNCTION_UNKNOWN = LongWord(-1); {Returned by GPIOFunctionGet on error (eg device does not support reading the function state)}

const
{GPIO Level constants}
GPIO_LEVEL_LOW = 0;
GPIO_LEVEL_HIGH = 1;

GPIO_LEVEL_UNKNOWN = LongWord(-1); {Returned by GPIOInputGet/Wait on error (eg device does not exist)}

const
{GPIO Pull constants}
GPIO_PULL_NONE = 0;
GPIO_PULL_UP = 1;
GPIO_PULL_DOWN = 2;

GPIO_PULL_UNKNOWN = LongWord(-1); {Returned by GPIOPullGet on error (eg device does not support reading the PullUp/Down state)}

const
{GPIO Trigger constants}
GPIO_TRIGGER_NONE = 0;
GPIO_TRIGGER_LOW = 1;
GPIO_TRIGGER_HIGH = 2;
GPIO_TRIGGER_RISING = 3;
GPIO_TRIGGER_FALLING = 4;
GPIO_TRIGGER_ASYNC_RISING = 5;
GPIO_TRIGGER_ASYNC_FALLING = 6;
GPIO_TRIGGER_EDGE = 7;

GPIO_TRIGGER_UNKNOWN = LongWord(-1); {Passed to GPIO callback event when device does not support determining the trigger source}

{==============================================================================}
const
{Virtual GPIO Pin constants}
Expand All @@ -683,6 +706,37 @@ interface
VIRTUAL_GPIO_FUNCTION_IN = 0;
VIRTUAL_GPIO_FUNCTION_OUT = 1;

{==============================================================================}
const
{Serial Baud Rate constants}
SERIAL_BAUD_RATE_DEFAULT = 0;

SERIAL_BAUD_RATE_STANDARD = 115200; {If SERIAL_BAUD_RATE_DEFAULT is passed to SerialOpen then this is the baud rate to use}
SERIAL_BAUD_RATE_FALLBACK = 9600; {The fallback baud rate if SERIAL_BAUD_RATE_STANDARD is not supported by the device}

{Serial Data bit constants}
SERIAL_DATA_8BIT = 8;
SERIAL_DATA_7BIT = 7;
SERIAL_DATA_6BIT = 6;
SERIAL_DATA_5BIT = 5;

{Serial Stop bit constants}
SERIAL_STOP_1BIT = 1;
SERIAL_STOP_2BIT = 2;
SERIAL_STOP_1BIT5 = 3; {1.5 Stop bits}

{Serial Parity constants}
SERIAL_PARITY_NONE = 0;
SERIAL_PARITY_ODD = 1;
SERIAL_PARITY_EVEN = 2;
SERIAL_PARITY_MARK = 3;
SERIAL_PARITY_SPACE = 4;

{Serial Flow Control constants}
SERIAL_FLOW_NONE = 0;
SERIAL_FLOW_RTS_CTS = 1;
SERIAL_FLOW_DSR_DTR = 2;

{==============================================================================}
const
{Power ID constants}
Expand Down
Loading

0 comments on commit 7a230c3

Please sign in to comment.