USB Device - Joystick/Mouse
1.0
|
Macros | |
#define | IOE_TimeoutUserCallback() IOE_TIMEOUT |
Timeout user callback function. More... | |
Functions | |
uint8_t | IOE_Config (void) |
Configuration and initialization functions. More... | |
uint8_t | IOE_ITConfig (uint32_t IOE_ITSRC_Source) |
Configures The selected interrupts on the IO Expanders. More... | |
uint8_t | IOE_WriteIOPin (uint8_t IO_Pin, IOE_BitValue_TypeDef BitVal) |
IO pins control functions. More... | |
uint8_t | IOE_ReadIOPin (uint32_t IO_Pin) |
Returns the status of the selected input IO pin. More... | |
JOYState_TypeDef | IOE_JoyStickGetState (void) |
Returns the current Joystick status. More... | |
TS_STATE * | IOE_TS_GetState (void) |
Touch Screen controller functions. More... | |
FlagStatus | IOE_GetGITStatus (uint8_t DeviceAddr, uint8_t Global_IT) |
Interrupts Mangement functions. More... | |
uint8_t | IOE_ClearGITPending (uint8_t DeviceAddr, uint8_t IO_IT) |
Clears the selected Global interrupt pending bit(s) More... | |
FlagStatus | IOE_GetIOITStatus (uint8_t DeviceAddr, uint8_t IO_IT) |
Checks the status of the selected IO interrupt pending bit. More... | |
uint8_t | IOE_ClearIOITPending (uint8_t DeviceAddr, uint8_t IO_IT) |
Clears the selected IO interrupt pending bit(s). More... | |
uint32_t | IOE_TempSens_GetData (void) |
Temperature Sensor functions. More... | |
uint8_t | IOE_IsOperational (uint8_t DeviceAddr) |
IO-Expander Control functions. More... | |
uint8_t | IOE_Reset (uint8_t DeviceAddr) |
Resets the IO Expander by Software (SYS_CTRL1, RESET bit). More... | |
uint16_t | IOE_ReadID (uint8_t DeviceAddr) |
Reads the selected device's ID. More... | |
uint8_t | IOE_FnctCmd (uint8_t DeviceAddr, uint8_t Fct, FunctionalState NewState) |
Configures the selected IO Expander functionalities. More... | |
uint8_t | IOE_IOPinConfig (uint8_t DeviceAddr, uint8_t IO_Pin, uint8_t Direction) |
Configures the selected pin direction (to be an input or an output) More... | |
uint8_t | IOE_GITCmd (uint8_t DeviceAddr, FunctionalState NewState) |
Enables or disables the Global interrupt. More... | |
uint8_t | IOE_GITConfig (uint8_t DeviceAddr, uint8_t Global_IT, FunctionalState NewState) |
Configures the selected source to generate or not a global interrupt. More... | |
uint8_t | IOE_IOITConfig (uint8_t DeviceAddr, uint8_t IO_IT, FunctionalState NewState) |
Configures the selected pins to generate an interrupt or not. More... | |
uint8_t | IOE_TS_Config (void) |
Low Layer functions. More... | |
uint8_t | IOE_TempSens_Config (void) |
Configures and enables the Temperature sensor module. More... | |
uint8_t | IOE_IOAFConfig (uint8_t DeviceAddr, uint8_t IO_Pin, FunctionalState NewState) |
Configures the selected pin to be in Alternate function or not. More... | |
uint8_t | IOE_IOEdgeConfig (uint8_t DeviceAddr, uint8_t IO_Pin, uint8_t Edge) |
Configures the Edge for which a transition is detectable for the the selected pin. More... | |
uint8_t | IOE_ITOutConfig (uint8_t Polarity, uint8_t Type) |
Configures the Interrupt line active state and format (level/edge) More... | |
uint8_t | I2C_WriteDeviceRegister (uint8_t DeviceAddr, uint8_t RegisterAddr, uint8_t RegisterValue) |
Writes a value in a register of the device through I2C. More... | |
uint8_t | I2C_ReadDeviceRegister (uint8_t DeviceAddr, uint8_t RegisterAddr) |
Reads a register of the device through I2C. More... | |
uint16_t | I2C_ReadDataBuffer (uint8_t DeviceAddr, uint32_t RegisterAddr) |
Reads a buffer of 2 bytes from the device registers. More... | |
#define IOE_TimeoutUserCallback | ( | ) | IOE_TIMEOUT |
Timeout user callback function.
This function is called when a timeout condition occurs during communication with IO Expander. Only protoype of this function is decalred in IO Expander driver. Its implementation may be done into user application. This function may typically stop current operations and reset the I2C peripheral and IO Expander. To enable this function use uncomment the define USE_TIMEOUT_USER_CALLBACK at the top of this file.
uint16_t I2C_ReadDataBuffer | ( | uint8_t | DeviceAddr, |
uint32_t | RegisterAddr | ||
) |
Reads a buffer of 2 bytes from the device registers.
DeviceAddr | The address of the device, could be : IOE_1_ADDR or IOE_2_ADDR. |
RegisterAddr | The target register address (between 00x and 0x24) |
A | pointer to the buffer containing the two returned bytes (in halfword). |
uint8_t I2C_ReadDeviceRegister | ( | uint8_t | DeviceAddr, |
uint8_t | RegisterAddr | ||
) |
Reads a register of the device through I2C.
DeviceAddr | The address of the device, could be : IOE_1_ADDR or IOE_2_ADDR. |
RegisterAddr | The target register address (between 00x and 0x24) |
The | value of the read register (0xAA if Timeout occurred) |
uint8_t I2C_WriteDeviceRegister | ( | uint8_t | DeviceAddr, |
uint8_t | RegisterAddr, | ||
uint8_t | RegisterValue | ||
) |
Writes a value in a register of the device through I2C.
DeviceAddr | The address of the IOExpander, could be : IOE_1_ADDR or IOE_2_ADDR. |
RegisterAddr | The target register address |
RegisterValue | The target register value to be written |
IOE_OK | if all operations are OK. Other value if error. |
uint8_t IOE_ClearGITPending | ( | uint8_t | DeviceAddr, |
uint8_t | Global_IT | ||
) |
Clears the selected Global interrupt pending bit(s)
DeviceAddr | The address of the IOExpander, could be : IOE_1_ADDR or IOE_2_ADDR. |
Global_IT | the Global interrupt to be cleared, could be any combination of the following values:
|
IOE_OK | if all initializations are OK. Other value if error. |
uint8_t IOE_ClearIOITPending | ( | uint8_t | DeviceAddr, |
uint8_t | IO_IT | ||
) |
Clears the selected IO interrupt pending bit(s).
DeviceAddr | The address of the IOExpander, could be : IOE_1_ADDR or IOE_2_ADDR. |
IO_IT | the IO interrupt to be checked could be IO_ITx Where x can be from 0 to 7. |
IOE_OK | if all initializations are OK. Other value if error. |
uint8_t IOE_Config | ( | void | ) |
Configuration and initialization functions.
Configuration and initialization functions.
None |
IOE_OK | if all initializations done correctly. Other value if error. |
uint8_t IOE_FnctCmd | ( | uint8_t | DeviceAddr, |
uint8_t | Fct, | ||
FunctionalState | NewState | ||
) |
Configures the selected IO Expander functionalities.
DeviceAddr | The address of the IOExpander, could be : IOE_1_ADDR or IOE_2_ADDR. |
IOE_TEMPSENS_FCT | the functions to be configured. could be any combination of the following values:
|
IOE_OK | if all initializations are OK. Other value if error. |
FlagStatus IOE_GetGITStatus | ( | uint8_t | DeviceAddr, |
uint8_t | Global_IT | ||
) |
Interrupts Mangement functions.
Interrupts Mangement functions.
DeviceAddr | The address of the IOExpander, could be : IOE_1_ADDR or IOE_2_ADDR. |
Global_IT | the Global interrupt source to be checked, could be:
|
Status | of the checked flag. Could be SET or RESET. |
FlagStatus IOE_GetIOITStatus | ( | uint8_t | DeviceAddr, |
uint8_t | IO_IT | ||
) |
Checks the status of the selected IO interrupt pending bit.
DeviceAddr | The address of the IOExpander, could be : IOE_1_ADDR or IOE_2_ADDR. |
IO_IT | the IO interrupt to be checked could be IO_ITx Where x can be from 0 to 7. |
Status | of the checked flag. Could be SET or RESET. |
uint8_t IOE_GITCmd | ( | uint8_t | DeviceAddr, |
FunctionalState | NewState | ||
) |
Enables or disables the Global interrupt.
DeviceAddr | The address of the IOExpander, could be :I OE_1_ADDR or IOE_2_ADDR. |
NewState | could be ENABLE or DISABLE. |
IOE_OK | if all initializations are OK. Other value if error. |
uint8_t IOE_GITConfig | ( | uint8_t | DeviceAddr, |
uint8_t | Global_IT, | ||
FunctionalState | NewState | ||
) |
Configures the selected source to generate or not a global interrupt.
DeviceAddr | The address of the IOExpander, could be : IOE_1_ADDR or IOE_2_ADDR. |
Global_IT | the interrupt source to be configured, could be:
|
IOE_OK | if all initializations are OK. Other value if error. |
uint8_t IOE_IOAFConfig | ( | uint8_t | DeviceAddr, |
uint8_t | IO_Pin, | ||
FunctionalState | NewState | ||
) |
Configures the selected pin to be in Alternate function or not.
DeviceAddr | The address of the IOExpander, could be : IOE_1_ADDR or IOE_2_ADDR. |
IO_Pin | IO_Pin_x, Where x can be from 0 to 7. |
NewState | State of the AF for the selected pin, could be ENABLE or DISABLE. |
IOE_OK | if all initializations are OK. Other value if error. |
uint8_t IOE_IOEdgeConfig | ( | uint8_t | DeviceAddr, |
uint8_t | IO_Pin, | ||
uint8_t | Edge | ||
) |
Configures the Edge for which a transition is detectable for the the selected pin.
DeviceAddr | The address of the IOExpander, could be : IOE_1_ADDR or IOE_2_ADDR. |
IO_Pin | IO_Pin_x, Where x can be from 0 to 7. |
Edge | The edge which will be detected. This parameter can be one or a a combination of following values: EDGE_FALLING and EDGE_RISING . |
IOE_OK | if all initializations are OK. Other value if error. |
uint8_t IOE_IOITConfig | ( | uint8_t | DeviceAddr, |
uint8_t | IO_IT, | ||
FunctionalState | NewState | ||
) |
Configures the selected pins to generate an interrupt or not.
DeviceAddr | The address of the IOExpander, could be : IOE_1_ADDR or IOE_2_ADDR. |
IO_IT | The IO interrupt to be configured. This parameter could be any combination of the following values:
|
NewState | could be ENABLE or DISABLE. |
IOE_OK | if all initializations are OK. Other value if error. |
uint8_t IOE_IOPinConfig | ( | uint8_t | DeviceAddr, |
uint8_t | IO_Pin, | ||
uint8_t | Direction | ||
) |
Configures the selected pin direction (to be an input or an output)
DeviceAddr | The address of the IOExpander, could be : IOE_1_ADDR or IOE_2_ADDR. |
IO_Pin | IO_Pin_x: Where x can be from 0 to 7. |
Direction | could be Direction_IN or Direction_OUT. |
IOE_OK | if all initializations are OK. Other value if error. |
uint8_t IOE_IsOperational | ( | uint8_t | DeviceAddr | ) |
IO-Expander Control functions.
IO-Expander Control functions.
DeviceAddr | The address of the IOExpander, could be : IOE_1_ADDR or IOE_2_ADDR. |
IOE_OK | if IOE is operational. Other value if failure. |
uint8_t IOE_ITConfig | ( | uint32_t | IOE_ITSRC_Source | ) |
Configures The selected interrupts on the IO Expanders.
IOE_ITSRC_Source | the source of the interrupts. Could be one or a combination of the following parameters:
|
IOE_OK | if all initializations are OK. Other value if error. |
uint8_t IOE_ITOutConfig | ( | uint8_t | Polarity, |
uint8_t | Type | ||
) |
Configures the Interrupt line active state and format (level/edge)
Polarity | could be
|
Type | Interrupt line activity type, could be one of the following values
|
IOE_OK | if all initializations are OK. Other value if error. |
JOYState_TypeDef IOE_JoyStickGetState | ( | void | ) |
Returns the current Joystick status.
None |
The | code of the Joystick key pressed:
|
uint16_t IOE_ReadID | ( | uint8_t | DeviceAddr | ) |
Reads the selected device's ID.
DeviceAddr | The address of the IOExpander, could be : IOE_1_ADDR or IOE_2_ADDR. |
The | Device ID (two bytes). |
uint8_t IOE_ReadIOPin | ( | uint32_t | IO_Pin | ) |
Returns the status of the selected input IO pin.
IO_Pin | The input pin to be read. This parameter can be one of the following values:
|
None |
uint8_t IOE_Reset | ( | uint8_t | DeviceAddr | ) |
Resets the IO Expander by Software (SYS_CTRL1, RESET bit).
DeviceAddr | The address of the IOExpander, could be : IOE_1_ADDR or IOE_2_ADDR. |
IOE_OK | if all initializations are OK. Other value if error. |
uint8_t IOE_TempSens_Config | ( | void | ) |
Configures and enables the Temperature sensor module.
None |
IOE_OK | if all initializations are OK. Other value if error. |
uint32_t IOE_TempSens_GetData | ( | void | ) |
Temperature Sensor functions.
Temperature Sensor functions.
None |
The | temperature row value. |
uint8_t IOE_TS_Config | ( | void | ) |
Low Layer functions.
Low Layer functions.
None |
IOE_OK | if all initializations are OK. Other value if error. |
TS_STATE* IOE_TS_GetState | ( | void | ) |
Touch Screen controller functions.
Touch Screen controller functions.
None |
Pointer | to TS_STATE structure holding Touch Screen information. |
uint8_t IOE_WriteIOPin | ( | uint8_t | IO_Pin, |
IOE_BitValue_TypeDef | BitVal | ||
) |
IO pins control functions.
IO pins control functions.
IO_Pin | The output pin to be set or reset. This parameter can be one of the following values:
|
BitVal | The value to be set. This parameter can be one of the following values: BitSet or BitReset. See IOE_BitVal_TypeDef. |
IOE_OK | or PARAM_ERROR |