예제 #1
0
def TIM_ConfigMatch(TIMx, TIM_MatchConfigStruct):
  '''Configuration for Match register.
  
  TIMx: Timer selection, should be:
        - LPC_TIM0: TIMER0 peripheral
        - LPC_TIM1: TIMER1 peripheral
        - LPC_TIM2: TIMER2 peripheral
        - LPC_TIM3: TIMER3 peripheral
  TIM_MatchConfigStruct:  Pointer to TIM_MATCHCFG_Type
                          - MatchChannel: choose channel 0 or 1
                          - IntOnMatch: if SET, interrupt will be generated when
                            MRxx match the value in TC
                          - StopOnMatch:  if SET, TC and PC will be stopped 
                                          whenM Rxx match the value in TC
                          - ResetOnMatch: if SET, Reset on MR0 when MRxx match
                                          the value in TC
                          - ExtMatchOutputType: Select output for external match
                            0:  Do nothing for external output pin if match
                            1:	Force external output pin to low if match
                            2: Force external output pin to high if match
                            3: Toggle external output pin if match
                            MatchValue: Set the value to be compared with TC 
                                        value
  
  '''
	return robocaller("TIM_ConfigMatch", "void", TIMx, TIM_MatchConfigStruct)
예제 #2
0
def SYSTICK_GetCurrentValue():
  '''Get current value of System Tick counter.
  
  return: current value of System Tick counter
  
  '''
  return robocaller("SYSTICK_GetCurrentValue", "uint32_t")
예제 #3
0
def DAC_Init(DACx):
  '''Initial ADC configuration. Maximum  current is 700 uA, Value to AOUT is 0.
    
  DACx: pointer to LPC_DAC_TypeDef, should be: LPC_DAC
  
  '''
  return robocaller("DAC_Init", "void", DACx)
예제 #4
0
def WDT_GetCurrentCount():
  '''Get the current value of WDT.
  
  return: current value of WDT
  
  '''
  return robocaller("WDT_GetCurrentCount", "uint32_t")
예제 #5
0
def WDT_ReadTimeOutFlag():
  '''Read WDT timeout flag.
  
  return: timeout flag status of WDT
  
  '''
  return robocaller("WDT_ReadTimeOutFlag", "FlagStatus")
예제 #6
0
파일: core.py 프로젝트: robovero/python
def NVIC_ClearPendingIRQ(IRQn):
    """Clear a pending interrupt.
	
	Note that this is automatically done for you after your ISR is called,
	before 
	"""
    return robocaller("NVIC_ClearPendingIRQ", "void", IRQn)
예제 #7
0
def EMAC_CheckReceiveIndex():
  '''Check whether the current RxConsumeIndex is not equal to the current
  RxProduceIndex.
  
  return: TRUE if they're not equal, otherwise return FALSE
  '''
  return robocaller("EMAC_CheckReceiveIndex", "Bool")
예제 #8
0
def WDT_Start(TimeOut):
  '''Start WDT activity with given timeout value.
  
  TimeOut:  WDT reset after timeout if it is not feed
  
  '''
  return robocaller("WDT_Start", "void", TimeOut)
예제 #9
0
def QEI_DeInit(QEIx):
  '''De-initializes the QEI peripheral registers to their default reset values.
  
  QEIx: QEI peripheral, should be LPC_QEI
  
  '''
  return robocaller("QEI_DeInit", "void", QEIx)
예제 #10
0
def ADC_DeInit(ADCx):
  '''Close ADC.
  
  ADCx: pointer to LPC_ADC_TypeDef, should be: LPC_ADC
  
  '''
  return robocaller("ADC_DeInit", "void", ADCx)
예제 #11
0
def RTC_Init(RTCx):
  '''Initializes the RTC peripheral..
  
  RTCx: RTC peripheral selected, should be LPC_RTC
  
  '''
  return robocaller("RTC_Init", "void", RTCx)
예제 #12
0
def RTC_DeInit(RTCx):
  '''De-initializes the RTC peripheral registers to their default reset values.
  
  RTCx: RTC peripheral selected, should be LPC_RTC
  
  '''
  return robocaller("RTC_DeInit", "void", RTCx)
예제 #13
0
def QEI_IntClear(QEIx, ulIntType):
  '''Clear (force) specified interrupt (pending) in QEI peripheral.
  
  QEIx: QEI peripheral, should be LPC_QEI
  ulIntType:  Interrupt Flag Status type, should be:
              - QEI_INTFLAG_INX_Int: index pulse was detected interrupt
              - QEI_INTFLAG_TIM_Int: Velocity timer over flow interrupt
              - QEI_INTFLAG_VELC_Int: Capture velocity is less than compare
                interrupt
              - QEI_INTFLAG_DIR_Int: Change of direction interrupt
              - QEI_INTFLAG_ERR_Int: An encoder phase error interrupt
              - QEI_INTFLAG_ENCLK_Int: An encoder clock pulse was detected
                interrupt
              - QEI_INTFLAG_POS0_Int: position 0 compare value is equal to the
                current position interrupt
              - QEI_INTFLAG_POS1_Int: position 1 compare value is equal to the
                current position interrupt
              - QEI_INTFLAG_POS2_Int: position 2 compare value is equal to the
                current position interrupt
              - QEI_INTFLAG_REV_Int: Index compare value is equal to the current
                index count interrupt
              - QEI_INTFLAG_POS0REV_Int: Combined position 0 and revolution 
                count interrupt
              - QEI_INTFLAG_POS1REV_Int: Combined position 1 and revolution 
                count interrupt
              - QEI_INTFLAG_POS2REV_Int: Combined position 2 and revolution 
                count interrupt
  
  '''
  return robocaller("QEI_IntClear", "void", QEIx, ulIntType)
예제 #14
0
def RTC_ResetClockTickCounter(RTCx):
  '''Reset clock tick counter in RTC peripheral.
  
  RTCx: RTC peripheral selected, should be LPC_RTC
  
  '''
  return robocaller("RTC_ResetClockTickCounter", "void", RTCx)
예제 #15
0
def QEI_GetIntStatus(QEIx, ulIntType):
  '''Check whether if specified interrupt flag status in QEI peripheral
  is set or not.
  
  QEIx: QEI peripheral, should be LPC_QEI
  ulIntType:  Interrupt Flag Status type, should be:
              - QEI_INTFLAG_INX_Int: index pulse was detected interrupt
              - QEI_INTFLAG_TIM_Int: Velocity timer over flow interrupt
              - QEI_INTFLAG_VELC_Int: Capture velocity is less than compare
                interrupt
              - QEI_INTFLAG_DIR_Int: Change of direction interrupt
              - QEI_INTFLAG_ERR_Int: An encoder phase error interrupt
              - QEI_INTFLAG_ENCLK_Int: An encoder clock pulse was detected
                interrupt
              - QEI_INTFLAG_POS0_Int: position 0 compare value is equal to the
                current position interrupt
              - QEI_INTFLAG_POS1_Int: position 1 compare value is equal to the
                current position interrupt
              - QEI_INTFLAG_POS2_Int: position 2 compare value is equal to the
                current position interrupt
              - QEI_INTFLAG_REV_Int: Index compare value is equal to the current
                index count interrupt
              - QEI_INTFLAG_POS0REV_Int: Combined position 0 and revolution 
                count interrupt
              - QEI_INTFLAG_POS1REV_Int: Combined position 1 and revolution 
                count interrupt
              - QEI_INTFLAG_POS2REV_Int: Combined position 2 and revolution 
                count interrupt 
  return: New State of specified interrupt flag status (SET or RESET)
  
  '''
  return robocaller("QEI_GetIntStatus", "FlagStatus", QEIx, ulIntType)
예제 #16
0
def NVIC_SetVTOR(offset):
    """Set Vector Table Offset value.
  
  offset: Offset value
  
  """
    return robocaller("NVIC_SetVTOR", "void", offset)
예제 #17
0
def SPI_ClearIntPending(SPIx):
  '''Clear SPI interrupt flag.
  
  SPIx: SPI peripheral definition, should be LPC_SPI
  
  '''
  return robocaller("SPI_ClearIntPending", "void", SPIx)
예제 #18
0
def PWM_ResetCounter(PWMx):
  '''Reset Counter in PWM peripheral.
  
  PWMx: PWM peripheral, should be LPC_PWM1
  
  '''
  return robocaller("PWM_ResetCounter", "void", PWMx)
예제 #19
0
def WDT_UpdateTimeOut(TimeOut):
  '''Update WDT timeout value and feed.
  
  TimeOut:  timeout value to be updated
  
  '''
  return robocaller("WDT_UpdateTimeOut", "void", TimeOut)
예제 #20
0
def MCPWM_Init(MCPWMx):
  '''Initializes the MCPWM peripheral.
  
  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  
  '''
  return robocaller("MCPWM_Init", "void", MCPWMx)
예제 #21
0
def CLKPWR_GetPCLKSEL(ClkType):
    """Get current value of each Peripheral Clock Selection.
  
  ClkType:  Peripheral Clock Selection of each type. Should be:
            CLKPWR_PCLKSEL_WDT      : WDT
            CLKPWR_PCLKSEL_TIMER0   : Timer 0
            CLKPWR_PCLKSEL_TIMER1   : Timer 1
            CLKPWR_PCLKSEL_UART0    : UART 0
            CLKPWR_PCLKSEL_UART1    : UART 1
            CLKPWR_PCLKSEL_PWM1     : PWM 1
            CLKPWR_PCLKSEL_I2C0     : I2C 0
            CLKPWR_PCLKSEL_SPI      : SPI
            CLKPWR_PCLKSEL_SSP1     : SSP 1
            CLKPWR_PCLKSEL_DAC      : DAC
            CLKPWR_PCLKSEL_ADC      : ADC
            CLKPWR_PCLKSEL_CAN1     : CAN 1
            CLKPWR_PCLKSEL_CAN2     : CAN 2
            CLKPWR_PCLKSEL_ACF      : ACF
            CLKPWR_PCLKSEL_QEI      : QEI
            CLKPWR_PCLKSEL_PCB      : PCB
            CLKPWR_PCLKSEL_I2C1     : I2C 1
            CLKPWR_PCLKSEL_SSP0     : SSP 0
            CLKPWR_PCLKSEL_TIMER2   : Timer 2
            CLKPWR_PCLKSEL_TIMER3   : Timer 3
            CLKPWR_PCLKSEL_UART2    : UART 2
            CLKPWR_PCLKSEL_UART3    : UART 3
            CLKPWR_PCLKSEL_I2C2     : I2C 2
            CLKPWR_PCLKSEL_I2S      : I2S
            CLKPWR_PCLKSEL_RIT      : RIT
            CLKPWR_PCLKSEL_SYSCON   : SYSCON
            CLKPWR_PCLKSEL_MC       : MC
  return: Value of Selected Peripheral Clock Selection
  
  """
    return robocaller("CLKPWR_GetPCLKSEL", "uint32_t", ClkType)
예제 #22
0
def PWM_DeInit(PWMx):
  '''De-initializes the PWM peripheral registers to their default reset values.
  
  PWMx: PWM peripheral, should be LPC_PWM1 
  
  '''
  return robocaller("PWM_DeInit", "void", PWMx)
예제 #23
0
def EMAC_UpdatePHYStatus():
  '''Auto-Configures value for the EMAC configuration register to match with 
  current PHY mode.
  
  return: 0 if no error, otherwise -1
  '''
  return robocaller("EMAC_UpdatePHYStatus", "int32_t")
예제 #24
0
def EMAC_SetFilterMode(ulFilterMode, NewState):
  '''Enable/Disable Filter mode for each specified type EMAC peripheral.
  
  ulFilterMode: Filter mode, should be:
                EMAC_RFC_UCAST_EN:  all frames of unicast types will be accepted
                EMAC_RFC_BCAST_EN:  broadcast frame will be accepted
                EMAC_RFC_MCAST_EN:  all frames of multicast types will be
                                    accepted
                EMAC_RFC_UCAST_HASH_EN: The imperfect hash filter will be
                                        applied to unicast addresses
                EMAC_RFC_MCAST_HASH_EN: The imperfect hash filter will be
                                        applied to multicast addresses
                EMAC_RFC_PERFECT_EN:  the destination address will be compared
                                      with the 6 byte station address programmed
                                      in the station address by the filter
                EMAC_RFC_MAGP_WOL_EN: the result of the magic packet filter will 
                                      generate a WoL interrupt when there is a
                                      match
                EMAC_RFC_PFILT_WOL_EN:  the result of the perfect address 
                                        matching filter and the imperfect hash
                                        filter will generate a WoL interrupt 
                                        when there is a match
  NewState: New State of this command, should be:
            ENABLE
            DISABLE
            
  '''
  return robocaller("EMAC_SetFilterMode", "void", ulFilterMode, NewState)
예제 #25
0
def SYSTICK_InternalInit(time):
  '''Initialize System Tick using internal CPU clock source.
  
  time: time interval(ms)
  
  '''
  return robocaller("SYSTICK_InternalInit", "void", time)
예제 #26
0
def I2S_DeInit(I2Sx):
  '''Deinitialize I2S transmit or receive.
  
  I2Sx: I2S peripheral selected, should be: LPC_I2S

  '''
  return robocaller("I2S_DeInit", "void", I2Sx)
예제 #27
0
def I2S_Init(I2Sx):
  '''Initialize I2S.
  
  I2Sx: I2S peripheral selected, should be: LPC_I2S

  '''
  return robocaller("I2S_Init", "void", I2Sx)
예제 #28
0
def I2S_Start(I2Sx):
  '''Clear all STOP,RESET and MUTE bit, ready to operate.
   
  I2Sx: I2S peripheral selected, should be: LPC_I2S
  
  '''
  return robocaller("I2S_Start", "void", I2Sx)
예제 #29
0
def SPI_ReceiveData(SPIx):
  '''Receive a single data from SPIx peripheral.
  
  SPIx: SPI peripheral definition, should be LPC_SPI
  return: Data received (16-bit long)
  
  '''
  return robocaller("SPI_ReceiveData", "uint16_t", SPIx)
예제 #30
0
def SPI_SetClock(SPIx, target_clock):
  '''Setup clock rate for SPI device.
  
  SPIx: SPI peripheral definition, should be LPC_SPI
  target_clock:  clock of SPI (Hz)
  
  '''
  return robocaller("SPI_SetClock", "void", SPIx, target_clock)
예제 #31
0
def UART_FullModemGetStatus(UARTx):
    '''Get current status of modem status register.
  
  UARTx:  LPC_UART1 (only)
  return: Current value of modem status register
  
  '''
    return robocaller("UART_FullModemGetStatus", "uint8_t", UARTx)
예제 #32
0
def SPI_DeInit(SPIx):
  '''De-initializes the SPIx peripheral registers to their reset values.
  
  SPIx: SPI peripheral definition, should be LPC_SPI
  
  
  '''
  return robocaller("SPI_DeInit", "void", SPIx)
예제 #33
0
def SPI_GetDataSize(SPIx):
  '''Get data bit size per transfer.
  
  SPIx: SPI peripheral definition, should be LPC_SPI
  return: number of bit per transfer, could be 8-16
  
  '''
  return robocaller("SPI_GetDataSize", "uint8_t", SPIx)
예제 #34
0
def SPI_GetIntStatus(SPIx):
  '''Checks whether the SPI interrupt flag is set or not.
  
  SPIx: SPI peripheral definition, should be LPC_SPI
  return: The new state of SPI Interrupt Flag (SET or RESET)
  
  '''
  return robocaller("SPI_GetIntStatus", "IntStatus", SPIx)
예제 #35
0
def UART_RS485SendSlvAddr(UARTx, SlvAddr):
    '''Send Slave address frames on RS485 bus.
  
  UARTx:  LPC_UART1 (only)
  SlvAddr:  Slave Address.

  '''
    return robocaller("UART_RS485SendSlvAddr", "void", UARTx, SlvAddr)
예제 #36
0
def EXTI_Config(EXTICfg):
    '''Configuration for EXT. Set EXTINT, EXTMODE, EXTPOLAR register.
  
  EXTICfg:  Pointer to a EXTI_InitTypeDef structure that contains the
            configuration information for the specified external interrupt
            
  '''
    return robocaller("EXTI_Config", "void", EXTICfg)
예제 #37
0
def DAC_ConfigDAConverterControl(DACx, DAC_ConverterConfigStruct):
  '''To enable the DMA operation and control DMA timer.
  
  DACx: pointer to LPC_DAC_TypeDef, should be: LPC_DAC
  DAC_ConverterConfigStruct: pointer to DAC_CONVERTER_CFG_Type
  
  '''
  return robocaller("DAC_ConfigDAConverterControl", "void", DACx, DAC_ConverterConfigStruct)
예제 #38
0
def DAC_UpdateValue(DACx, dac_value):
  '''Update value to DAC.
  
  DACx: pointer to LPC_DAC_TypeDef, should be: LPC_DAC
  dac_value: value 10 bit to be converted to output
  
  '''
  return robocaller("DAC_UpdateValue", "void", DACx, dac_value)
예제 #39
0
def vF_dspl_vectaddconst32(pi_y, pi_x, i_c, i_VectorLen):
  '''Adds a constant integer i_c to each element in vector pi_x and outputs in pi_y
  
  pi_x, pi_y: pointer to 32bit integer arrays
  i_c: integer
  i_VectorLen: length of vector
  
  '''
  return robocaller("vF_dspl_vectaddconst32", "void", pi_y, pi_x, i_c, i_VectorLen)
예제 #40
0
def vF_dspl_vectmulelement16(psi_z, psi_x, psi_y, i_VectorLen):
  '''(Doesn't work?) Element by element multiplication of unsigned vectors
  
  pi_x, pi_y: pointers to integer arrays
  i_VectorLen: length of vector
  pi_z: result of element by element multiplication
  
  '''
  return robocaller("vF_dspl_vectmulelement16", "void", psi_z, psi_x, psi_y, i_VectorLen)
예제 #41
0
def vF_dspl_vectadd32(pi_z, pi_x, pi_y, i_VectorLen):
  '''Adds two unsigned 32 bit integer vectors and returns in pi_z
  
  pi_z: pi_x + pi_y
  pi_x, pi_y, pi_z: pointers to 32bit integer arrays
  i_VectorLen: length of vector
  
  '''
  return robocaller("vF_dspl_vectadd32", "void", pi_z, pi_x, pi_y, i_VectorLen)
예제 #42
0
def vF_dspl_vectaddconst16(psi_y, psi_x, si_c, i_VectorLen):
  '''Adds a constant integer i_c to each element in vector pi_x and outputs in pi_y
  
  psi_x, psi_y: pointer to signed integer arrays
  si_c: signed integer
  i_VectorLen: length of vector
  
  '''
  return robocaller("vF_dspl_vectaddconst16", "void", psi_y, psi_x, si_c, i_VectorLen)
예제 #43
0
def iF_dspl_dotproduct32(pi_x, pi_y, i_VectorLen):
  '''Performs pi_x dot pi_y
  
  pi_x, pi_y: pointers to integer arrays
  i_VectorLen: length of vectors
  return: integer dot product of pi_x and pi_y
  
  '''
  return robocaller("iF_dspl_dotproduct32", "int", pi_x, pi_y, i_VectorLen)
예제 #44
0
def vF_dspl_pid(si_Error, pS_Coeff):
  '''PID Controller
  
  si_Error: short int
  pS_Coeff: pointer to tS_pid_Coeff
  return:
  
  '''
  return robocaller("vF_dspl_pid", "int", si_Error, pS_Coeff)
예제 #45
0
def EMAC_UpdateRxConsumeIndex():
    '''Increase the RxConsumeIndex (after reading the Receive buffer to release 
  the Receive buffer) and wrap-around the index if it reaches the maximum
  Receive Number.
  '''
    return robocaller(
        "EMAC_UpdateRxConsumeIndex",
        "void",
    )
예제 #46
0
def EMAC_ReadPacketBuffer(pDataStruct):
    '''Read data from Rx packet data buffer at current index due to 
  RxConsumeIndex.
  
  pDataStruct:  Pointer to a EMAC_PACKETBUF_Type structure data that contain 
                specified information about Packet data buffer.
                
  '''
    return robocaller("EMAC_ReadPacketBuffer", "void", pDataStruct)
예제 #47
0
def PINSEL_ConfigTraceFunc(NewState):
    '''Configure trace function.
  
  NewState: should be one of the following:
            ENABLE : Enable Trace Function
            DISABLE : Disable Trace Function
  
  '''
    return robocaller("PINSEL_ConfigTraceFunc", "void", NewState)
예제 #48
0
def PWM_GetCaptureValue(PWMx, CaptureChannel):
  '''Read value of capture register PWM peripheral.
  
  PWMx: PWM peripheral, should be LPC_PWM1
  CaptureChannel: capture channel number, should be in range 0 to 1
  return: Value of capture register
  
  '''
  return robocaller("PWM_GetCaptureValue", "uint32_t", PWMx, CaptureChannel)
예제 #49
0
def FIO_ByteClearValue(portNum, byteNum, bitValue):
    '''Clear bits for FIO port in byte accessible style.
  
  portNum: Port number, in range from 0 to 4
  byteNum: Byte part number, should be in range from 0 to 3
  bitValue: Value that contains all bits in to clear, in range from 0 to 0xFF.
  
  '''
    return robocaller("FIO_ByteClearValue", "void", portNum, byteNum, bitValue)