|
CANTram Framework 1.0.1
Dieses Framework ermöglicht die Nutzung der CANTram Hardware, einer Mikrocontroller basierten mdoularen Steuerung.
|


Public Member Functions | |
| virtual void | begin () |
| Initialize PWM core resources. | |
| virtual bool | addChannel (OutputDefinition *def)=0 |
| Add/allocate a PWM channel for the given output definition. | |
| virtual void | setDuty (OutputDefinition *def, uint16_t duty)=0 |
| Set PWM duty cycle for a registered output. | |
| HardwareResource::Type | getType () override |
| Get the hardware resource type. | |
| Public Member Functions inherited from HardwareResource | |
| virtual bool | reset () |
| Reset the hardware resource to a known default state. | |
| bool | requestUsage () |
| Request a usage slot for this resource. | |
| uint8_t | getUsages () |
| Get the current number of usages of this resource. | |
| bool | isUsed () |
| Check if the resource is currently used. | |
| virtual uint8_t | getRemainingUsages () |
| Get remaining usage capacity for this resource. | |
Protected Member Functions | |
| PWMCore ()=default | |
| Protected default constructor. | |
| virtual uint8_t | getMaxUsages () override |
| Get the maximum simultaneous usages allowed for this resource. | |
| Protected Member Functions inherited from HardwareResource | |
| HardwareResource ()=default | |
| Default constructor. | |
Protected Attributes | |
| bool | _initialized =false |
| Internal initialized flag. | |
| Protected Attributes inherited from HardwareResource | |
| uint8_t | usages =0 |
| Current usage counter. | |
Additional Inherited Members | |
| Public Types inherited from HardwareResource | |
| enum | Type { UART , SPI , I2C , PWM , CAN } |
| Enumeration of hardware resource types. More... | |
|
protecteddefault |
Protected default constructor.
Prevent direct instantiation of the base class. Derived implementations should call this constructor from their constructors.
|
pure virtual |
Add/allocate a PWM channel for the given output definition.
Reserve any internal timer/channel resources required to drive PWM on the provided OutputDefinition. The implementation should validate that the OutputDefinition supports PWM and return true on success.
| def | Pointer to the OutputDefinition to register for PWM. |
Implemented in ESP32PWMCore.
|
virtual |
Initialize PWM core resources.
Perform any platform-specific initialization required before PWM channels can be allocated or used. Implementations should set internal initialized state and configure timers/hardware as needed.
Reimplemented in ESP32PWMCore.
|
inlineoverrideprotectedvirtual |
Get the maximum simultaneous usages allowed for this resource.
PWMCore limits concurrent users by default to a single module (the main module). Override in derived classes only if multiple simultaneous users are supported.
Reimplemented from HardwareResource.
Reimplemented in ESP32PWMCore.
|
inlineoverridevirtual |
Get the hardware resource type.
Overrides HardwareResource::getType() to identify this resource as a PWM type.
Implements HardwareResource.
|
pure virtual |
Set PWM duty cycle for a registered output.
Drive the output described by def with the specified duty value. Duty units are implementation-specific but are expected to be in the range 0..4095 for 12-bit resolution.
| def | Pointer to the OutputDefinition to set PWM on. |
| duty | Duty value to apply (e.g., 0..4095 for 12-bit resolution). |
Implemented in ESP32PWMCore.
|
protected |
Internal initialized flag.
Indicates whether begin() has been called and hardware is ready for PWM operations.