EasyManua.ls Logo

TELINK SEMICONDUCTOR TLSR8232 - GPIO Module; GPIO Definition; GPIO State Control

Default Icon
211 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1 40 Ver.1.0.0
a_trig_tick = clock_time();
a_trig_flg = 1;
}
if(a_trig_flg &&clock_time_exceed(a_trig_tick,2 *1000 * 1000)){
a_trig_flg = 0;
B();
}
}
2.3 GPIO Module
For details about GPIO module, please refer to source code in
drivers/5316/gpio_default.h”, “gpio.cand “gpio.h”.
Please refer to document Hawk_gpio_lookuptable for understanding register operations
in the code.
2.3.1 GPIO Definition
5316 IC has 23 GPIOs in three groups:
GPIO_PA0 - GPIO_PA7, GPIO_PB0 - GPIO_PB7, GPIO_PC1 - GPIO_PC7
Please note: there are 23 GPIOs in IC core, but in actual IC packages not all the GPIOs
are packaged, such as the 24-pin package has part of the GPIOs. Therefore, users
should refer to the actual IC package when using GPIOs.
Please follow the format above to use GPIO, see drivers/5316/gpio.c” for details.
There is a special GPIO with SWS (Single Wire Slave) function. Its SWS function for
debugging and firmware burning is enabled when power on. Generally it is not used in
firmware. The SWS pin of 5316 is PC7.
2.3.2 GPIO State Control
In this section only the basic GPIO states are listed.
1. func: Configure pin as special function or general GPIO. To use input/output function,
the pin should be configured as general GPIO.
void gpio_set_func(GPIO_PinTypeDef pin, GPIO_FuncTypeDef func);
“func” can be configured as “AS_GPIO or other special functions.
2. ie: Input enable
void gpio_set_input_en(GPIO_PinTypeDef pin, unsigned int value)
Value: 1-enable, 0-disable.
3. datai: Data input. When input is enabled for some GPIO pin, the datai value
indicates its current input level.

Table of Contents