Nut/OS  5.0.5
API Reference
XgNutArchArmStm32Us

Defines

#define USART_INIT_BAUTRATE   USART_INITSPEED
#define Rs485DE_L()
#define Rs485DE_H()
#define Rs485NRE_L()
#define Rs485NRE_H()
#define STM_USART_REMAP   GPIO_AF_USART1
 USART1 GPIO configuartion and assignment.
#define TX_GPIO_PORT   NUTGPIO_PORTA
#define TX_GPIO_PIN   9
#define RX_GPIO_PORT   NUTGPIO_PORTA
#define RX_GPIO_PIN   10
#define STM_USART_CLK   RCC_APB2Periph_USART1
 USART1 base configuration.
#define USART_HWFLOWCTRL   USART_HardwareFlowControl_None
#define USARTn   USART1
#define USARTnBase   USART1_BASE
#define USARTirqn   USART1_IRQn
#define USARTclk   NUT_HWCLK_PCLK1
#define UART_DR_PTR   (uint32_t*)(USARTnBase+4)
#define SigUSART   sig_USART1
#define DcbUSART   dcb_usart1
#define STM_USART_REMAP   GPIO_AF_USART6
 USART6 GPIO configuartion and assignment.
#define TX_GPIO_PORT   NUTGPIO_PORTC
#define TX_GPIO_PIN   6
#define RX_GPIO_PORT   NUTGPIO_PORTC
#define RX_GPIO_PIN   7
#define CK_GPIO_PORT   NUTGPIO_PORTC
#define CK_GPIO_PIN   8
#define STM_USART_CLK   RCC_APB2Periph_USART6
 USART6 base configuration.
#define USART_HWFLOWCTRL   USART_HardwareFlowControl_None
#define USARTn   USART6
#define USARTnBase   USART6_BASE
#define USARTirqn   USART6_IRQn
#define USARTclk   NUT_HWCLK_PCLK1
#define UART_DR_PTR   (uint32_t*)(USARTnBase+4)
#define SigUSART   sig_USART6
#define DcbUSART   dcb_usart6

Functions

int Stm32UsartSetStopBits (uint8_t bits)
 Set the USART hardware to the number of stop bits.
uint8_t Stm32UsartGetClockMode (void)
 Query the USART hardware for synchronous mode.

STM32 USART1 Device

NUTDEVICE devUsartStm32_1
 USART1 device information structure.

STM32 USART6 Device

NUTDEVICE devUsartStm32_6
 USART6 device information structure.

Define Documentation

#define USART_INIT_BAUTRATE   USART_INITSPEED
#define Rs485DE_L ( )
#define Rs485DE_H ( )
#define Rs485NRE_L ( )
#define Rs485NRE_H ( )
#define STM_USART_REMAP   GPIO_AF_USART1

USART1 GPIO configuartion and assignment.

#define TX_GPIO_PORT   NUTGPIO_PORTA
#define TX_GPIO_PIN   9
#define RX_GPIO_PORT   NUTGPIO_PORTA
#define RX_GPIO_PIN   10
#define STM_USART_CLK   RCC_APB2Periph_USART1

USART1 base configuration.

#define USART_HWFLOWCTRL   USART_HardwareFlowControl_None
#define USARTn   USART1
#define USARTnBase   USART1_BASE
#define USARTirqn   USART1_IRQn
#define USARTclk   NUT_HWCLK_PCLK1
#define UART_DR_PTR   (uint32_t*)(USARTnBase+4)
#define SigUSART   sig_USART1
#define DcbUSART   dcb_usart1
#define STM_USART_REMAP   GPIO_AF_USART6

USART6 GPIO configuartion and assignment.

#define TX_GPIO_PORT   NUTGPIO_PORTC
#define TX_GPIO_PIN   6
#define RX_GPIO_PORT   NUTGPIO_PORTC
#define RX_GPIO_PIN   7
#define CK_GPIO_PORT   NUTGPIO_PORTC
#define CK_GPIO_PIN   8
#define STM_USART_CLK   RCC_APB2Periph_USART6

USART6 base configuration.

#define USART_HWFLOWCTRL   USART_HardwareFlowControl_None
#define USARTn   USART6
#define USARTnBase   USART6_BASE
#define USARTirqn   USART6_IRQn
#define USARTclk   NUT_HWCLK_PCLK1
#define UART_DR_PTR   (uint32_t*)(USARTnBase+4)
#define SigUSART   sig_USART6
#define DcbUSART   dcb_usart6

Function Documentation

int Stm32UsartSetStopBits ( uint8_t  bits)

Set the USART hardware to the number of stop bits.

This routine is called by ioctl function of the upper level USART driver through the USARTDCB jump table.

Returns:
0 on success, -1 otherwise.

References rc, USART_CR2_STOP, USART_CR2_STOP_1, and USARTn.

uint8_t Stm32UsartGetClockMode ( void  )

Query the USART hardware for synchronous mode.

This function is called by ioctl function of the upper level USART driver through the USARTDCB jump table.

Not implemented for the STM32 USART. Always returns 0.

Returns:
Or-ed combination of UART_SYNC, UART_MASTER, UART_NCLOCK and UART_HIGHSPEED.

Variable Documentation

Initial value:
 {
    0,                          
    {'u', 's', 'a', 'r', 't', '1', 0, 0, 0},    
    IFTYP_CHAR,                 
    USART1_BASE,                
    USART1_IRQn,                
    NULL,                       
    &dcb_usart1,                
    UsartInit,                  
    UsartIOCtl,                 
    UsartRead,                  
    UsartWrite,                 
    UsartOpen,                  
    UsartClose,                 
    UsartSize                   
}

USART1 device information structure.

An application must pass a pointer to this structure to NutRegisterDevice() before using the serial communication driver of the AT91's on-chip USART1.

The device is named uart1.

Initial value:
 {
    0,                          
    {'u', 's', 'a', 'r', 't', '6', 0, 0, 0},    
    IFTYP_CHAR,                 
    USART6_BASE,                
    USART6_IRQn,                
    NULL,                       
    &dcb_usart6,                
    UsartInit,                  
    UsartIOCtl,                 
    UsartRead,                  
    UsartWrite,                 
    UsartOpen,                  
    UsartClose,                 
    UsartSize                   
}

USART6 device information structure.

An application must pass a pointer to this structure to NutRegisterDevice() before using the serial communication driver of the AT91's on-chip USART6.

The device is named uart6.