当前位置:网站首页>Drive subsystem development
Drive subsystem development
2022-07-24 20:41:00 【51CTO】
One 、GPIO And interrupt
The interface is introduced
wifiiot_gpio.h Interface
Its function is to initialize GPIO.
The interface name | function |
GpioInit | initialization GPIO |
GpioDeinit | Uninitialize GPIO |
GpioSetDir | Set up GPIO Pin direction |
GpioGetDir | obtain GPIO Pin direction |
GpioSetOutputVal | Set up GPIO Pin output level value |
GpioGetOutputVal | obtain GPIO Pin output level value |
wifiiot_gpio_ex.h Interface
Its function is to set GPIO Tension and drive strength .
The interface name | function |
IoSetPull | Set up GPIO Pin pull-up |
IoGetPull | obtain GPIO Pin pull-up |
IoSetFunc | Set up GPIO Pin function |
IoGetFunc | obtain GPIO Pin function |
IOSetDriverStrength | Set up GPIO Driving ability |
IOGetDriverStrength | obtain GPIO Driving ability |
see LED Corresponding GPIO Pin
LED Corresponding GPIO The pin is GPIO2 adopt control GPIO2 Output level signal to realize present LED The flicker of the lamp .
● When the power is high, it is on LED The lamp .
● Low power usually goes out LED The lamp .


GPIO interrupt
1.GPIO interrupt API Introduce wifiiot_gpio.h Interface profile :
wifiliot_gpio.h Contains a declaration GPIO Interrupt correlation function .
The interface name | function |
GpioRegisterIsrFunc | Set up GPIO Pin interrupt function |
GpioUnregisterIsrFunc | Cancel GPIO Pin interrupt function |
GpioSetIsrMask | shielding GPIO Pin interrupt function |
GpioSetIsrMode | Set up GPIO Pin interrupt trigger mode |
2. Check the corresponding GPIO Pin

3. operation GPIO Lighten up LED
open “B2_basic_button" engineering button_example.c file , You can view and realize key control in the code LED Code of light on and off


Two 、PWM Subsystem development
API Introduce

How to change LED The brightness of the lamp

The configuration file
A total of two need to be modified hcs file , Namely :device_info.hcs and pwm_config.hcs
1. First edit st\bearpi_hm_micro\liteos_a\hdf_config\device_info\device_info.hcs increase pwm node , This node should be in platform :: host Create under node . among policy=1 It means that the driver service is only released to the kernel ,moduleName It has to be for HDF_PLATFORM_PWM,serviceName Must be HDF_PLATFORM_PWM_ start , The following numbers are used to distinguish different pwm peripherals .
2. The second configuration file is created by yourself , stay \bearpi_hm_micro\liteos_a\hdf_config\ Record the creation pwm Catalog , Create... In the directory pwm_config.hcs, among PWM The counting frequency of is 1MHZ, Write dead in the code , You can modify ;physics_register Express TIM Register base address of , according to STM32MP1 Refer to the manual TIM2 The register address of is x40000000 The register address range is 0x70.

3、 ... and 、ADC Sampling development
The interface is introduced


Hardware design

software design
This function uses IoTAdcRead() Function to read ADC_CHANNEL_5 The value of is stored in data in , IOT_ADC_EQU_MODEL_8 Express 8 Sub average algorithm mode ,IOT_ADC_CUR_BAIS_DEFAULT Indicates the default automatic recognition mode , Finally through data * 1.8 * 4 / 4096.0 Calculate the actual voltage value .

Four 、I2C Bus
The interface is introduced


Check pin

Reading and writing NFC chip

5、 ... and 、UART Reading and writing
The interface is introduced

Check pin

Read and write data

边栏推荐
- One bite of Stream(6)
- Wechat stores build order pages and automatically grab tickets
- Oracle 19C datagruad replication standby rman-05535 ora-01275
- Acwing 94. recursive implementation of permutation enumeration
- 1. Mx6u-alpha development board (buzzer experiment)
- How to learn automated testing? Can you teach yourself?
- ma.glasnost.orika. MappingException:No converter registered for conversion from Date to LocalDateTime
- Press Ctrl to pop up a dialog box. How to close this dialog box?
- MySQL data recovery
- Shengbang security rushes to the scientific innovation board: Qianxin is its largest customer (55.87 million); Its three-year revenue is 460 million, net profit is 95.04 million, and R & D investment
猜你喜欢

Lua environment configuration

Near infrared dye cy7.5 labeling PNA polypeptide experimental steps cy7.5-pna|188re labeling anti gene peptide nucleic acid (agpna)

C form application treeview control use
![[training Day10] silly [simulation] [greed]](/img/31/94c32e05b498f8ad192f8ec2c500ca.png)
[training Day10] silly [simulation] [greed]
![[training Day6] game [mathematics]](/img/b2/09c752d789eead9a6b60f4b4b1d5d4.png)
[training Day6] game [mathematics]

How to set appium script startup parameters

One bite of Stream(7)

Markdown to PDF API data interface

Opencv learning Day2

ma.glasnost.orika. MappingException:No converter registered for conversion from Date to LocalDateTime
随机推荐
Selenium uploads files in more ways than you think
Application layer - typical protocol analysis
Huawei set up login with account and password
Rhodamine B labeled PNA | rhodamine b-pna | biotin modified PNA | biotin modified PNA | specification information
A simple method of converting SVG to PDF
One bite of Stream(6)
Synthesis of peptide nucleic acid PNA labeled with heptachydrin dye cy7 cy7-pna
147 set whether to cache by using the routing meta information - use of include and exclude - use of activated and deactivated
How to apply Po mode in selenium automated testing
Career development suggestions shared by ten CIOs
MySQL docker installation master-slave deployment
96. Strange tower of Hanoi
Istio一之Envoy工作原理
Failed to create a concurrent index, leaving an invalid index. How to find it
[basic data mining technology] KNN simple clustering
Five digital transformation strategies of B2B Enterprises
[training Day10] point [enumeration] [bidirectional linked list]
Sql164 next day retention rate of new users per day in November 2021
Evaluation of four operation expressions
Actual measurement of Qunhui 71000 Gigabit Network