|
Files |
file | otFPGA.h |
| FPGA Library for SharkDuino+.
|
Defines |
#define | FPGA_DATA (*((volatile unsigned char *) 0x20100000)) |
| FPGA Register data.
|
#define | FPGA_RADD (*((volatile unsigned char *) 0x20100002)) |
| FPGA Register address.
|
Enumerations |
enum | FpgaRegisterAddress {
FPGA_PA,
FPGA_PB,
FPGA_PC,
FPGA_PD,
FPGA_PE,
FPGA_PF,
FPGA_PG,
FPGA_PH,
FPGA_PI,
FPGA_PK,
FPGA_PL,
FPGA_PM,
FPGA_PN,
FPGA_PO,
FPGA_PP,
FPGA_PQ,
FPGA_PX_DATA,
FPGA_PX_DIR,
FPGA_PX_FUNL,
FPGA_PX_FUNH,
FPGA_CPL_DATA,
FPGA_CPL_DIR,
FPGA_CPL_FUNL,
FPGA_CPL_FUNH,
FPGA_CPH_DATA,
FPGA_CPH_DIR,
FPGA_CPH_FUNL,
FPGA_CPH_FUNH,
FPGA_PR,
FPGA_PS,
FPGA_PT,
FPGA_PU,
FPGA_PV,
FPGA_AUX1,
FPGA_AUX2,
FPGA_AUX3,
FPGA_FIFO,
FPGA_LB_ADD,
FPGA_LB_DATA
} |
enum | TimerTimeBase { TTB_1KHZ,
TTB_2_5MHZ,
TTB_PLLCLK,
TTB_25MHZ
} |
enum | Timers { F_TIMER_0,
F_TIMER_1
} |
enum | Encoders { ENCODER_0,
ENCODER_1,
ENCODER_2,
ENCODER_3
} |
enum | EncoderClock { E_250KHz,
E_500KHz,
E_2_5MHZ,
E_25MHZ
} |
enum | EncoderZeroEnable { E_0_ZERO = 0x20,
E_1_ZERO = 0x40,
E_23_ZERO = 0x80
} |
enum | EncoderZeroInput { E_0_ZERO_PORTX = 0x01,
E_0_ZERO_PCAM = 0x00,
E_1_ZERO_PORTX = 0x02,
E_1_ZERO_PCAM
} |
enum | EncoderInput {
E_0_PCAM = 0x04,
E_0_PORTX = 0x00,
E_1_PCAM = 0x08,
E_1_PORTX = 0x00,
E_2_PCAM = 0x10,
E_2_PORTX = 0x00,
E_3_PCAM = 0x20,
E_3_PORTX = 0x00
} |
enum | EventInput {
EI_PX_0,
EI_PX_1,
EI_PX_2,
EI_PX_3,
EI_PX_4,
EI_PX_5,
EI_PX_6,
EI_PX_7,
EI_PCAM_0,
EI_PCAM_1,
EI_PCAM_2,
EI_PCAM_3,
EI_PCAM_4,
EI_PCAM_5,
EI_PCAM_6,
EI_PCAM_7
} |
enum | EventFunctions { EVF_COUNTER,
EVF_FREQUENCY,
EVF_PULSEMEASURE
} |
enum | PortSettings {
PD_OUTPUT,
PD_FUNC_1,
PD_FUNC_2,
PD_FUNC_3,
PD_INPUT
} |
enum | CameraSocket {
SOCK_1,
SOCK_2,
SOCK_3,
SOCK_4,
SOCK_5
} |
enum | HiddenPort { HP_STDBY_CTRL = 0x04,
HP_STDBY = 0x08,
HP_LCD_LED = 0x40,
HP_EXT_I2C = 0x10
} |
enum | InterruptSignals {
IS_TOUCH = 1,
IS_EXTINT = 2,
IS_IMU = 4,
IS_TRIGX = 8,
IS_AUXIN = 16
} |
Functions |
void | FpgaInit () |
| Init the system FPGA. Call this function as first.
|
void | FpgaRegWrite (int reg, U16 val) |
| Write a FPGA register.
|
U16 | FpgaRegRead (int reg) |
| Read a FPGA register.
|
void | FpgaSetPll (int n, int m, int u, int vco) |
| Write registers of the clock synthesizer (PLL) Use FpgaPllConfig instead.
|
float | FpgaPllConfig (int n, int m, int u) |
| Clock synthesizer (PLL) configurator. Configure the PLL to set a requested frequency.
Output clock as Mhz = (25 / n * m) / u
Frequency range is 1.5 to 350MHz.
|
void | FpgaSpiSelect (U8 sel) |
| Select a chip select for a SPI device.
|
void | FpgaSpiWrite (U8 val) |
| Write a byte on the SPI channel reserved on PCAM port.
|
void | FpgaSpiWrite16 (U16 val) |
| Write a word on the SPI channel reserved on PCAM port.
|
void | FpgaTimerSet (U8 timer, U8 timeBase, U16 count) |
| Set Timer 0/1.
Output frequency 2: timeBase / ((n - 1) * 2). Duty cycle: 50%
Output frequency 1: timeBase / (n - 1). Duty Cycle: asymmetrical.
|
void | FpgaTimerEnable (U8 timer, bool ena) |
| Enable Timer 0/1.
.
|
void | FpgaEncoderSetup (U8 signalSource, U8 timeBase, U8 zeroSignals) |
| Configure all encoders 3:0.
.
|
S16 | FpgaEncoderRead (U8 encoder) |
| Read selected encoder counts.
.
|
void | FpgaEncoderClear (U8 encoder) |
| Clear selected encoder counter.
.
|
void | FpgaEventFunction (U8 input, U8 fun, float tb) |
| Configure the event counter.
Event counter can be configured as Counter, Frequency meter or Pulse width measurement.
|
void | FpgaEventGate (bool ena) |
| Enable the gate of the event counter.
|
void | FpgaEventSignalInvert (bool ena) |
| Set the level of the input for the event counter.
|
void | FpgaEventReset () |
| Clear the event counter.
|
void | FpgaEventClearRead () |
| Clear the EVENT DONE flag.
|
bool | FpgaEventDone () |
| Check the EVENT DONE flag.
|
U32 | FpgaEventRead () |
| Read the event read counter.
|
void | FpgaPortPxSet (U8 bit0, U8 bit1, U8 bit2, U8 bit3, U8 bit4, U8 bit5, U8 bit6, U8 bit7) |
| Configure the port PX (Y12). Each bit can be configured as bidirectional port or as preset function.
See PortSettings for set of bit and also see PX Port - Signals and functions for all possibilities.
|
U8 | FpgaPxGet () |
| Read the contents of the port signal.
|
void | FpgaPxPut (U8 dat) |
| Write a data on the port.
|
void | FpgaPCamlSet (U8 bit0, U8 bit1, U8 bit2, U8 bit3, U8 bit4, U8 bit5, U8 bit6, U8 bit7) |
| Configure the port PCAM (Y11) in the range 7:0.
Each bit can be configured as bidirectional port or as preset function.
See PortSettings for set of bit and also see PCAM - Camera port for all possibilities.
|
U8 | FpgaPCamlGet () |
| Read the contents of the port PCAM in the range 7:0.
|
void | FpgaPCamlPut (U8 dat) |
| Write a data on the port PCAM in the range 7:0.
|
void | FpgaPCamhSet (U8 bit8, U8 bit9, U8 bit10, U8 bit11, U8 bit12, U8 bit13, U8 bit14, U8 bit15) |
| Configure the port PCAM (Y11) in the range 15:8
Each bit can be configured as bidirectional port or as preset function.
See PortSettings for set of bit and also see PCAM - Camera port for all possibilities.
|
U8 | FpgaPCamhGet () |
| Read the contents of the port PCAM in the range 15:8.
|
void | FpgaPCamhPut (U8 dat) |
| Write a data on the port PCAM in the range 15:8.
|
void | FpgaSetCamBus (int bus, bool mask10bit) |
| Configure the PCAM port a for specific bus of a related camera.
|
void | FpgaSetCamBusWidth (int bus) |
| Select a different size of the camera bus.
|
U8 | FpgaIntSource () |
| Identifies the source that generated an interrupt.
|
void | FpgaIntClear () |
| Clear the interrupt request.
|
void | FpgaIntEnable (bool ena) |
| Enable/disable interrupt.
|
void | FpgaInterruptSignals (U8 bit, bool invert) |
| Invert an interrupt signal level see InterruptSignals.
|
void | FpgaHiddenPort (U8 value, bool ena) |
| Enable or disable a bit of the hidden port.
|
void | FpgaSenWrite (U16 add, U16 val) |
| Specific function for Tiziano camera. Don't use! Reserved!
|
void | FpgaLocalBusEnable () |
| Enable DSP local bus on Y11 connector. Only with FPGA ver. >= 1.5.
|
void | FpgaLocalBusAddress (U8 add) |
| Set the address A[3:0] of the local bus.
|
void | FpgaLocalBusWrite (U8 data) |
| Write data on the local bus.
|
void | FpgaLocalBusReadEnable (bool ena) |
| Enable/disable local bus direction.
|
U8 | FpgaLocalBusRead () |
| Read data from local bus.
|
* PCAM port (Y11) signals description
*
* Legenda:
* PCAM: Is the CAMERA port, PCAM[15:8] is controlled by FpgaPCamhSet while PCAM[7:0] by FpgaPCamlSet
* PF[11:0] Is the PF DSP port, it can be set as in or out
* FDO[7:0] Is the bus of the output FIFO.
* ENCx Encoder signals.
* PPI Image grabber inputs.
* Signals not documented in the below tabel:
* FDI[7:0] Is the bus of the input FIFO. It's connected to PCAM[7:0] input bus.
* PCAM[13] Is also the FIFO write enable signal related to FDI[7:0] bus.
* PCAM[12] Is also the FIFO write clock signal related to FDI[7:0] bus.
*
* PCAM[13] Is also the FIFO read enable signal related to FDO[7:0] bus.
* PCAM[12] Is also the FIFO read clock signal related to FDO[7:0] bus.
*
* SIGNAL PIN INPUT1 INPUT2 INPUT3 OUTPUT FUNCTION1 FUNCTION2 FUNCTION3 DESCRIPTION
* VCC 1 Camera power supply
* GND 2 Power return
* E_SCL 3 Extern TWI clock
* E_SDA 4 Extern TWI data
* PCAM[15] 5 PORT VSYNC PORT Port or VSYNC
* PCAM[14] 6 PORT HSYNC PORT PF11 Port or HSYNC
* PCAM[13] 7 PORT PIXCLK PORT PF10 Port or PIXCLK
* PCAM[12] 8 PORT PORT PLLCLK 25MHZ TIM1_2 Port or clock source
* PCAM[11] 9 PORT PPI[11] ENC3_Z PORT SPICLK FULL_0 Port,PPI,SPI,FIFO signals
* PCAM[10] 10 PORT PPI[10] ENC2_Z PORT MOSI FEMPTY_0 Port,PPI,SPI,FIFO signals
* PCAM [9] 11 PORT PPI[9] ENC1_Z PORT PF9 Port,PPI signals
* PCAM [8] 12 PORT PPI[8] ENC0_Z PORT PF8 Port,PPI signals
* PCAM [7] 13 PORT PPI[7] ENC3_B PORT PF7 FDO[7] Port,PPI,FIFO
* PCAM [6] 14 PORT PPI[6] ENC3_A PORT PF6 FDO[6] Port,PPI,FIFO
* PCAM [5] 15 PORT PPI[5] ENC2_B PORT PF5 FDO[5] Port,PPI,FIFO
* PCAM [4] 16 PORT PPI[4] ENC2_A PORT PF4 FDO[4] Port,PPI,FIFO
* PCAM [3] 17 PORT PPI[3] ENC1_B PORT PF3 FDO[3] RESET* Port,PPI,FIFO
* PCAM [2] 18 PORT PPI[2] ENC1_A PORT PF2 FDO[2] STDBY* Port,PPI,FIFO
* RESET 19 Active low, system reset
* STDBY 20 AUXIN PORT Multi purpose bit port
* PCAM [1] 21 PORT PPI[1] ENC0_B PORT PF1 FDO[1] Port,PPI,FIFO
* PCAM [0] 22 PORT PPI[0] ENC0_A PORT PF0 FDO[0] Port,PPI,FIFO
*
* RESET* and STDBY* is the output port used with this function.
*