| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589 |
- /**
- * @file wm_gpio_afsel.h
- *
- * @brief GPIO Driver Module
- *
- * @author dave
- *
- * Copyright (c) 2014 Winner Microelectronics Co., Ltd.
- */
- #ifndef WM_GPIO_AFSEL_H
- #define WM_GPIO_AFSEL_H
- #include "wm_gpio.h"
- #include "wm_regs.h"
- #include "wm_irq.h"
- #include "wm_osal.h"
- #include "tls_common.h"
- /**
- * @addtogroup Driver_APIs
- * @{
- */
- /**
- * @defgroup IOMUX_Driver_APIs IOMUX Driver APIs
- * @brief IO Multiplex driver APIs
- */
- /**
- * @addtogroup IOMUX_Driver_APIs
- * @{
- */
- /**
- * @brief config the pins used for highspeed spi
- * @param numsel: config highspeed spi pins multiplex relation,valid para 0,1
- * 0: hspi0 1: hspi1 only for 56pin
- * hspi_ck PB06 hspi_ck PB12
- * hspi_int PB07 hspi_int PB13
- * hspi_cs PB09 hspi_cs PB14
- * hspi_di PB10 hspi_di PB15
- * hspi_do PB11 hspi_do PB16
- * @return None
- */
- void wm_hspi_gpio_config(uint8_t numsel);
- /**
- * @brief config the pins used for spi ck
- * @param io_name: config spi ck pins name
- * WM_IO_PB_01
- * WM_IO_PB_02
- * WM_IO_PB_15 only for 56pin
- * WM_IO_PB_24 only for 56pin
- *
- * @return None
- */
- void wm_spi_ck_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for spi cs
- * @param io_name: config spi cs pins name
- * WM_IO_PA_00
- * WM_IO_PB_04
- * WM_IO_PB_14 only for 56pin
- * WM_IO_PB_23 only for 56pin
- *
- * @return None
- */
- void wm_spi_cs_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for spi di
- * @param io_name: config spi di pins name
- * WM_IO_PB_00
- * WM_IO_PB_03
- * WM_IO_PB_16 only for 56pin
- * WM_IO_PB_25 only for 56pin
- *
- * @return None
- */
- void wm_spi_di_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for spi do
- * @param io_name: config spi do pins name
- * WM_IO_PA_07
- * WM_IO_PB_05
- * WM_IO_PB_17 only for 56pin
- * WM_IO_PB_26 only for 56pin
- *
- * @return None
- */
- void wm_spi_do_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for sdio host ck dat0 dat1 dat2 dat3
- * @param numsel: config sdio ck cmd dat0 dat1 dat2 dat3 pins multiplex relation,valid para 0,1
- * 0: 1: only for 56pin
- * sdio_ck PB06 sdio_ck PA09
- * sdio_cmd PB07 sdio_cmd PA10
- * sdio_dat0 PB08 sdio_dat0 PA11
- * sdio_dat1 PB09 sdio_dat1 PA12
- * sdio_dat2 PB10 sdio_dat2 PA13
- * sdio_dat3 PB11 sdio_dat3 PA14
- *
- * @return None
- */
- void wm_sdio_host_config(uint8_t numsel);
- /**
- * @brief config the pins used for sdio slave ck dat0 dat1 dat2 dat3
- * @param numsel: config sdio ck cmd dat0 dat1 dat2 dat3 pins multiplex relation,valid para 0
- * 0:
- * sdio_ck PB06
- * sdio_cmd PB07
- * sdio_dat0 PB08
- * sdio_dat1 PB09
- * sdio_dat2 PB10
- * sdio_dat3 PB11
- *
- * @return None
- */
- void wm_sdio_slave_config(uint8_t numsel);
- /**
- * @brief config the pins used for psram ck cs dat0 dat1 dat2 dat3
- * @param numsel: config psram ck cs dat0 dat1 dat2 dat3 pins multiplex relation,valid para 0,1
- * 0: 1: only for 56pin
- * psram_ck PB00 psram_ck PA15
- * psram_cs PB01 psram_cs PB27
- * psram_dat0 PB02 psram_dat0 PB02
- * psram_dat1 PB03 psram_dat1 PB03
- * psram_dat2 PB04 psram_dat2 PB04
- * psram_dat3 PB05 psram_dat3 PB05
- * @return None
- */
- void wm_psram_config(uint8_t numsel);
- /**
- * @brief config the pins used for uart0 tx
- * @param io_name: config uart0 tx pins name
- * WM_IO_PB_19
- * WM_IO_PB_27 only for 56pin
- *
- * @return None
- */
- void wm_uart0_tx_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart0 rx
- * @param io_name: config uart0 rx pins name
- * WM_IO_PB_20
- *
- * @return None
- */
- void wm_uart0_rx_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart1 tx
- * @param io_name: config uart1 tx pins name
- * WM_IO_PB_06
- *
- * @return None
- */
- void wm_uart1_tx_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart1 rx
- * @param io_name: config uart1 rx pins name
- * WM_IO_PB_07
- * WM_IO_PB_16 only for 56pin
- *
- * @return None
- */
- void wm_uart1_rx_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart1 rts
- * @param io_name: config uart1 rts pins name
- * WM_IO_PB_19
- * WM_IO_PA_02 only for 56pin
- *
- * @return None
- */
- void wm_uart1_rts_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart1 cts
- * @param io_name: config uart1 cts pins name
- * WM_IO_PB_20
- * WM_IO_PA_03 only for 56pin
- *
- * @return None
- */
- void wm_uart1_cts_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart2 tx or 7816-io
- * @param io_name: config uart2 tx or 7816-io pins name
- * WM_IO_PB_02
- * WM_IO_PA_02 only for 56pin
- *
- * @return None
- */
- void wm_uart2_tx_scio_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart2 rx
- * @param io_name: config uart2 rx pins name
- * WM_IO_PB_03
- * WM_IO_PA_03 only for 56pin
- *
- * @return None
- */
- void wm_uart2_rx_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart2 rts or 7816-clk
- * @param io_name: config uart2 rts or 7816-clk pins name
- * WM_IO_PB_04
- * WM_IO_PA_05 only for 56pin
- *
- * @return None
- */
- void wm_uart2_rts_scclk_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart2 cts
- * @param io_name: config uart2 cts pins name
- * WM_IO_PB_05
- * WM_IO_PA_06 only for 56pin
- *
- * @return None
- */
- void wm_uart2_cts_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart3 tx
- * @param io_name: config uart1 tx pins name
- * WM_IO_PB_00
- * WM_IO_PA_05 only for 56pin
- *
- * @return None
- */
- void wm_uart3_tx_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart3 rx
- * @param io_name: config uart1 rx pins name
- * WM_IO_PB_01
- * WM_IO_PA_06 only for 56pin
- *
- * @return None
- */
- void wm_uart3_rx_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart3 rts
- * @param io_name: config uart3 rts pins name
- * WM_IO_PA_02
- *
- * @return None
- */
- void wm_uart3_rts_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart3 cts
- * @param io_name: config uart3 cts pins name
- * WM_IO_PA_03
- *
- * @return None
- */
- void wm_uart3_cts_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart4 tx
- * @param io_name: config uart1 tx pins name
- * WM_IO_PB_04
- * WM_IO_PA_08 only for 56pin
- *
- * @return None
- */
- void wm_uart4_tx_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart4 rx
- * @param io_name: config uart1 rx pins name
- * WM_IO_PB_05
- * WM_IO_PA_09 only for 56pin
- *
- * @return None
- */
- void wm_uart4_rx_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart4 rts
- * @param io_name: config uart4 rts pins name
- * WM_IO_PA_05 only for 56pin
- * WM_IO_PA_10 only for 56pin
- *
- * @return None
- */
- void wm_uart4_rts_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart4 cts
- * @param io_name: config uart4 cts pins name
- * WM_IO_PA_06 only for 56pin
- * WM_IO_PA_11 only for 56pin
- *
- * @return None
- */
- void wm_uart4_cts_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart4 tx
- * @param io_name: config uart1 tx pins name
- * WM_IO_PA_08 only for 56pin
- * WM_IO_PA_12 only for 56pin
- * WM_IO_PB_18 only for 56pin
- *
- * @return None
- */
- void wm_uart5_tx_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart4 rx
- * @param io_name: config uart1 rx pins name
- * WM_IO_PA_09 only for 56pin
- * WM_IO_PA_13 only for 56pin
- * WM_IO_PB_17 only for 56pin
- *
- * @return None
- */
- void wm_uart5_rx_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart4 rts
- * @param io_name: config uart4 rts pins name
- * WM_IO_PA_14 only for 56pin
- * WM_IO_PB_12 only for 56pin
- *
- * @return None
- */
- void wm_uart5_rts_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for uart4 cts
- * @param io_name: config uart4 cts pins name
- * WM_IO_PA_15 only for 56pin
- * WM_IO_PB_13 only for 56pin
- *
- * @return None
- */
- void wm_uart5_cts_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for i2s ck
- * @param io_name: config i2s master ck pins name
- * WM_IO_PA_04
- * WM_IO_PB_08
- * WM_IO_PA_08 only for 56pin
- * WM_IO_PB_12 only for 56pin
- *
- * @return None
- */
- void wm_i2s_ck_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for i2s ws
- * @param io_name: config i2s master ws pins name
- * WM_IO_PA_01
- * WM_IO_PB_09
- * WM_IO_PA_09 only for 56pin
- * WM_IO_PB_13 only for 56pin
- *
- * @return None
- */
- void wm_i2s_ws_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for i2s do
- * @param io_name: config i2s master do pins name
- * WM_IO_PA_00
- * WM_IO_PB_11
- * WM_IO_PA_10 only for 56pin
- * WM_IO_PB_14 only for 56pin
- *
- * @return None
- */
- void wm_i2s_do_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for i2s di
- * @param io_name: config i2s slave di pins name
- * WM_IO_PA_07
- * WM_IO_PB_10
- * WM_IO_PA_11 only for 56pin
- * WM_IO_PB_15 only for 56pin
- *
- * @return None
- */
- void wm_i2s_di_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for i2s mclk
- * @param io_name: config i2s mclk pins name
- * WM_IO_PA_00
- *
- * @return None
- */
- void wm_i2s_mclk_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for i2s extclk
- * @param io_name: config i2s extclk pins name
- * WM_IO_PA_07
- *
- * @return None
- */
- void wm_i2s_extclk_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for i2c scl
- * @param io_name: config i2c scl pins name
- * WM_IO_PA_01
- * WM_IO_PB_20
- *
- * @return None
- */
- void wm_i2c_scl_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for i2c sda
- * @param io_name: config i2c sda pins name
- * WM_IO_PA_04
- * WM_IO_PB_19
- *
- * @return None
- */
- void wm_i2c_sda_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for pwm0
- * @param io_name: config pwm1 pins name
- * WM_IO_PB_00
- * WM_IO_PB_19
- * WM_IO_PA_02 only for 56pin
- * WM_IO_PA_10 only for 56pin
- * WM_IO_PB_12 only for 56pin
- *
- * @return None
- */
- void wm_pwm0_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for pwm1
- * @param io_name: config pwm1 pins name
- * WM_IO_PB_01
- * WM_IO_PB_20
- * WM_IO_PA_03 only for 56pin
- * WM_IO_PA_11 only for 56pin
- * WM_IO_PB_13 only for 56pin
- *
- * @return None
- */
- void wm_pwm1_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for pwm2
- * @param io_name: config pwm3 pins name
- * WM_IO_PA_00
- * WM_IO_PB_02
- * WM_IO_PA_12 only for 56pin
- * WM_IO_PB_14 only for 56pin
- * WM_IO_PB_24 only for 56pin
- *
- * @return None
- */
- void wm_pwm2_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for pwm3
- * @param io_name: config pwm4 pins name
- * WM_IO_PA_01
- * WM_IO_PB_03
- * WM_IO_PA_13 only for 56pin
- * WM_IO_PB_15 only for 56pin
- * WM_IO_PB_25 only for 56pin
- *
- * @return None
- */
- void wm_pwm3_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for pwm4
- * @param io_name: config pwm5 pins name
- * WM_IO_PA_04
- * WM_IO_PA_07
- * WM_IO_PA_14 only for 56pin
- * WM_IO_PB_16 only for 56pin
- * WM_IO_PB_26 only for 56pin
- *
- * @return None
- */
- void wm_pwm4_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for pwm break
- * @param io_name: config pwm break pins name
- * WM_IO_PB_08
- * WM_IO_PA_05 only for 56pin
- * WM_IO_PA_08 only for 56pin
- * WM_IO_PA_15 only for 56pin
- * WM_IO_PB_17 only for 56pin
- *
- * @return None
- */
- void wm_pwmbrk_config(enum tls_io_name io_name);
- /**
- * @brief config the pins used for swd
- * @param enable: enable or disable chip swd function
- * 1: enable
- * 0: disable
- *
- * @return None
- */
- void wm_swd_config(bool enable);
- /**
- * @brief config the pins used for adc
- * @param Channel: the channel that shall be used
- * 0~1: single-ended input
- * 2~3: single-ended input only for 56pin
- * 0 and 1 can be used differential input
- * 2 and 3 can be used differential input only for 56pin
- *
- * @return None
- */
- void wm_adc_config(u8 Channel);
- /**
- * @brief config the pins used for touch sensor
- * @param io_name: config touch sensor pins name
- * WM_IO_PA_07
- * WM_IO_PB_00
- * WM_IO_PB_01
- * WM_IO_PB_02
- * WM_IO_PB_03
- * WM_IO_PB_04
- * WM_IO_PB_05
- * WM_IO_PB_06
- * WM_IO_PB_07
- * WM_IO_PB_08
- * WM_IO_PB_09
- * WM_IO_PA_09 only for 56pin
- * WM_IO_PA_10 only for 56pin
- * WM_IO_PA_12 only for 56pin
- * WM_IO_PA_14 only for 56pin
- *
- * @return None
- * @note If user use touch sensor function, firstly consider using WM_IO_PA_07 as TOUCH SENSOR pin.
- */
- void wm_touch_sensor_config(enum tls_io_name io_name);
- /**
- * @brief disable all the gpio af
- *
- * @return None
- *
- * @note This function must call before any others for configure
- * gpio Alternate functions
- */
- void wm_gpio_af_disable(void);
- /**
- * @}
- */
- /**
- * @}
- */
- #endif /* end of WM_GPIO_AFSEL_H */
|