Pigweed
 
Loading...
Searching...
No Matches
pint.h
1// Copyright 2023 The Pigweed Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License"); you may not
4// use this file except in compliance with the License. You may obtain a copy of
5// the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12// License for the specific language governing permissions and limitations under
13// the License.
14#pragma once
15
16#include "fsl_pint.h"
17#include "pw_digital_io/digital_io.h"
18#include "pw_status/status.h"
19#include "pw_sync/borrow.h"
20
21namespace pw::digital_io {
22
28 public:
32 McuxpressoPintController(PINT_Type* base);
34
36 McuxpressoPintController& operator=(const McuxpressoPintController&) = delete;
37
38 private:
39 friend class McuxpressoPintInterrupt;
40
41 pw::Status Config(pint_pin_int_t pin,
42 pw::digital_io::InterruptTrigger trigger,
43 pw::digital_io::InterruptHandler&& handler);
44 pw::Status EnableHandler(pint_pin_int_t pin, bool enable);
45
46 PINT_Type* base_;
47};
48
60 public:
70 pint_pin_int_t pin);
71
73 McuxpressoPintInterrupt& operator=(const McuxpressoPintInterrupt&) = delete;
74
75 private:
76 // pw::digital_io::DigitalInterrupt implementation
77 pw::Status DoEnable(bool enable) override;
79 pw::digital_io::InterruptTrigger trigger,
80 pw::digital_io::InterruptHandler&& handler) override;
81 pw::Status DoEnableInterruptHandler(bool enable) override;
82
84 pint_pin_int_t pin_;
85};
86
87} // namespace pw::digital_io
Definition: status.h:85
Definition: digital_io.h:476
pw::Status DoEnable(bool enable) override
pw::Status DoSetInterruptHandler(pw::digital_io::InterruptTrigger trigger, pw::digital_io::InterruptHandler &&handler) override
pw::Status DoEnableInterruptHandler(bool enable) override
McuxpressoPintInterrupt(pw::sync::Borrowable< McuxpressoPintController > &controller, pint_pin_int_t pin)
Definition: borrow.h:164