Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

AN2799 Datasheet(PDF) 11 Page - STMicroelectronics

Part # AN2799
Description  Measuring mains power consumption
PDF  14 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN2799 Datasheet(HTML) 11 Page - STMicroelectronics

Back Button AN2799 Datasheet HTML 6Page - STMicroelectronics AN2799 Datasheet HTML 7Page - STMicroelectronics AN2799 Datasheet HTML 8Page - STMicroelectronics AN2799 Datasheet HTML 9Page - STMicroelectronics AN2799 Datasheet HTML 10Page - STMicroelectronics AN2799 Datasheet HTML 11Page - STMicroelectronics AN2799 Datasheet HTML 12Page - STMicroelectronics AN2799 Datasheet HTML 13Page - STMicroelectronics AN2799 Datasheet HTML 14Page - STMicroelectronics  
Zoom Inzoom in Zoom Outzoom out
 11 / 14 page
background image
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.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14


Datasheet Download

Go To PDF Page


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


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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