Version Core8-16F #
Documentation for core16F.h
The core16F.h
file provides core framework functionalities for Microchip PIC16F processors. It contains various system configurations, HAL (Hardware Abstraction Layer) enables, and function declarations related to initialization and system control.
Core16F System Configuration
Processor Device Definitions #
These macros define the specific PIC16F processor in use:
_CORE16F_SYSTEM_DEVICE_16F15313
: Defined for PIC16F15313 processors._CORE16F_SYSTEM_DEVICE_16F1532X
: Defined for PIC16F1532x processors (e.g., PIC16F15323, PIC16F15324, PIC16F15325).
System Configuration Options #
Various system configurations can be enabled or disabled by defining macros:
- System Timer Enable:
_CORE16F_SYSTEM_TIMER_ENABLE
- Include System Delays:
_CORE16F_SYSTEM_INCLUDE_DELAYS_ENABLE
- GPIO Configuration Enable:
_CORE16F_HAL_GPIO_CONFIG_ENABLE
- Timer1 Enable:
_CORE16F_HAL_TMR1_ENABLE
- Timer2 Enable:
_CORE16F_HAL_TMR2_ENABLE
- GPIO Analog Functions Enable:
_CORE16F_HAL_GPIO_ANALOG_ENABLE
- Serial Communication Enable:
_CORE16F_HAL_SERIAL1_ENABLE
- PWM Channels (PWM3, PWM4, PWM5, PWM6) Enable:
_CORE16F_HAL_PWM3_ENABLE
,_CORE16F_HAL_PWM4_ENABLE
,_CORE16F_HAL_PWM5_ENABLE
,_CORE16F_HAL_PWM6_ENABLE
- I2C Enable:
_CORE16F_HAL_I2C_ENABLE
- One Wire Functions Enable:
_CORE16F_HAL_ONE_WIRE_ENABLE
Core System Interface #
The CORE16F_System_Interface_t
structure defines the core system interface with the following members:
Initialize
: A function pointer for initializing the core system.Delay_MS
: A function pointer for delaying execution by a specified number of milliseconds (enabled when_CORE16F_SYSTEM_INCLUDE_DELAYS_ENABLE
is defined).
External Interfaces #
extern const CORE16F_System_Interface_t CORE
: A constant instance of theCORE16F_System_Interface_t
structure, which provides access to the system initialization and delay functions (if enabled).
CORE Members #
Initialize
- Type:
void (*Initialize)(void)
- escription: A function pointer to the
CORE16F_init()
function. This function is responsible for initializing the Core8 system, including the system timer if enabled. - Usage:
CORE.Initialize(); // Initializes the Core8 system.
- Type:
Delay_MS
(optional, dependent on configuration)- Type:
void (*Delay_MS)(uint32_t timeMS)
- Description: A function pointer for introducing a delay in milliseconds. This member is included if the macro
_CORE16F_SYSTEM_INCLUDE_DELAYS_ENABLE
is defined. - Usage:
CORE.Delay_MS(1000); // Introduces a delay of 1000 ms (1 second).
- Type:
Usage Example #
The CORE
instance is used to interact with the core system functionalities. To initialize the system, call the Initialize
function through the CORE
instance:
int main(void) {
// Initialize the Core8 system
CORE.Initialize();
// Other application code...
return 0;
}
If delays are enabled in the system configuration, you can use the Delay_MS
function to introduce time delays as shown:
CORE.Delay_MS(500); // Introduces a delay of 500 ms (half a second)
Summary of CORE
Instance #
- Purpose: The
CORE
instance simplifies access to core system initialization and optional delay functionality. - Key Member:
Initialize()
: Initializes the Core8 system and any enabled features (e.g., system timer).Delay_MS()
: (optional) Introduces a delay in milliseconds if enabled by system configuration.
This interface ensures a centralized and consistent approach to initialize the Core8 framework and manage time delays, enhancing modularity and maintainability of the system.