STM8L15x Standard Peripherals Drivers: RI configuration

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

RI configuration. More...

Functions

void SYSCFG_RIAnalogSwitchConfig (RI_AnalogSwitch_TypeDef RI_AnalogSwitch, FunctionalState NewState)
 Enables or disables the Routing Interface Analog switch.
void SYSCFG_RIDeInit (void)
 Deinitializes the RI registers to their default reset values.
void SYSCFG_RIIOSwitchConfig (RI_IOSwitch_TypeDef RI_IOSwitch, FunctionalState NewState)
 Closes or Opens the routing interface Input Output switches.
void SYSCFG_RIResistorConfig (RI_Resistor_TypeDef RI_Resistor, FunctionalState NewState)
 Configures the Pull-up and Pull-down Resistors.
void SYSCFG_RITIMInputCaptureConfig (RI_InputCapture_TypeDef RI_InputCapture, RI_InputCaptureRouting_TypeDef RI_InputCaptureRouting)
 Configures the routing interface to select which Input Output pin to be routed to TIM1 Input Capture.

Detailed Description

RI configuration.

 ===============================================================================
                           RI configuration functions
 ===============================================================================  
  
       ===================================================================      
                        SYSCFG Driver: how to configure RI
       =================================================================== 
       
         1. By default, TIM1 Input Capture channels 2 and 3 are connected to the
            I/O port assigned in the datasheet pinout (default routing).
            TIM1 Input Capture channels 2 and 3 can be routed by calling 
            SYSCFG_RITIMInputCaptureConfig()
            Refer to the device reference manual for more details about 
            TIM1 input capture routing
          
         2. For more details about using SYSCFG_RIIOSwitchConfig()
            and SYSCFG_RIAnalogSwitchConfig() with COMP1 and COMP2, refer to
            comparators driver
            
         3. To output the Internal reference voltage VREFINT, configure corresponding
            GPIO pin in input mode using GPIO_Init() then use SYSCFG_RIIOSwitchConfig()
       
         4. To use the internal Pull-up and Pull-down resistors call
            SYSCFG_RIResistorConfig()


Function Documentation

void SYSCFG_RIAnalogSwitchConfig ( RI_AnalogSwitch_TypeDef  RI_AnalogSwitch,
FunctionalState  NewState 
)

Enables or disables the Routing Interface Analog switch.

Parameters:
RI_AnalogSwitch,:Analog Switch This parameter can be one of the following values:
  • RI_AnalogSwitch_0: Analog switch 0
  • RI_AnalogSwitch_1: Analog switch 1
  • RI_AnalogSwitch_2: Analog switch 2
  • RI_AnalogSwitch_3: Analog switch 3
  • RI_AnalogSwitch_4: Analog switch 4
  • RI_AnalogSwitch_5: Analog switch 5
  • RI_AnalogSwitch_6: Analog switch 6
  • RI_AnalogSwitch_7: Analog switch 7
  • RI_AnalogSwitch_8: Analog switch 8
  • RI_AnalogSwitch_9: Analog switch 9
  • RI_AnalogSwitch_10: Analog switch 10
  • RI_AnalogSwitch_11: Analog switch 11
  • RI_AnalogSwitch_12: Analog switch 14
NewState,:new state of the analog switch. This parameter can be ENABLE or DISABLE.
Return values:
None

Definition at line 177 of file stm8l15x_syscfg.c.

References DISABLE, IS_FUNCTIONAL_STATE, IS_RI_ANALOGSWITCH, and RI.

void SYSCFG_RIDeInit ( void  )

Deinitializes the RI registers to their default reset values.

Parameters:
None
Return values:
None

< Set RI->ICR1 to reset value

< Set RI->ICR2 to reset value

< Set RI->IOSR1 to reset value

< Set RI->IOSR2 to reset value

< Set RI->IOSR3 to reset value

< Set RI->IOSR3 to reset value

< Set RI->ASCR1 to reset value

< Set RI->ASCR2 to reset value

< Set RI->RCR to reset value

Definition at line 112 of file stm8l15x_syscfg.c.

References RI, RI_ASCR1_RESET_VALUE, RI_ASCR2_RESET_VALUE, RI_ICR1_RESET_VALUE, RI_ICR2_RESET_VALUE, RI_IOSR1_RESET_VALUE, RI_IOSR2_RESET_VALUE, RI_IOSR3_RESET_VALUE, RI_IOSR4_RESET_VALUE, and RI_RCR_RESET_VALUE.

void SYSCFG_RIIOSwitchConfig ( RI_IOSwitch_TypeDef  RI_IOSwitch,
FunctionalState  NewState 
)

Closes or Opens the routing interface Input Output switches.

Parameters:
RI_IOSwitch,:can be one of RI_IOSwitch_1..RI_IOSwitch_24
NewState,:new state of the Input Output Switch. This parameter can be ENABLE or DISABLE.
Return values:
None.

Definition at line 227 of file stm8l15x_syscfg.c.

References DISABLE, IS_FUNCTIONAL_STATE, IS_RI_IOSWITCH, and RI.

void SYSCFG_RIResistorConfig ( RI_Resistor_TypeDef  RI_Resistor,
FunctionalState  NewState 
)

Configures the Pull-up and Pull-down Resistors.

Parameters:
RI_Resistor,:selects the resistor to connect, This parameter can be one of the following values:
  • RI_Resistor_10KPU: 10K pull up
  • RI_Resistor_400KPU: 400K pull up
  • RI_Resistor_10KPD: 10K pull down
  • RI_Resistor_400KPD: 400K pull down
Return values:
None

Definition at line 313 of file stm8l15x_syscfg.c.

References DISABLE, IS_FUNCTIONAL_STATE, IS_RI_RESISTOR, and RI.

void SYSCFG_RITIMInputCaptureConfig ( RI_InputCapture_TypeDef  RI_InputCapture,
RI_InputCaptureRouting_TypeDef  RI_InputCaptureRouting 
)

Configures the routing interface to select which Input Output pin to be routed to TIM1 Input Capture.

Parameters:
RI_InputCapture,:selects the TIM1 input capture2 RI_InputCapture_IC2 or the TIM1 input capture3 RI_InputCapture_IC3
RI_InputCaptureRouting,:selects the value to set in TIM1 Input Capture routing register ICRx and can be from RI_InputCaptureRouting_0 to RI_InputCaptureRouting_22.
Return values:
None.

Definition at line 135 of file stm8l15x_syscfg.c.

References IS_RI_INPUTCAPTURE, IS_RI_INPUTCAPTUREROUTING, RI, and RI_InputCapture_IC2.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com