NetBurner 3.5.0
PDF Version |
|
Functions | |
void | HardwareSetup () |
Initializes the system hardware such as the timer, cache and clock speed. | |
void | PostConfigHardwareInit () |
Initializes the system hardware that depend on config variables such as the watchdog. | |
void | ForceReboot (bool bFromException=false) |
Forces the system hardware to perform a soft reset. | |
int | HalStorage_Save (uint8_t area, void *pData, int len, int offset=0) |
Save a blob to a specific persistent storage area as defined by the platform. This routine will perform all storage maintenance routines necessary to ensure a valid write. | |
int | HalStorage_SavePartial (uint8_t area, void *pData, int len, int offset) |
Save a blob to a specific persistent storage area as defined by the platform. This routine requires that any maintenance required for a valid write be explicitly performed prior to being called. | |
int | HalStorage_Prepare (uint8_t area, int len, int offset=0) |
Prepare a storage area for writing new data. For platforms with direct flash mapping this function is an alias for HalStorage_Erase. | |
int | HalStorage_Finalize (uint8_t area) |
Finalize a storage area after writing new data. This will perform any final completion or cleanup routines required to persist the previously saved data from HalStorage_SavePartial calls. | |
int | HalStorage_Erase (uint8_t area, int len=-1, int offset=0) |
Erase all or part of a storage area. Note: due to physical storage granularities, the total area erased may extend beyond the requested area. | |
int | HalStorage_GetAllocated (uint8_t area) |
Obtain the total size allocated to the given persistent storage area. | |
int | HalStorage_GetMaxAllocation (uint8_t area) |
Obtain the maximum size that may be allocated to the given persistent storage area. For direct flash mapped platforms, this is aliased to HalStorage_GetAllocated. | |
int | HalStorage_RemainingSpace (uint8_t area) |
Obtain the number of remaining bytes available to be written in the given persistent storage area. | |
int | HalStorage_WriteOffset (uint8_t area) |
Get the offset of the next byte that can be written in the given persistent storage area. | |
int | HalStorage_AddressOffset (uint8_t area, void *pWhere) |
Get the offset within a persistent storage area of an address. A platform may map any address to any offset of its choosing for a given storage area, and my modify its behavior on an area by area basis. | |
void | FlashErase (void *pWhere, int len) |
Erases the flash memory. | |
void | FlashProgram (void *pWhere, void *pWhat, int len) |
Program flash memory. | |
void | FlashProgramAppImage (void *pWhere, void *pWhat, int len) |
Write an application image to flash memory. | |
void | DisableCache () |
Disable the instruction and data cache. | |
void | EnableCache () |
Enable the instruction and data cache. | |
uint32_t | spaceleft () |
Report how much free unallocated space is left in dynamic memory. | |
uint16_t | HalGetTickFraction (void) |
Returns the fraction of the current system time tick. | |
void | StdioCheckIntc (void) |
Check STDIO interrupt sources. | |
void | SysLogCheckIntc (void) |
This is just like the StdioCheckIntc() function, except that the results are displayed via UDP. | |
bool | HalDeviceCertValid () |
Determine if the stored certificate is valid. | |
uint8_t * | HalGetDeviceCert () |
Get a pointer to the stored certificate. | |
uint16_t | HalGetDeviceCertLen () |
Get the length of the stored certificate. | |
uint8_t * | HalGetDeviceKey () |
Get a pointer to the stored certificate. | |
uint16_t | HalGetDeviceKeyLen () |
Get the length of the stored key. | |
bool | HalSaveNewDeviceCert (const uint8_t *cert, uint16_t certlen, uint8_t format=SSL_FILETYPE_PEM) |
Save a device certificate in persistent storage. | |
bool | HalSaveNewDeviceKey (const uint8_t *key, uint16_t keylen, uint8_t format=SSL_FILETYPE_PEM) |
Save a device key in persistent storage. | |
void | HalEraseDeviceCertAndKey () |
Clear the device certificate and key from persistent storage. | |
Variables | |
void(* | watchdog_service_function )(void) |
Watchdog callback service function. | |
uint32_t | HalTickMaxCount |
Rollover value for the system hardware tick timer. | |
#include< hal.h >
The HAL provides a common function name interface to the various NetBurner hardware platforms. Other than the ForceReboot() and spaceleft() functions, these are advanced functions that should only be used by developers experienced with NetBurner hardware, firmware and memory maps.
void FlashErase | ( | void * | pWhere, |
int | len ) |
#include <hal.h>
Erases the flash memory.
pWhere | The starting location in flash memory to begin the erasure |
len | Specified the number of bytes to erase |
void FlashProgram | ( | void * | pWhere, |
void * | pWhat, | ||
int | len ) |
#include <hal.h>
Program flash memory.
pWhere | Pointer to the starting location in flash to begin programming |
pWhat | Pointer to the content that will be programmed into flash |
len | Number of bytes to program |
void FlashProgramAppImage | ( | void * | pWhere, |
void * | pWhat, | ||
int | len ) |
#include <hal.h>
Write an application image to flash memory.
On some platforms writing the application image may require calling ProgramImage even though it may only call FlashErase and FlashProgram. As a result, ProgramImage should always be used when updating the application image.
pWhere | Pointer to the starting location in flash to begin the programming |
pWhat | Pointer to the content that will be programmed into flash |
len | Number of bytes to write |
bool HalDeviceCertValid | ( | ) |
#include <hal.h>
Determine if the stored certificate is valid.
This is the only function recommended to be used to determine the validity of the stored certificate. Is is not recommended to use HalGetDeviceCert() nor HalGetDeviceCertLen() to determine validity. For safest use of the cert/key getter functions, use HalDeviceCertValid() prior.
true | if the certificate is valid false otherwise |
void HalEraseDeviceCertAndKey | ( | ) |
#include <hal.h>
Clear the device certificate and key from persistent storage.
HalEraseDeviceCertAndKey() is recommended instead of HalStorage_Erase() to clear the stored certificate and key.
uint8_t * HalGetDeviceCert | ( | ) |
#include <hal.h>
Get a pointer to the stored certificate.
It is recommended to use HalDeviceCertValid() prior to calling this function.
pointer | to the certificate storage location in memory. |
uint16_t HalGetDeviceCertLen | ( | ) |
#include <hal.h>
Get the length of the stored certificate.
It is recommended to use HalDeviceCertValid() prior to calling this function.
length | of the stored certificate. 0 or 65535 if no certificates is stored. |
uint8_t * HalGetDeviceKey | ( | ) |
#include <hal.h>
Get a pointer to the stored certificate.
It is recommended to use HalDeviceCertValid() prior to calling this function.
pointer | to the certificate storage location in memory. |
uint16_t HalGetDeviceKeyLen | ( | ) |
#include <hal.h>
Get the length of the stored key.
It is recommended to use HalDeviceCertValid() prior to calling this function.
length | of the stored key. 0 or 65535 if no key is stored. |
|
extern |
#include <hal.h>
Returns the fraction of the current system time tick.
return - The current counter value used to generate tick count
bool HalSaveNewDeviceCert | ( | const uint8_t * | cert, |
uint16_t | certlen, | ||
uint8_t | format = SSL_FILETYPE_PEM ) |
#include <hal.h>
Save a device certificate in persistent storage.
cert | Pointer to the buffer containing the certificate |
certlen | length of the certificate |
format | filetype (SSL_FILETYPE_PEM, or SSL_FILETYPE_ASN1) |
true | if the certificate was successfully stored |
false | otherwise |
bool HalSaveNewDeviceKey | ( | const uint8_t * | key, |
uint16_t | keylen, | ||
uint8_t | format = SSL_FILETYPE_PEM ) |
#include <hal.h>
Save a device key in persistent storage.
key | Pointer to the buffer containing the key |
keylen | length of the key |
format | filetype (SSL_FILETYPE_PEM, or SSL_FILETYPE_ASN1) |
true | if the key was successfully stored |
false | otherwise |
int HalStorage_AddressOffset | ( | uint8_t | area, |
void * | pWhere ) |
#include <hal.h>
Get the offset within a persistent storage area of an address. A platform may map any address to any offset of its choosing for a given storage area, and my modify its behavior on an area by area basis.
area | The storage area being queried |
pWhere | An address value to be translated |
int HalStorage_Erase | ( | uint8_t | area, |
int | len = -1, | ||
int | offset = 0 ) |
#include <hal.h>
Erase all or part of a storage area. Note: due to physical storage granularities, the total area erased may extend beyond the requested area.
area | The storage area to be erased |
len | Number of bytes to be erased (a negative length will erase the entire area) |
offset | The location within the area that the erasure should begin |
int HalStorage_Finalize | ( | uint8_t | area | ) |
#include <hal.h>
Finalize a storage area after writing new data. This will perform any final completion or cleanup routines required to persist the previously saved data from HalStorage_SavePartial calls.
area | The storage area to finalize |
int HalStorage_GetAllocated | ( | uint8_t | area | ) |
#include <hal.h>
Obtain the total size allocated to the given persistent storage area.
area | The storage area being queried |
int HalStorage_GetMaxAllocation | ( | uint8_t | area | ) |
#include <hal.h>
Obtain the maximum size that may be allocated to the given persistent storage area. For direct flash mapped platforms, this is aliased to HalStorage_GetAllocated.
area | The storage area being queried |
int HalStorage_Prepare | ( | uint8_t | area, |
int | len, | ||
int | offset = 0 ) |
#include <hal.h>
Prepare a storage area for writing new data. For platforms with direct flash mapping this function is an alias for HalStorage_Erase.
area | The storage area to be readied |
len | Number of bytes to be written by later HalStorage_SavePartial calls |
offset | The location within the area that the readying should begin |
int HalStorage_RemainingSpace | ( | uint8_t | area | ) |
#include <hal.h>
Obtain the number of remaining bytes available to be written in the given persistent storage area.
area | The storage area being queried |
int HalStorage_Save | ( | uint8_t | area, |
void * | pData, | ||
int | len, | ||
int | offset = 0 ) |
#include <hal.h>
Save a blob to a specific persistent storage area as defined by the platform. This routine will perform all storage maintenance routines necessary to ensure a valid write.
area | The storage area to be used. A platform is only required to support the areas as defined by HalStorage_t, however it may define additional areas as needed |
pData | Pointer to the data to be written |
len | Number of bytes to be written to the storage area |
offset | Where in the storage area the first byte should be written. Default is 0. |
int HalStorage_SavePartial | ( | uint8_t | area, |
void * | pData, | ||
int | len, | ||
int | offset ) |
#include <hal.h>
Save a blob to a specific persistent storage area as defined by the platform. This routine requires that any maintenance required for a valid write be explicitly performed prior to being called.
area | The storage area to be used. A platform is only required to support the areas as defined by HalStorage_t, however it may define additional areas as needed. |
pData | Pointer to the data to be written |
len | Number of bytes to be written to the storage area |
offset | Where in the storage area the first byte should be written. |
int HalStorage_WriteOffset | ( | uint8_t | area | ) |
#include <hal.h>
Get the offset of the next byte that can be written in the given persistent storage area.
area | The storage area being queried |
uint32_t spaceleft | ( | ) |
#include <hal.h>
Report how much free unallocated space is left in dynamic memory.
void StdioCheckIntc | ( | void | ) |
#include <hal.h>
Check STDIO interrupt sources.
Checks the interrupt sources used in the system along with their associated interrupt level and priority, and also checks for any conflicts in using the same level and priority between different sources. These results are sent to stdout.
void SysLogCheckIntc | ( | void | ) |
#include <hal.h>
This is just like the StdioCheckIntc() function, except that the results are displayed via UDP.
|
extern |
#include <hal.h>
Rollover value for the system hardware tick timer.
|
extern |
#include <hal.h>
Watchdog callback service function.
If the following function pointer is set to point at a function of the form:
void YourFunc( void );
Then the system will call this function throughout the AutoUpdate/TCPUpdate process to make sure that the watchdog timer is serviced.