mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-05-22 09:37:00 +08:00
feat(driver): Use standard typedef
This commit is contained in:
@ -19,6 +19,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "esp8266/gpio_register.h"
|
||||
|
||||
#define ETS_GPIO_INTR_ENABLE() _xt_isr_unmask(1 << ETS_GPIO_INUM)
|
||||
@ -106,7 +108,7 @@ typedef enum {
|
||||
} GPIO_Pullup_IF;
|
||||
|
||||
typedef struct {
|
||||
uint16 GPIO_Pin; /**< GPIO pin */
|
||||
uint16_t GPIO_Pin; /**< GPIO pin */
|
||||
GPIOMode_TypeDef GPIO_Mode; /**< GPIO mode */
|
||||
GPIO_Pullup_IF GPIO_Pullup; /**< GPIO pullup */
|
||||
GPIO_INT_TYPE GPIO_IntrType; /**< GPIO interrupt type */
|
||||
@ -199,11 +201,11 @@ void gpio16_output_conf(void);
|
||||
/**
|
||||
* @brief Set GPIO16 output level.
|
||||
*
|
||||
* @param uint8 value : GPIO16 output level.
|
||||
* @param uint8_t value : GPIO16 output level.
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
void gpio16_output_set(uint8 value);
|
||||
void gpio16_output_set(uint8_t value);
|
||||
|
||||
/**
|
||||
* @brief Enable GPIO pin intput.
|
||||
@ -221,23 +223,23 @@ void gpio16_input_conf(void);
|
||||
*
|
||||
* @return the level of GPIO16 input.
|
||||
*/
|
||||
uint8 gpio16_input_get(void);
|
||||
uint8_t gpio16_input_get(void);
|
||||
|
||||
/**
|
||||
* @brief Configure Gpio pins out or input.
|
||||
*
|
||||
* @param uint32 set_mask : Set the output for the high bit, the
|
||||
* @param uint32_t set_mask : Set the output for the high bit, the
|
||||
* corresponding bit is 1, the output of high,
|
||||
* the corresponding bit is 0, do not change the state.
|
||||
* @param uint32 set_mask : Set the output for the high bit, the
|
||||
* @param uint32_t set_mask : Set the output for the high bit, the
|
||||
* corresponding bit is 1, the output of low,
|
||||
* the corresponding bit is 0, do not change the state.
|
||||
* @param uint32 enable_mask : Enable Output
|
||||
* @param uint32 disable_mask : Enable Input
|
||||
* @param uint32_t enable_mask : Enable Output
|
||||
* @param uint32_t disable_mask : Enable Input
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
void gpio_output_conf(uint32 set_mask, uint32 clear_mask, uint32 enable_mask, uint32 disable_mask);
|
||||
void gpio_output_conf(uint32_t set_mask, uint32_t clear_mask, uint32_t enable_mask, uint32_t disable_mask);
|
||||
|
||||
/**
|
||||
* @brief Register an application-specific interrupt handler for GPIO pin interrupts.
|
||||
@ -252,12 +254,12 @@ void gpio_intr_handler_register(void* fn, void* arg);
|
||||
/**
|
||||
* @brief Configure GPIO wake up to light sleep,Only level way is effective.
|
||||
*
|
||||
* @param uint32 i : Gpio sequence number
|
||||
* @param uint32_t i : Gpio sequence number
|
||||
* @param GPIO_INT_TYPE intr_state : the level of wake up to light sleep
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
void gpio_pin_wakeup_enable(uint32 i, GPIO_INT_TYPE intr_state);
|
||||
void gpio_pin_wakeup_enable(uint32_t i, GPIO_INT_TYPE intr_state);
|
||||
|
||||
/**
|
||||
* @brief Disable GPIO wake up to light sleep.
|
||||
@ -271,12 +273,12 @@ void gpio_pin_wakeup_disable();
|
||||
/**
|
||||
* @brief Config interrupt types of GPIO pin.
|
||||
*
|
||||
* @param uint32 i : The GPIO sequence number.
|
||||
* @param uint32_t i : The GPIO sequence number.
|
||||
* @param GPIO_INT_TYPE intr_state : GPIO interrupt types.
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
void gpio_pin_intr_state_set(uint32 i, GPIO_INT_TYPE intr_state);
|
||||
void gpio_pin_intr_state_set(uint32_t i, GPIO_INT_TYPE intr_state);
|
||||
|
||||
/**
|
||||
* @brief Sample the value of GPIO input pins and returns a bitmask.
|
||||
@ -285,7 +287,7 @@ void gpio_pin_intr_state_set(uint32 i, GPIO_INT_TYPE intr_state);
|
||||
*
|
||||
* @return bitmask of GPIO pins input
|
||||
*/
|
||||
uint32 gpio_input_get(void);
|
||||
uint32_t gpio_input_get(void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -43,15 +43,15 @@ void hw_timer_init(void);
|
||||
/**
|
||||
* @brief Set a trigger timer delay to enable this timer.
|
||||
*
|
||||
* @param uint32 val : Timing
|
||||
* @param uint32_t val : Timing
|
||||
* - In autoload mode, range : 50 ~ 0x7fffff
|
||||
* - In non-autoload mode, range : 10 ~ 0x7fffff
|
||||
*
|
||||
* @param uint8 req : 0, not autoload; 1, autoload mode.
|
||||
* @param uint8_t req : 0, not autoload; 1, autoload mode.
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
void hw_timer_arm(uint32 val, bool req);
|
||||
void hw_timer_arm(uint32_t val, bool req);
|
||||
|
||||
/**
|
||||
* @brief disable this timer.
|
||||
@ -67,7 +67,7 @@ void hw_timer_disarm(void);
|
||||
*
|
||||
* For enabled timer, timer callback has to be set.
|
||||
*
|
||||
* @param uint32 val : Timing
|
||||
* @param uint32_t val : Timing
|
||||
* - In autoload mode, range : 50 ~ 0x7fffff
|
||||
* - In non-autoload mode, range : 10 ~ 0x7fffff
|
||||
*
|
||||
|
@ -117,7 +117,7 @@ void i2c_master_start(void);
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
void i2c_master_setAck(uint8 level);
|
||||
void i2c_master_setAck(uint8_t level);
|
||||
|
||||
/**
|
||||
* @brief confirm if peer send ack.
|
||||
@ -126,7 +126,7 @@ void i2c_master_setAck(uint8 level);
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
uint8 i2c_master_getAck(void);
|
||||
uint8_t i2c_master_getAck(void);
|
||||
|
||||
/**
|
||||
* @brief read Byte from i2c bus.
|
||||
@ -135,16 +135,16 @@ uint8 i2c_master_getAck(void);
|
||||
*
|
||||
* @return the byte which read from i2c bus.
|
||||
*/
|
||||
uint8 i2c_master_readByte(void);
|
||||
uint8_t i2c_master_readByte(void);
|
||||
|
||||
/**
|
||||
* @brief write wrdata value(one byte) into i2c.
|
||||
*
|
||||
* @param uint8 wrdata:write value
|
||||
* @param uint8_t wrdata:write value
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
void i2c_master_writeByte(uint8 wrdata);
|
||||
void i2c_master_writeByte(uint8_t wrdata);
|
||||
|
||||
/**
|
||||
* @brief i2c_master_checkAck.
|
||||
|
@ -93,15 +93,15 @@ typedef struct {
|
||||
UART_ParityMode parity; // chip size in byte
|
||||
UART_StopBits stop_bits;
|
||||
UART_HwFlowCtrl flow_ctrl;
|
||||
uint8 UART_RxFlowThresh ;
|
||||
uint32 UART_InverseMask;
|
||||
uint8_t UART_RxFlowThresh ;
|
||||
uint32_t UART_InverseMask;
|
||||
} UART_ConfigTypeDef;
|
||||
|
||||
typedef struct {
|
||||
uint32 UART_IntrEnMask;
|
||||
uint8 UART_RX_TimeOutIntrThresh;
|
||||
uint8 UART_TX_FifoEmptyIntrThresh;
|
||||
uint8 UART_RX_FifoFullIntrThresh;
|
||||
uint32_t UART_IntrEnMask;
|
||||
uint8_t UART_RX_TimeOutIntrThresh;
|
||||
uint8_t UART_TX_FifoEmptyIntrThresh;
|
||||
uint8_t UART_RX_FifoFullIntrThresh;
|
||||
} UART_IntrConfTypeDef;
|
||||
|
||||
//=======================================
|
||||
@ -144,21 +144,21 @@ void UART_ResetFifo(UART_Port uart_no);
|
||||
* @brief Clear uart interrupt flags.
|
||||
*
|
||||
* @param UART_Port uart_no : UART0 or UART1
|
||||
* @param uint32 clr_mask : To clear the interrupt bits
|
||||
* @param uint32_t clr_mask : To clear the interrupt bits
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
void UART_ClearIntrStatus(UART_Port uart_no, uint32 clr_mask);
|
||||
void UART_ClearIntrStatus(UART_Port uart_no, uint32_t clr_mask);
|
||||
|
||||
/**
|
||||
* @brief Enable uart interrupts .
|
||||
*
|
||||
* @param UART_Port uart_no : UART0 or UART1
|
||||
* @param uint32 ena_mask : To enable the interrupt bits
|
||||
* @param uint32_t ena_mask : To enable the interrupt bits
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
void UART_SetIntrEna(UART_Port uart_no, uint32 ena_mask);
|
||||
void UART_SetIntrEna(UART_Port uart_no, uint32_t ena_mask);
|
||||
|
||||
/**
|
||||
* @brief Register an application-specific interrupt handler for Uarts interrupts.
|
||||
@ -233,22 +233,22 @@ void UART_SetParity(UART_Port uart_no, UART_ParityMode Parity_mode) ;
|
||||
* @brief Configure the Baud rate.
|
||||
*
|
||||
* @param UART_Port uart_no : UART0 or UART1
|
||||
* @param uint32 baud_rate : the Baud rate
|
||||
* @param uint32_t baud_rate : the Baud rate
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
void UART_SetBaudrate(UART_Port uart_no, uint32 baud_rate);
|
||||
void UART_SetBaudrate(UART_Port uart_no, uint32_t baud_rate);
|
||||
|
||||
/**
|
||||
* @brief Configure Hardware flow control.
|
||||
*
|
||||
* @param UART_Port uart_no : UART0 or UART1
|
||||
* @param UART_HwFlowCtrl flow_ctrl : Hardware flow control mode
|
||||
* @param uint8 rx_thresh : threshold of Hardware flow control
|
||||
* @param uint8_t rx_thresh : threshold of Hardware flow control
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
void UART_SetFlowCtrl(UART_Port uart_no, UART_HwFlowCtrl flow_ctrl, uint8 rx_thresh);
|
||||
void UART_SetFlowCtrl(UART_Port uart_no, UART_HwFlowCtrl flow_ctrl, uint8_t rx_thresh);
|
||||
|
||||
/**
|
||||
* @brief Configure trigging signal of uarts.
|
||||
|
Reference in New Issue
Block a user