C/C++ API Reference
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
24
30 public:
34 McuxpressoPintController(PINT_Type* base);
36
38 McuxpressoPintController& operator=(const McuxpressoPintController&) = delete;
39
40 private:
41 friend class McuxpressoPintInterrupt;
42
43 pw::Status Config(pint_pin_int_t pin,
44 pw::digital_io::InterruptTrigger trigger,
45 pw::digital_io::InterruptHandler&& handler);
46 pw::Status EnableHandler(pint_pin_int_t pin, bool enable);
47
48 PINT_Type* base_;
49};
50
62 public:
72 pint_pin_int_t pin);
73
75 McuxpressoPintInterrupt& operator=(const McuxpressoPintInterrupt&) = delete;
76
77 private:
78 // pw::digital_io::DigitalInterrupt implementation
79 pw::Status DoEnable(bool enable) override;
81 pw::digital_io::InterruptTrigger trigger,
82 pw::digital_io::InterruptHandler&& handler) override;
83 pw::Status DoEnableInterruptHandler(bool enable) override;
84
86 pint_pin_int_t pin_;
87};
88
89} // namespace pw::digital_io
Definition: status.h:86
Definition: digital_io.h:479
Definition: borrow.h:164
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)
GPIO library.
Definition: digital_io.h:24