IoT Drivers  v3.3.0 (S2022)
Engineering in Software Technology
Functions to create and initialize the driver.

How to create the driver. More...

Collaboration diagram for Functions to create and initialize the driver.:

Functions

hcsr501_p hcsr501_create (volatile uint8_t *port, uint8_t portPin)
 Create the HC-SR501 driver. More...
 
void hcsr501_destroy (hcsr501_p instance)
 Destroy the HC-SR501 driver. More...
 

Detailed Description

How to create the driver.

Function Documentation

◆ hcsr501_create()

hcsr501_p hcsr501_create ( volatile uint8_t *  port,
uint8_t  portPin 
)

Create the HC-SR501 driver.

Creates and initialize the driver.

Note
The driver must be destroyed when it is not needed anymore hcsr501_destroy.
Parameters
[in]*portpointer to the PORT the PIR sensor is connected to (e.g. &PORTA).
[in]portPinin the PORT the PIR sensor is connected to (e.g. PA3).
Returns
instance pointer

◆ hcsr501_destroy()

void hcsr501_destroy ( hcsr501_p  instance)

Destroy the HC-SR501 driver.

Destroys the driver after use. The HEAP memory used for the driver will be freed again.

Note
The driver should only be destroyed when it is not needed anymore.
Parameters
[in]instancedriver instance to be destroyed hcsr501_create.