STM32100E_EVAL_IOE_Private_Functions
[STM32100E_EVAL_IOE]

Functions

static void delay (__IO uint32_t nCount)
 Inserts a delay time.
uint16_t I2C_ReadDataBuffer (uint8_t DeviceAddr, uint32_t RegisterAddr)
 Reads a buffer of 2 bytes from the device registers.
uint8_t I2C_ReadDeviceRegister (uint8_t DeviceAddr, uint8_t RegisterAddr)
 Reads a register of the device through I2C.
uint8_t I2C_WriteDeviceRegister (uint8_t DeviceAddr, uint8_t RegisterAddr, uint8_t RegisterValue)
 Writes a value in a register of the device through I2C.
uint8_t IOE_ClearGITPending (uint8_t DeviceAddr, uint8_t Global_IT)
 Clears the selected Global interrupt pending bit(s).
uint8_t IOE_ClearIOITPending (uint8_t DeviceAddr, uint8_t IO_IT)
 Clears the selected IO interrupt pending bit(s).
uint8_t IOE_Config (void)
 Initializes and Configures the IO_Expanders Functionalities (Touch Screen .
static void IOE_DMA_Config (IOE_DMADirection_TypeDef Direction, uint8_t *buffer)
 Configure the DMA Peripheral used to handle communication via I2C.
static void IOE_EXTI_Config (void)
 Configures the IO expander Interrupt line and GPIO in EXTI mode.
uint8_t IOE_FnctCmd (uint8_t DeviceAddr, uint8_t Fct, FunctionalState NewState)
 Configures the selcted IO Expander functionalities.
FlagStatus IOE_GetGITStatus (uint8_t DeviceAddr, uint8_t Global_IT)
 Checks the selected Global interrupt source pending bit.
FlagStatus IOE_GetIOITStatus (uint8_t DeviceAddr, uint8_t IO_IT)
 Checks the status of the selected IO interrupt pending bit.
uint8_t IOE_GITCmd (uint8_t DeviceAddr, FunctionalState NewState)
 Enables or disables the Global interrupt.
uint8_t IOE_GITConfig (uint8_t DeviceAddr, uint8_t Global_IT, FunctionalState NewState)
 Configures the selected source to generate or not a global interrupt.
static void IOE_GPIO_Config (void)
 Initializes the GPIO pins used by the IO expander.
static void IOE_I2C_Config (void)
 Configure the I2C Peripheral used to communicate with IO_Expanders.
uint8_t IOE_IOAFConfig (uint8_t DeviceAddr, uint8_t IO_Pin, FunctionalState NewState)
 Configures the selected pin to be in Alternate function or not.
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.
uint8_t IOE_IOITConfig (uint8_t DeviceAddr, uint8_t IO_IT, FunctionalState NewState)
 Configures the selected pins to generate an interrupt or not.
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).
uint8_t IOE_IsOperational (uint8_t DeviceAddr)
 Checks if the selected device is correctly configured and communicates correctly ont the I2C bus.
uint8_t IOE_ITConfig (uint32_t IOE_ITSRC_Source)
 Configures The selected interrupts on the IO Expanders.
uint8_t IOE_ITOutConfig (uint8_t Polarity, uint8_t Type)
 Configures the Interrupt line active state and format (level/edge).
uint16_t IOE_ReadID (uint8_t DeviceAddr)
 Reads the selected device's ID.
uint8_t IOE_ReadIOPin (uint32_t IO_Pin)
 Returns the status of the selected input IO pin.
uint8_t IOE_Reset (uint8_t DeviceAddr)
 Resets the IO Expander by Software (SYS_CTRL1, RESET bit).
uint8_t IOE_TempSens_Config (void)
 Configures and enables the Temperature sensor module.
uint32_t IOE_TempSens_GetData (void)
 Returns the temperature row value (in 16 bit format).
uint8_t IOE_TS_Config (void)
 Configures the touch Screen Controller (Single point detection).
TS_STATEIOE_TS_GetState (void)
 Returns Status and positions of the Touch screen.
static uint16_t IOE_TS_Read_X (void)
 Return Touch Screen X position value.
static uint16_t IOE_TS_Read_Y (void)
 Return Touch Screen Y position value.
static uint16_t IOE_TS_Read_Z (void)
 Return Touch Screen Z position value.
uint8_t IOE_WriteIOPin (uint8_t IO_Pin, IOE_BitValue_TypeDef BitVal)
 Writes a bit value to an output IO pin.

Function Documentation

static void delay ( __IO uint32_t  nCount  )  [static]

Inserts a delay time.

Parameters:
nCount,: specifies the delay time length.
Return values:
None 

Definition at line 1376 of file stm32100e_eval_ioe.c.

References index.

uint16_t I2C_ReadDataBuffer ( uint8_t  DeviceAddr,
uint32_t  RegisterAddr 
)

Reads a buffer of 2 bytes from the device registers.

Parameters:
DeviceAddr,: The address of the device, could be : IOE_1_ADDR.
RegisterAddr,: The target register adress (between 00x and 0x24)
Return values:
A pointer to the buffer containing the two returned bytes (in halfword).

Definition at line 1060 of file stm32100e_eval_ioe.c.

Referenced by IOE_TS_Read_X(), IOE_TS_Read_Y(), and IOE_TS_Read_Z().

uint8_t I2C_ReadDeviceRegister ( uint8_t  DeviceAddr,
uint8_t  RegisterAddr 
)

Reads a register of the device through I2C.

Parameters:
DeviceAddr,: The address of the device, could be : IOE_1_ADDR.
RegisterAddr,: The target register adress (between 00x and 0x24)
Return values:
The value of the read register (0xAA if Timout occured)

Definition at line 964 of file stm32100e_eval_ioe.c.

Referenced by I2C_WriteDeviceRegister(), IOE_FnctCmd(), IOE_GetGITStatus(), IOE_GetIOITStatus(), IOE_GITCmd(), IOE_GITConfig(), IOE_IOAFConfig(), IOE_IOEdgeConfig(), IOE_IOITConfig(), IOE_IOPinConfig(), IOE_ITConfig(), IOE_ITOutConfig(), IOE_JoyStickGetState(), IOE_ReadID(), IOE_ReadIOPin(), IOE_TempSens_Config(), IOE_TempSens_GetData(), IOE_TS_Config(), and IOE_TS_GetState().

uint8_t I2C_WriteDeviceRegister ( uint8_t  DeviceAddr,
uint8_t  RegisterAddr,
uint8_t  RegisterValue 
)

Writes a value in a register of the device through I2C.

Parameters:
DeviceAddr,: The address of the IOExpander, could be : IOE_1_ADDR.
RegisterAddr,: The target register adress
RegisterValue,: The target register value to be written
Return values:
IOE_OK,: if all operations are OK. Other value if error.

Definition at line 864 of file stm32100e_eval_ioe.c.

Referenced by IOE_ClearGITPending(), IOE_ClearIOITPending(), IOE_FnctCmd(), IOE_GITCmd(), IOE_GITConfig(), IOE_IOAFConfig(), IOE_IOEdgeConfig(), IOE_IOITConfig(), IOE_IOPinConfig(), IOE_ITOutConfig(), IOE_Reset(), IOE_TempSens_Config(), IOE_TempSens_GetData(), IOE_TS_Config(), IOE_TS_GetState(), and IOE_WriteIOPin().

uint8_t IOE_ClearGITPending ( uint8_t  DeviceAddr,
uint8_t  Global_IT 
)

Clears the selected Global interrupt pending bit(s).

Parameters:
DeviceAddr,: The address of the IOExpander, could be : IOE_1_ADDR.
Global_IT,: the Global interrupt to be cleared, could be any combination of the following values:

  • Global_IT_GPIO : All IOs interrupt
  • Global_IT_ADC : ADC interrupt
  • Global_IT_TEMP : Temperature Sensor interrupts
  • Global_IT_FE : Touch Screen Controller FIFO Error interrupt
  • Global_IT_FF : Touch Screen Controller FIFO Full interrupt
  • Global_IT_FOV : Touch Screen Controller FIFO Overrun interrupt
  • Global_IT_FTH : Touch Screen Controller FIFO Threshold interrupt
  • Global_IT_TOUCH : Touch Screen Controller Touch Detected interrupt
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 373 of file stm32100e_eval_ioe.c.

Referenced by EXTI15_10_IRQHandler().

uint8_t IOE_ClearIOITPending ( uint8_t  DeviceAddr,
uint8_t  IO_IT 
)

Clears the selected IO interrupt pending bit(s).

Parameters:
DeviceAddr,: The address of the IOExpander, could be : IOE_1_ADDR.
IO_IT,: the IO interrupt to be checked could be IO_ITx Where x can be from 0 to 7.
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 413 of file stm32100e_eval_ioe.c.

Referenced by EXTI15_10_IRQHandler().

uint8_t IOE_Config ( void   ) 

Initializes and Configures the IO_Expanders Functionalities (Touch Screen .

Configuration and initialization functions.

.) and configures all STM32100E-EVAL necessary hardware (GPIOs, APB clocks ..).

Parameters:
None 
Return values:
IOE_OK if all initializations done correctly. Other value if error.

Definition at line 128 of file stm32100e_eval_ioe.c.

Referenced by main().

static void IOE_DMA_Config ( IOE_DMADirection_TypeDef  Direction,
uint8_t *  buffer 
) [static]
static void IOE_EXTI_Config ( void   )  [static]
uint8_t IOE_FnctCmd ( uint8_t  DeviceAddr,
uint8_t  Fct,
FunctionalState  NewState 
)

Configures the selcted IO Expander functionalities.

Parameters:
DeviceAddr,: The address of the IOExpander, could be : IOE_1_ADDR.
Fct,: the functions to be configured. could be any combination of the following values:

  • IOE_IO_FCT : IO function
  • IOE_TS_FCT : Touch Screen function
  • IOE_ADC_FCT : ADC function
  • IOE_TEMPSENS_FCT : Tempreature Sensor function
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 506 of file stm32100e_eval_ioe.c.

Referenced by IOE_Config().

FlagStatus IOE_GetGITStatus ( uint8_t  DeviceAddr,
uint8_t  Global_IT 
)

Checks the selected Global interrupt source pending bit.

Interrupts Mangement functions.

Parameters:
DeviceAddr,: The address of the IOExpander, could be : IOE_1_ADDR.
Global_IT,: the Global interrupt source to be checked, could be:

  • Global_IT_GPIO : All IOs interrupt
  • Global_IT_ADC : ADC interrupt
  • Global_IT_TEMP : Temperature Sensor interrupts
  • Global_IT_FE : Touch Screen Controller FIFO Error interrupt
  • Global_IT_FF : Touch Screen Controller FIFO Full interrupt
  • Global_IT_FOV : Touch Screen Controller FIFO Overrun interrupt
  • Global_IT_FTH : Touch Screen Controller FIFO Threshold interrupt
  • Global_IT_TOUCH : Touch Screen Controller Touch Detected interrupt
Return values:
Status of the checked flag. Could be SET or RESET.

Definition at line 341 of file stm32100e_eval_ioe.c.

Referenced by EXTI15_10_IRQHandler().

FlagStatus IOE_GetIOITStatus ( uint8_t  DeviceAddr,
uint8_t  IO_IT 
)

Checks the status of the selected IO interrupt pending bit.

Parameters:
DeviceAddr,: The address of the IOExpander, could be : IOE_1_ADDR.
IO_IT,: the IO interrupt to be checked could be IO_ITx Where x can be from 0 to 7.
Return values:
Status of the checked flag. Could be SET or RESET.

Definition at line 389 of file stm32100e_eval_ioe.c.

uint8_t IOE_GITCmd ( uint8_t  DeviceAddr,
FunctionalState  NewState 
)

Enables or disables the Global interrupt.

Parameters:
DeviceAddr,: The address of the IOExpander, could be :I OE_1_ADDR.
NewState,: could be ENABLE or DISABLE.
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 567 of file stm32100e_eval_ioe.c.

Referenced by IOE_ITConfig().

uint8_t IOE_GITConfig ( uint8_t  DeviceAddr,
uint8_t  Global_IT,
FunctionalState  NewState 
)

Configures the selected source to generate or not a global interrupt.

Parameters:
DeviceAddr,: The address of the IOExpander, could be : IOE_1_ADDR
Global_IT,: the interrupt source to be configured, could be:

  • Global_IT_GPIO : All IOs interrupt
  • Global_IT_ADC : ADC interrupt
  • Global_IT_TEMP : Temperature Sensor interrupts
  • Global_IT_FE : Touch Screen Controller FIFO Error interrupt
  • Global_IT_FF : Touch Screen Controller FIFO Full interrupt
  • Global_IT_FOV : Touch Screen Controller FIFO Overrun interrupt
  • Global_IT_FTH : Touch Screen Controller FIFO Threshold interrupt
  • Global_IT_TOUCH : Touch Screen Controller Touch Detected interrupt
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 606 of file stm32100e_eval_ioe.c.

Referenced by IOE_ITConfig().

static void IOE_GPIO_Config ( void   )  [static]
static void IOE_I2C_Config ( void   )  [static]
uint8_t IOE_IOAFConfig ( uint8_t  DeviceAddr,
uint8_t  IO_Pin,
FunctionalState  NewState 
)

Configures the selected pin to be in Alternate function or not.

Parameters:
DeviceAddr,: The address of the IOExpander, could be : IOE_1_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.
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 760 of file stm32100e_eval_ioe.c.

Referenced by IOE_Config().

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.

Parameters:
DeviceAddr,: The address of the IOExpander, could be : IOE_1_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 follwing values: EDGE_FALLING and EDGE_RISING .
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 794 of file stm32100e_eval_ioe.c.

Referenced by IOE_Config().

uint8_t IOE_IOITConfig ( uint8_t  DeviceAddr,
uint8_t  IO_IT,
FunctionalState  NewState 
)

Configures the selected pins to generate an interrupt or not.

Parameters:
DeviceAddr,: The address of the IOExpander, could be : IOE_1_ADDR.
IO_IT,: The IO interrupt to be configured. This parameter could be any combination of the following values:

  • IO_IT_x: where x can be from 0 to 7.
NewState,: could be ENABLE or DISABLE.
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 639 of file stm32100e_eval_ioe.c.

Referenced by IOE_ITConfig().

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).

Parameters:
DeviceAddr,: The address of the IOExpander, could be : IOE_1_ADDR.
IO_Pin,: IO_Pin_x: Where x can be from 0 to 7.
Direction,: could be Direction_IN or Direction_OUT.
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 538 of file stm32100e_eval_ioe.c.

Referenced by IOE_Config().

uint8_t IOE_IsOperational ( uint8_t  DeviceAddr  ) 

Checks if the selected device is correctly configured and communicates correctly ont the I2C bus.

IO-Expander Control functions.

Parameters:
DeviceAddr,: The address of the IOExpander, could be : IOE_1_ADDR.
Return values:
IOE_OK if IOE is operational. Other value if failure.

Definition at line 436 of file stm32100e_eval_ioe.c.

Referenced by IOE_Config().

uint8_t IOE_ITConfig ( uint32_t  IOE_ITSRC_Source  ) 

Configures The selected interrupts on the IO Expanders.

Parameters:
IOE_ITSRC_Source,: the source of the interrupts. Could be one or a combination of the following parameters:

  • IOE_ITSRC_TSC: Touch Screen interrupts.
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 168 of file stm32100e_eval_ioe.c.

Referenced by main().

uint8_t IOE_ITOutConfig ( uint8_t  Polarity,
uint8_t  Type 
)

Configures the Interrupt line active state and format (level/edge).

Parameters:
Polarity,: could be

  • Polarity_Low: Interrupt line is active Low/Falling edge
  • Polarity_High: Interrupt line is active High/Rising edge
Type,: Interrupt line activity type, could be one of the following values

  • Type_Level: Interrupt line is active in level model
  • Type_Edge: Interrupt line is active in edge model
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 837 of file stm32100e_eval_ioe.c.

Referenced by IOE_ITConfig().

uint16_t IOE_ReadID ( uint8_t  DeviceAddr  ) 

Reads the selected device's ID.

Parameters:
DeviceAddr,: The address of the IOExpander, could be : IOE_1_ADDR.
Return values:
The Device ID (two bytes).

Definition at line 482 of file stm32100e_eval_ioe.c.

Referenced by IOE_IsOperational().

uint8_t IOE_ReadIOPin ( uint32_t  IO_Pin  ) 

Returns the status of the selected input IO pin.

Parameters:
IO_Pin,: The input pin to be read. IO_Pin_x: Where x can be from 0 to 7.

  • JOY_IO_PINS: Joystick IO pins (use IOE_JoyStickGetState for these pins)
Return values:
None 

Definition at line 238 of file stm32100e_eval_ioe.c.

uint8_t IOE_Reset ( uint8_t  DeviceAddr  ) 

Resets the IO Expander by Software (SYS_CTRL1, RESET bit).

Parameters:
DeviceAddr,: The address of the IOExpander, could be : IOE_1_ADDR.
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 462 of file stm32100e_eval_ioe.c.

Referenced by IOE_Config().

uint8_t IOE_TempSens_Config ( void   ) 

Configures and enables the Temperature sensor module.

Parameters:
None 
Return values:
IOE_OK if all initializations are OK. Other value if error.

Definition at line 733 of file stm32100e_eval_ioe.c.

Referenced by IOE_Config().

uint32_t IOE_TempSens_GetData ( void   ) 

Returns the temperature row value (in 16 bit format).

Temperature Sensor functions.

Parameters:
None 
Return values:
The temperature row value.

Definition at line 309 of file stm32100e_eval_ioe.c.

uint8_t IOE_TS_Config ( void   ) 

Configures the touch Screen Controller (Single point detection).

Low Layer functions.

Parameters:
None 
Return values:
IOE_OK if all initializations are OK. Other value if error.

Definition at line 668 of file stm32100e_eval_ioe.c.

Referenced by IOE_Config().

TS_STATE* IOE_TS_GetState ( void   ) 

Returns Status and positions of the Touch screen.

Touch Screen controller functions.

Parameters:
None 
Return values:
Pointer to TS_STATE structure holding Touch Screen information.

Definition at line 269 of file stm32100e_eval_ioe.c.

Referenced by EXTI15_10_IRQHandler(), and main().

static uint16_t IOE_TS_Read_X ( void   )  [static]

Return Touch Screen X position value.

Parameters:
None 
Return values:
X position.

Definition at line 1160 of file stm32100e_eval_ioe.c.

References I2C_ReadDataBuffer(), IOE_1_ADDR, and IOE_REG_TSC_DATA_Y.

Referenced by IOE_TS_GetState().

static uint16_t IOE_TS_Read_Y ( void   )  [static]

Return Touch Screen Y position value.

Parameters:
None 
Return values:
Y position.

Definition at line 1182 of file stm32100e_eval_ioe.c.

References I2C_ReadDataBuffer(), IOE_1_ADDR, and IOE_REG_TSC_DATA_X.

Referenced by IOE_TS_GetState().

static uint16_t IOE_TS_Read_Z ( void   )  [static]

Return Touch Screen Z position value.

Parameters:
None 
Return values:
Z position.

Definition at line 1201 of file stm32100e_eval_ioe.c.

References I2C_ReadDataBuffer(), IOE_1_ADDR, and IOE_REG_TSC_DATA_Z.

Referenced by IOE_TS_GetState().

uint8_t IOE_WriteIOPin ( uint8_t  IO_Pin,
IOE_BitValue_TypeDef  BitVal 
)

Writes a bit value to an output IO pin.

IO pins control functions.

Parameters:
IO_Pin,: The output pin to be set or reset. IO_Pin_x: Where x can be from 0 to 7.
BitVal,: The value to be set. This parameter can be one of the following values: BitSet or BitReset. See IOE_BitVal_TypeDef.
Return values:
IOE_OK or PARAM_ERROR

Definition at line 201 of file stm32100e_eval_ioe.c.

Referenced by IOE_Config().

STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32