 |
ADI iSensor FX3 Firmware
v2.9.4-pub
Firmware for the Analog Devices EVAL-ADIS-FX3 IMU Evaluation Platform. This firmware can be compiled using the Cypress EZ USB Suite IDE
|
Go to the documentation of this file.
19 #ifndef PIN_FUNCTIONS_H
20 #define PIN_FUNCTIONS_H
54 CyU3PReturnStatus_t
AdiPulseWait(uint16_t transferLength);
55 CyU3PReturnStatus_t
AdiSetPin(uint16_t pinNumber, CyBool_t polarity);
57 CyU3PReturnStatus_t
AdiWaitForPin(uint32_t pinNumber, CyU3PGpioIntrMode_t interruptSetting, uint32_t timeoutTicks);
76 #define ADI_3_3V_EN (33)
79 #define ADI_5V_EN (34)
82 #define ADI_ID_PIN_0 (17)
85 #define ADI_ID_PIN_1 (15)
88 #define ADI_FLASH_WRITE_ENABLE_PIN (35)
91 #define ADI_DEBUG_TX_PIN (48)
94 #define ADI_I2C_SCL_PIN (58)
97 #define ADI_I2C_SDA_PIN (59)
100 #define ADI_USER_LED_PIN (13)
103 #define ADI_TIMER_PIN (24)
110 #define ADI_DIO1_INTERRUPT_FLAG (1 << 0)
113 #define ADI_DIO2_INTERRUPT_FLAG (1 << 1)
116 #define ADI_DIO3_INTERRUPT_FLAG (1 << 2)
119 #define ADI_DIO4_INTERRUPT_FLAG (1 << 3)
122 #define FX3_GPIO1_INTERRUPT_FLAG (1 << 4)
125 #define FX3_GPIO2_INTERRUPT_FLAG (1 << 5)
128 #define FX3_GPIO3_INTERRUPT_FLAG (1 << 6)
131 #define FX3_GPIO4_INTERRUPT_FLAG (1 << 7)
CyU3PReturnStatus_t AdiPulseDrive()
This function drives a GPIO pin for a specified number of milliseconds, then returns it to the starti...
Definition: PinFunctions.c:781
PinState
Definition: PinFunctions.h:41
CyU3PReturnStatus_t AdiWaitForPin(uint32_t pinNumber, CyU3PGpioIntrMode_t interruptSetting, uint32_t timeoutTicks)
This function blocks the execution of the current thread until an event happens on the specified GPIO...
Definition: PinFunctions.c:1093
void AdiReturnBulkEndpointData(CyU3PReturnStatus_t status, uint16_t length)
Sends a function result to the PC via the ChannelToPC endpoint.
Definition: HelperFunctions.c:49
CyU3PReturnStatus_t AdiPinRead(uint16_t pin)
This function handles Pin read control end point requests.
Definition: PinFunctions.c:1147
uint16_t ADI_PIN_DIO1
Definition: main.h:122
uint16_t ADI_PIN_DIO3
Definition: main.h:128
PinResistorSetting
Definition: PinFunctions.h:27
#define GCTL_WPD_CFG
Definition: main.h:404
uint32_t TimerPinConfig
Definition: main.h:162
uint16_t FX3_PIN_GPIO1
Definition: main.h:134
#define GCTL_WPU_CFG_UPPR
Definition: main.h:413
uint16_t FX3_PIN_GPIO3
Definition: main.h:140
void AdiGetBoardPinInfo(uint8_t *outBuf)
Gets the programmed board type and pin mapping info.
Definition: PinFunctions.c:37
CyU3PReturnStatus_t AdiMeasurePinDelay(uint16_t transferLength)
Measures the delay from a trigger pin edge (sync) to a busy pin edge.
Definition: PinFunctions.c:271
CyU3PReturnStatus_t AdiPulseDrive()
This function drives a GPIO pin for a specified number of milliseconds, then returns it to the starti...
Definition: PinFunctions.c:781
#define ADI_ID_PIN_1
Definition: PinFunctions.h:85
CyU3PReturnStatus_t AdiPulseWait(uint16_t transferLength)
This function waits for a pin to reach a selected logic level. The PulseWait parameters are passed in...
Definition: PinFunctions.c:899
CyU3PReturnStatus_t AdiPinRead(uint16_t pin)
This function handles Pin read control end point requests.
Definition: PinFunctions.c:1147
@ Low
Definition: PinFunctions.h:43
uint16_t FX3_PIN_GPIO4
Definition: main.h:143
FX3BoardType BoardType
Definition: main.h:189
@ High
Definition: PinFunctions.h:46
CyBool_t AdiIsValidGPIO(uint16_t GpioId)
Determines if a GPIO pin is valid for the FX3 Application firmware to set.
Definition: PinFunctions.c:222
CyU3PReturnStatus_t AdiConfigurePinInterrupt(uint16_t pin, CyBool_t polarity)
configures the selected pin as an interrupt with edge triggering based on polarity
Definition: PinFunctions.c:1430
CyU3PReturnStatus_t AdiSetPinResistor(uint16_t pin, PinResistorSetting setting)
Configure GPIO input stage pull up / pull down resistor.
Definition: PinFunctions.c:151
uint32_t AdiMStoTicks(uint32_t desiredStallTime)
Converts milliseconds to number of ticks and adjusts the resulting offset if below the measurable min...
Definition: PinFunctions.c:1132
CyU3PReturnStatus_t AdiReadTimerValue()
Reads the current value from the complex GPIO timer and then sends the value over the control endpoin...
Definition: PinFunctions.c:1223
#define ADI_FLASH_WRITE_ENABLE_PIN
Definition: PinFunctions.h:88
#define GCTL_WPU_CFG
Definition: main.h:410
#define ADI_TIMER_PIN
Definition: PinFunctions.h:103
uint32_t AdiReadTimerRegValue()
Reads the current value of the 10MHz timer (32 bit)
Definition: PinFunctions.c:1205
#define ADI_5V_EN
Definition: PinFunctions.h:79
uint16_t ADI_PIN_DIO2
Definition: main.h:125
@ PullDown
Definition: PinFunctions.h:32
@ PullUp
Definition: PinFunctions.h:35
PinState AdiGetPinState(uint16_t pin)
Determine state of an input pin (high, low, high Z)
Definition: PinFunctions.c:77
CyU3PReturnStatus_t AdiMeasurePinFreq()
Measure the data ready frequency for a user specified pin.
Definition: PinFunctions.c:1255
void AdiGetBoardPinInfo(uint8_t *outBuf)
Gets the programmed board type and pin mapping info.
Definition: PinFunctions.c:37
uint32_t AdiMStoTicks(uint32_t timeInMS)
Converts milliseconds to number of ticks and adjusts the resulting offset if below the measurable min...
Definition: PinFunctions.c:1132
Struct to store the current board state (SPI config, USB speed, etc)
Definition: main.h:148
@ None
Definition: PinFunctions.h:29
#define ADI_3_3V_EN
Definition: PinFunctions.h:76
#define GCTL_WPD_CFG_UPPR
Definition: main.h:407
CyU3PReturnStatus_t AdiMeasureBusyPulse(uint16_t transferLength)
Sets a user configurable trigger condition and then measures the following GPIO pulse.
Definition: PinFunctions.c:434
#define MS_TO_TICKS_MULT
Definition: main.h:372
FX3PinMap PinMap
Definition: main.h:192
CyU3PReturnStatus_t AdiSleepForMicroSeconds(uint32_t numMicroSeconds)
This function blocks thread execution for a specified number of microseconds.
Definition: HelperFunctions.c:73
uint16_t ADI_PIN_RESET
Definition: main.h:119
CyU3PReturnStatus_t AdiSetPin(uint16_t pinNumber, CyBool_t polarity)
This function configures the specified pin as an output and drives it with the desired value.
Definition: PinFunctions.c:1043
uint16_t ADI_PIN_DIO4
Definition: main.h:131
uint16_t DrPin
Definition: main.h:168
CyU3PReturnStatus_t AdiWaitForPin(uint32_t pinNumber, CyU3PGpioIntrMode_t interruptSetting, uint32_t timeoutTicks)
This function blocks the execution of the current thread until an event happens on the specified GPIO...
Definition: PinFunctions.c:1093
PinState AdiGetPinState(uint16_t pin)
Determine state of an input pin (high, low, high Z)
Definition: PinFunctions.c:77
CyU3PReturnStatus_t AdiMeasurePinFreq()
Measure the data ready frequency for a user specified pin.
Definition: PinFunctions.c:1255
CyU3PReturnStatus_t AdiConfigurePWM(CyBool_t EnablePWM)
This function configures the FX3 PWM outputs (enable or disable).
Definition: PinFunctions.c:669
BoardState FX3State
Definition: main.c:112
Header file for all the pin I/O and timing related functions.
Main header file for the Analog Devices iSensor FX3 Demonstration Platform firmware.
CyU3PEvent GpioHandler
Definition: main.c:63
CyBool_t AdiIsValidGPIO(uint16_t GpioId)
Determines if a GPIO pin is valid for the FX3 Application firmware to set.
Definition: PinFunctions.c:222
@ PinFunctions_c
Definition: ErrorLog.h:51
CyU3PReturnStatus_t AdiReadTimerValue()
Reads the current value from the complex GPIO timer and then sends the value over the control endpoin...
Definition: PinFunctions.c:1223
#define ADI_TIMER_PIN_INDEX
Definition: main.h:381
uint32_t AdiReadTimerRegValue()
Reads the current value of the 10MHz timer (32 bit)
Definition: PinFunctions.c:1205
#define ADI_I2C_SCL_PIN
Definition: PinFunctions.h:94
CyU3PReturnStatus_t AdiMeasurePinDelay(uint16_t transferLength)
Measures the delay from a trigger pin edge (sync) to a busy pin edge.
Definition: PinFunctions.c:271
#define ADI_I2C_SDA_PIN
Definition: PinFunctions.h:97
CyU3PReturnStatus_t AdiSetPin(uint16_t pinNumber, CyBool_t polarity)
This function configures the specified pin as an output and drives it with the desired value.
Definition: PinFunctions.c:1043
CyU3PReturnStatus_t AdiPulseWait(uint16_t transferLength)
This function waits for a pin to reach a selected logic level. The PulseWait parameters are passed in...
Definition: PinFunctions.c:899
@ HighZ
Definition: PinFunctions.h:49
uint16_t FX3_PIN_GPIO2
Definition: main.h:137
CyU3PReturnStatus_t AdiConfigurePWM(CyBool_t EnablePWM)
This function configures the FX3 PWM outputs (enable or disable).
Definition: PinFunctions.c:669
void AdiLogError(FileIdentifier File, uint32_t Line, uint32_t ErrorCode)
Logs a firmware error to flash memory for later examination.
Definition: ErrorLog.c:51
CyU3PReturnStatus_t AdiMeasureBusyPulse(uint16_t transferLength)
Sets a user configurable trigger condition and then measures the following GPIO pulse.
Definition: PinFunctions.c:434
CyU3PReturnStatus_t AdiConfigurePinInterrupt(uint16_t pin, CyBool_t polarity)
configures the selected pin as an interrupt with edge triggering based on polarity
Definition: PinFunctions.c:1430
CyU3PReturnStatus_t AdiSetPinResistor(uint16_t pin, PinResistorSetting setting)
Configure GPIO input stage pull up / pull down resistor.
Definition: PinFunctions.c:151
#define ADI_ID_PIN_0
Definition: PinFunctions.h:82