| Electronic Components Datasheet Search |
|
AN2799 Datasheet(PDF) 11 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2799 Datasheet(HTML) 11 Page - STMicroelectronics |
|
11 / 14 page ![]() AN2799 Firmware description 11/14 4.1.4 Deletion The power meter object is deleted by the DeletePowerMeterObj function implemented externally by the object itself. This function first calls the deletion method to free dynamically allocated variables during object creation (in this case does nothing) then frees the allocated memory for the power meter object. 4.2 Hardware abstraction layer The HAL is implemented using the following files: ● PowerMeterHal.c ● PowerMeterHal.h ● PowerMeterHalTypes.h This module is useful to abstract the power meter object implementation from the STM32 standard library. 4.2.1 HAL functions The hardware abstraction layer functions are described as follows: ● PM_ConfigSignal: this function configures a pin according to the passed signal descriptor and configuration type. ● PM_ReceiveRegOnSpi: this function receives the STPM01 internal register from the SPI interface. ● PM_OnSpiRxIrq: This function implements the interrupt service routine of the SPI interface. It is called when the FIFO of the SPI peripherals contains 1 byte or more and assigns the received value to a shared register variable. ● SendClkToGetData: this function is used to provide the SPI clock to the STPM01 to receive data. ● ConfigPin: pin configuration function. 4.3 Application interface The application interface is implemented using the following files: ● Meter.c ● MeterHal.c ● MeterLayer.h This layer is useful to abstract the application from the specific board used. In fact, the functions implemented in the described modules allow the hardware configuration of the specific board used. The firmware described in this document has been validated using the “SmartPlug” board that includes two STPM01 meters enumerated as PM_METER_TYPE_CONSUMPTION and PM_METER_TYPE_DISPERSION. |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |