sarmfsw: SMFSW Toolbox (desinged for ARM / compatible with other 8b/16b/32b platforms) 4.0rc
SMFSW collection of miscellaneous functions \& macros (desinged for ARM / compatible with other 8b/16b/32b platforms)
Loading...
Searching...
No Matches
arm_chip_pic.h File Reference

Common macros for PIC. More...

#include "xc.h"
Include dependency graph for arm_chip_pic.h:

Macros

#define diInterrupts()
 Disable interruptions macro.
 
#define enInterrupts()
 Enable interruptions macro.
 
#define HAL_MAX_TICKS   ((uint32_t) -1)
 Max Ticks value.
 
#define HAL_MS_TICKS_FACTOR   1U
 Milliseconds multiplier (depending tick counter frequency)
 

Enumerations

enum  eResetSource { RST_POR = 1U , RST_UNKNOWN = 0xFFU }
 Source of last reset. More...
 

Detailed Description

Common macros for PIC.

Author
SMFSW
MISRA C:2012 Deviations
Header scope legitimate use derogation authorized for:
Rule-5.6 - Required: unique typedef name (misra-c2012-5.6)
Rule-5.9 - Advisory: internal linkage unique function name (misra-c2012-5.9)
Justification: typedefs name are only defined once (other arm_chip_xxx files are not included at the same time).
Attention
On PIC families you should configure a timer to count for ms. A TIM peripheral shall be configured in MCC or Harmony (with a period of 1ms).

HAL_GetTick shall be known to sarmfsw. As no specific project header is included yet in this file, external definition is provided.

#include <stdint.h>
uint32_t HAL_GetTick(void);
MISRA C:2012 Deviations
Header scope deviation has been granted for following rules:
Rule-20.5 - Advisory: #undef (misra-c2012-20.5)

Macro Definition Documentation

◆ diInterrupts

#define diInterrupts ( )
Value:
__builtin_disable_interrupts()

Disable interruptions macro.

◆ enInterrupts

#define enInterrupts ( )
Value:
__builtin_enable_interrupts()

Enable interruptions macro.

◆ HAL_MAX_TICKS

#define HAL_MAX_TICKS   ((uint32_t) -1)

Max Ticks value.

Note
Define HAL_MAX_TICKS with custom max value in project if tick max value is not using 32b variable full scale

◆ HAL_MS_TICKS_FACTOR

#define HAL_MS_TICKS_FACTOR   1U

Milliseconds multiplier (depending tick counter frequency)

Note
Define HAL_MS_TICKS_FACTOR with custom multiplier in project if tick period is not 1ms

Enumeration Type Documentation

◆ eResetSource

Source of last reset.

Enumerator
RST_POR 

Power On Reset.

RST_UNKNOWN 

Unknown Reset Source.