author: bocianu bocianu@gmail.com
Set of procedures to cover Neo6502 UExt communication capabilities. More about Neo6502:
https://www.olimex.com/Products/Retro-Computers/Neo6502/open-source-hardware
https://www.neo6502.com/
API documentation can be found here:
https://github.com/paulscottrobson/neo6502-firmware/wiki
It's work in progress, so please report any bugs you will find.
name: | value: | description: |
---|---|---|
GPIO_PINMODE_INPUT | 1 | i/o directions |
GPIO_PINMODE_OUTPUT | 2 | |
GPIO_PINMODE_ANALOGUE | 3 | |
GPIO_HIGH | 1 | GPIO pin value for level HIGH |
GPIO_LOW | 0 | GPIO pin value for level LOW |
UART_PROTOCOL_8N1 | 0 |
name: | description: |
---|---|
NeoUExtInitialize | procedure NeoUExtInitialize;Initialize the UExt I/O system. This resets the IO system to its default state, where all UEXT pins are I/O pins, inputs and enabled. |
NeoWriteGPIO | procedure NeoWriteGPIO(pin,val:byte);This copies the value to the output latch for selected pin. This will only display on the output pin if it is enabled, and its direction is set to output.
parameters: |
NeoReadGPIO | function NeoReadGPIO(pin:byte):byte;If the pin is set to input, reads the level on pin on UEXT Params[0]. If it is set to output this reads the output latch for UEXT port Params[0].
parameters:returns: |
NeoSetDirection | procedure NeoSetDirection(pin,dir:byte);Set the port direction for UEXT Port.
parameters: |
NeoWriteI2C | procedure NeoWriteI2C(dev,reg,val:byte);Write to I2C Device dev, Register reg, value val. Does not fail if device not present.
parameters: |
NeoReadI2C | function NeoReadI2C(dev,reg:byte):byte;Read from I2C Device dev, Register reg. If the device is not present this will cause an error.
parameters:returns: |
NeoReadAnalog | function NeoReadAnalog(pin:byte):integer;Read the analogue value on specified UEXT Pin. This has to be set to analogue type to work. Returns a value from 0..4095, which represents an input value of 0 to 3.3 volts.
parameters:returns: |
NeoCheckI2C | function NeoCheckI2C(dev:byte):byte;Try to read from specified I2C Device. If tha data is present returns non-zero value.
parameters:returns: |
NeoReadBlockI2C | procedure NeoReadBlockI2C(dev:byte;addr,len:word);Try to read a block of memory from specified I2C Device.
parameters: |
NeoWriteBlockI2C | procedure NeoWriteBlockI2C(dev:byte;addr,len:word);Try to write a block from memory to specified I2C Device.
parameters: |
NeoReadBlockSPI | procedure NeoReadBlockSPI(addr,len:word);Try to read a block of memory from SPI Device.
parameters: |
NeoWriteBlockSPI | procedure NeoWriteBlockSPI(addr,len:word);Try to write a block from memory to SPI Device.
parameters: |
NeoReadBlockUART | procedure NeoReadBlockUART(addr,len:word);Try to read a block of memory from the UART.
parameters: |
NeoWriteBlockUART | procedure NeoWriteBlockUART(addr,len:word);Try to write a block from memory to the UART.
parameters: |
NeoSetupUART | procedure NeoSetupUART(baudrate:cardinal;protocol:byte);Set the Baud Rate and Serial Protocol for the UART interface. Currently only 8N1 is supported (0).
parameters: |
NeoWriteByteUART | procedure NeoWriteByteUART(b:byte);Try to write a byte to the UART.
parameters: |
NeoReadByteUART | function NeoReadByteUART():byte;Try to read a byte from the UART.
returns: |
NeoCheckUART | function NeoCheckUART():byte;See if a byte is available in the UART input buffer.
returns: |