STM3210C_EVAL_IOE_Private_Functions
[STM3210C_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 two IO_Expanders Functionalities (IOs, 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).
JOYState_TypeDef IOE_JoyStickGetState (void)
 Returns the current Joystick status.
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 1565 of file stm3210c_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 or IOE_2_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 1250 of file stm3210c_eval_ioe.c.

References DISABLE, DMA_ClearFlag(), DMA_Cmd(), DMA_GetFlagStatus(), ENABLE, I2C_CheckEvent(), I2C_Direction_Receiver, I2C_Direction_Transmitter, I2C_DMACmd(), I2C_DMALastTransferCmd(), I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED, I2C_FLAG_BTF, I2C_FLAG_SB, I2C_FLAG_TXE, I2C_GenerateSTART(), I2C_GenerateSTOP(), I2C_GetFlagStatus(), I2C_Send7bitAddress(), I2C_SendData(), IOE_DMA_Config(), IOE_DMA_RX, IOE_DMA_RX_CHANNEL, IOE_DMA_RX_TCFLAG, IOE_I2C, IOE_TimeOut, IOE_TimeoutUserCallback, and TIMEOUT_MAX.

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 or IOE_2_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 1153 of file stm3210c_eval_ioe.c.

References DISABLE, DMA_ClearFlag(), DMA_Cmd(), DMA_GetFlagStatus(), ENABLE, I2C_CheckEvent(), I2C_Direction_Receiver, I2C_Direction_Transmitter, I2C_DMACmd(), I2C_DMALastTransferCmd(), I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED, I2C_FLAG_BTF, I2C_FLAG_SB, I2C_FLAG_TXE, I2C_GenerateSTART(), I2C_GenerateSTOP(), I2C_GetFlagStatus(), I2C_Send7bitAddress(), I2C_SendData(), IOE_DMA_Config(), IOE_DMA_RX, IOE_DMA_RX_CHANNEL, IOE_DMA_RX_TCFLAG, IOE_I2C, IOE_TimeOut, IOE_TimeoutUserCallback, and TIMEOUT_MAX.

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 or IOE_2_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 1052 of file stm3210c_eval_ioe.c.

References DISABLE, DMA_ClearFlag(), DMA_Cmd(), DMA_GetFlagStatus(), ENABLE, I2C_CheckEvent(), I2C_Direction_Transmitter, I2C_DMACmd(), I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED, I2C_FLAG_BTF, I2C_FLAG_SB, I2C_FLAG_TXE, I2C_GenerateSTART(), I2C_GenerateSTOP(), I2C_GetFlagStatus(), I2C_ReadDeviceRegister(), I2C_Send7bitAddress(), I2C_SendData(), IOE_DMA_Config(), IOE_DMA_TX, IOE_DMA_TX_CHANNEL, IOE_DMA_TX_TCFLAG, IOE_FAILURE, IOE_I2C, IOE_TimeOut, IOE_TimeoutUserCallback, RESET, and TIMEOUT_MAX.

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 or IOE_2_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 535 of file stm3210c_eval_ioe.c.

References I2C_WriteDeviceRegister(), IOE_OK, and IOE_REG_INT_STA.

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 or IOE_2_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 577 of file stm3210c_eval_ioe.c.

References I2C_WriteDeviceRegister(), IOE_2_ADDR, IOE_OK, IOE_REG_GPIO_ED, IOE_REG_GPIO_FE, IOE_REG_GPIO_INT_STA, and IOE_REG_GPIO_RE.

uint8_t IOE_Config ( void   ) 

Initializes and Configures the two IO_Expanders Functionalities (IOs, Touch Screen .

Configuration and initialization functions.

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

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

Definition at line 134 of file stm3210c_eval_ioe.c.

References AUDIO_RESET_PIN, BitReset, Direction_IN, Direction_OUT, EDGE_FALLING, EDGE_RISING, ENABLE, IOE1_NOT_OPERATIONAL, IOE2_NOT_OPERATIONAL, IOE_1_ADDR, IOE_2_ADDR, IOE_ADC_FCT, IOE_FnctCmd(), IOE_GPIO_Config(), IOE_I2C_Config(), IOE_IO_FCT, IOE_IOAFConfig(), IOE_IOEdgeConfig(), IOE_IOPinConfig(), IOE_IsOperational(), IOE_OK, IOE_Reset(), IOE_TempSens_Config(), IOE_TEMPSENS_FCT, IOE_TS_Config(), IOE_TS_FCT, IOE_WriteIOPin(), JOY_IO_PINS, MEMS_INT1_PIN, MEMS_INT2_PIN, MII_INT_PIN, and VBAT_DIV_PIN.

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 or IOE_2_ADDR.
IOE_TEMPSENS_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 675 of file stm3210c_eval_ioe.c.

References DISABLE, I2C_ReadDeviceRegister(), I2C_WriteDeviceRegister(), IOE_OK, and IOE_REG_SYS_CTRL2.

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 or IOE_2_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 502 of file stm3210c_eval_ioe.c.

References I2C_ReadDeviceRegister(), IOE_REG_INT_STA, RESET, and SET.

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 or IOE_2_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 552 of file stm3210c_eval_ioe.c.

References I2C_ReadDeviceRegister(), IOE_REG_GPIO_INT_STA, RESET, and SET.

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 or IOE_2_ADDR.
NewState,: could be ENABLE or DISABLE.
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 738 of file stm3210c_eval_ioe.c.

References DISABLE, I2C_ReadDeviceRegister(), I2C_WriteDeviceRegister(), IOE_GIT_EN, IOE_OK, and IOE_REG_INT_CTRL.

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 or IOE_2_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 778 of file stm3210c_eval_ioe.c.

References DISABLE, I2C_ReadDeviceRegister(), I2C_WriteDeviceRegister(), IOE_OK, and IOE_REG_INT_EN.

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 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.
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 934 of file stm3210c_eval_ioe.c.

References DISABLE, I2C_ReadDeviceRegister(), I2C_WriteDeviceRegister(), IOE_OK, and IOE_REG_GPIO_AF.

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 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 follwing values: EDGE_FALLING and EDGE_RISING .
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 969 of file stm3210c_eval_ioe.c.

References EDGE_FALLING, EDGE_RISING, I2C_ReadDeviceRegister(), I2C_WriteDeviceRegister(), IOE_OK, IOE_REG_GPIO_FE, and IOE_REG_GPIO_RE.

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 or IOE_2_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 812 of file stm3210c_eval_ioe.c.

References DISABLE, I2C_ReadDeviceRegister(), I2C_WriteDeviceRegister(), IOE_OK, and IOE_REG_GPIO_INT_EN.

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 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.
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 708 of file stm3210c_eval_ioe.c.

References Direction_IN, I2C_ReadDeviceRegister(), I2C_WriteDeviceRegister(), IOE_OK, and IOE_REG_GPIO_DIR.

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 or IOE_2_ADDR.
Return values:
IOE_OK if IOE is operational. Other value if failure.

Definition at line 602 of file stm3210c_eval_ioe.c.

References IOE_FAILURE, IOE_OK, IOE_ReadID(), IOE_TimeOut, IOE_TimeoutUserCallback, and STMPE811_ID.

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_JOYSTICK: Joystick IO intputs.
  • IOE_ITSRC_TSC: Touch Screen interrupts.
  • IOE_ITSRC_INMEMS: MEMS interrupt lines.
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 217 of file stm3210c_eval_ioe.c.

References ENABLE, I2C_ReadDeviceRegister(), IOE_1_ADDR, IOE_2_ADDR, IOE_EXTI_Config(), IOE_GIT_FOV, IOE_GIT_FTH, IOE_GIT_GPIO, IOE_GIT_TOUCH, IOE_GITCmd(), IOE_GITConfig(), IOE_INMEMS_IT, IOE_IOITConfig(), IOE_ITOutConfig(), IOE_ITSRC_INMEMS, IOE_ITSRC_JOYSTICK, IOE_ITSRC_TSC, IOE_JOY_IT, IOE_OK, IOE_REG_GPIO_INT_STA, Polarity_High, Polarity_Low, and Type_Level.

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 1012 of file stm3210c_eval_ioe.c.

References I2C_ReadDeviceRegister(), I2C_WriteDeviceRegister(), IOE_1_ADDR, IOE_2_ADDR, IOE_OK, and IOE_REG_INT_CTRL.

JOYState_TypeDef IOE_JoyStickGetState ( void   ) 

Returns the current Joystick status.

Parameters:
None 
Return values:
The code of the Joystick key pressed:

  • JOY_NONE
  • JOY_SEL
  • JOY_DOWN
  • JOY_LEFT
  • JOY_RIGHT
  • JOY_UP

Definition at line 382 of file stm3210c_eval_ioe.c.

References I2C_ReadDeviceRegister(), IOE_2_ADDR, IOE_REG_GPIO_MP_STA, JOY_DOWN, JOY_IO_DOWN, JOY_IO_LEFT, JOY_IO_NONE, JOY_IO_RIGHT, JOY_IO_SEL, JOY_IO_UP, JOY_LEFT, JOY_NONE, JOY_RIGHT, JOY_SEL, and JOY_UP.

Referenced by EXTI15_10_IRQHandler(), main(), and ReadKey().

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 or IOE_2_ADDR.
Return values:
The Device ID (two bytes).

Definition at line 650 of file stm3210c_eval_ioe.c.

References I2C_ReadDeviceRegister().

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. This parameter can be one of the following values:

  • MEMS_INT1_PIN: MEMS interrupt line 1.
  • MEMS_INT2_PIN: MEMS interrupt line 2.
  • JOY_IO_PINS: Joystick IO pins (use IOE_JoyStickGetState for these pins)
Return values:
None 

Definition at line 340 of file stm3210c_eval_ioe.c.

References BitReset, BitSet, I2C_ReadDeviceRegister(), IO1_IN_ALL_PINS, IO2_IN_ALL_PINS, IOE_1_ADDR, IOE_2_ADDR, IOE_REG_GPIO_MP_STA, and PARAM_ERROR.

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 or IOE_2_ADDR.
Return values:
IOE_OK,: if all initializations are OK. Other value if error.

Definition at line 629 of file stm3210c_eval_ioe.c.

References _delay_, I2C_WriteDeviceRegister(), IOE_OK, and IOE_REG_SYS_CTRL1.

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 906 of file stm3210c_eval_ioe.c.

References I2C_ReadDeviceRegister(), I2C_WriteDeviceRegister(), IOE_1_ADDR, IOE_2_ADDR, IOE_ADC_FCT, IOE_OK, IOE_REG_SYS_CTRL2, IOE_REG_TEMP_CTRL, and IOE_TEMPSENS_FCT.

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 469 of file stm3210c_eval_ioe.c.

References I2C_ReadDeviceRegister(), I2C_WriteDeviceRegister(), IOE_1_ADDR, IOE_2_ADDR, IOE_REG_TEMP_CTRL, and IOE_REG_TEMP_DATA.

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 841 of file stm3210c_eval_ioe.c.

References _delay_, I2C_ReadDeviceRegister(), I2C_WriteDeviceRegister(), IOE_1_ADDR, IOE_ADC_FCT, IOE_GIT_FOV, IOE_GIT_FTH, IOE_GIT_TOUCH, IOE_OK, IOE_REG_ADC_CTRL1, IOE_REG_ADC_CTRL2, IOE_REG_FIFO_STA, IOE_REG_FIFO_TH, IOE_REG_GPIO_AF, IOE_REG_INT_EN, IOE_REG_INT_STA, IOE_REG_SYS_CTRL2, IOE_REG_TSC_CFG, IOE_REG_TSC_CTRL, IOE_REG_TSC_FRACT_XYZ, IOE_REG_TSC_I_DRIVE, IOE_TS_FCT, TOUCH_IO_ALL, TS_STATE::TouchDetected, TS_STATE::X, TS_STATE::Y, and TS_STATE::Z.

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 424 of file stm3210c_eval_ioe.c.

References I2C_ReadDeviceRegister(), I2C_WriteDeviceRegister(), IOE_1_ADDR, IOE_REG_FIFO_STA, IOE_REG_TSC_CTRL, IOE_TS_Read_X(), IOE_TS_Read_Y(), IOE_TS_Read_Z(), TS_STATE::TouchDetected, TS_CONVERSION_DELAY, TS_STATE::X, TS_STATE::Y, and TS_STATE::Z.

static uint16_t IOE_TS_Read_X ( void   )  [static]

Return Touch Screen X position value.

Parameters:
None 
Return values:
X position.

Definition at line 1350 of file stm3210c_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 1372 of file stm3210c_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 1391 of file stm3210c_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. This parameter can be one of the following values:

  • AUDIO_RESET_PIN: Audio codec reset pin
  • MII_INT_PIN: Ethernet Phy MII interrupt pin
  • VBAT_DIV_PIN: Battery devider pin
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 297 of file stm3210c_eval_ioe.c.

References BitReset, I2C_WriteDeviceRegister(), IO1_OUT_ALL_PINS, IO2_OUT_ALL_PINS, IOE_1_ADDR, IOE_2_ADDR, IOE_OK, IOE_REG_GPIO_CLR_PIN, IOE_REG_GPIO_SET_PIN, and PARAM_ERROR.

STM32F10x Standard Peripherals Library: Footer

 

 

 

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