Home
last modified time | relevance | path

Searched refs:chan (Results 1 – 25 of 530) sorted by relevance

12345678910>>...22

/Zephyr-latest/tests/subsys/zbus/publish_stats/src/
Dmain.c14 ZBUS_CHAN_DEFINE(chan, struct msg, NULL, NULL, ZBUS_OBSERVERS_EMPTY, ZBUS_MSG_INIT(0));
23 zassert_equal(0, zbus_chan_pub_stats_count(&chan)); in ZTEST()
24 zassert_equal(0, zbus_chan_pub_stats_last_time(&chan)); in ZTEST()
25 zassert_equal(0, zbus_chan_pub_stats_avg_period(&chan)); in ZTEST()
29 zassert_equal(0, zbus_chan_pub_stats_count(&chan)); in ZTEST()
30 zassert_equal(0, zbus_chan_pub_stats_last_time(&chan)); in ZTEST()
31 zassert_equal(0, zbus_chan_pub_stats_avg_period(&chan)); in ZTEST()
34 zassert_equal(0, zbus_chan_pub(&chan, &val, K_NO_WAIT)); in ZTEST()
35 zassert_equal(1, zbus_chan_pub_stats_count(&chan)); in ZTEST()
36 zassert_within(k_uptime_ticks(), zbus_chan_pub_stats_last_time(&chan), clock_window); in ZTEST()
[all …]
/Zephyr-latest/drivers/timer/
Dnrf_rtc_timer.c73 static void set_comparator(int32_t chan, uint32_t cyc) in set_comparator() argument
75 nrfy_rtc_cc_set(RTC, chan, cyc & COUNTER_MAX); in set_comparator()
78 static bool event_check(int32_t chan) in event_check() argument
80 return nrfy_rtc_event_check(RTC, NRF_RTC_CHANNEL_EVENT_ADDR(chan)); in event_check()
83 static void event_clear(int32_t chan) in event_clear() argument
85 nrfy_rtc_event_clear(RTC, NRF_RTC_CHANNEL_EVENT_ADDR(chan)); in event_clear()
88 static void event_enable(int32_t chan) in event_enable() argument
90 nrfy_rtc_event_enable(RTC, NRF_RTC_CHANNEL_INT_MASK(chan)); in event_enable()
93 static void event_disable(int32_t chan) in event_disable() argument
95 nrfy_rtc_event_disable(RTC, NRF_RTC_CHANNEL_INT_MASK(chan)); in event_disable()
[all …]
Dnrf_grtc_timer.c70 #define IS_CHANNEL_ALLOWED_ASSERT(chan) \ argument
71 __ASSERT_NO_MSG((NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK & (1UL << (chan))) && \
72 ((chan) != system_clock_channel_data.channel))
86 static inline int get_comparator(uint32_t chan, uint64_t *cc) in get_comparator() argument
90 result = nrfx_grtc_syscounter_cc_value_read(chan, cc); in get_comparator()
123 static bool compare_int_lock(int32_t chan) in compare_int_lock() argument
125 atomic_val_t prev = atomic_and(&int_mask, ~BIT(chan)); in compare_int_lock()
127 nrfx_grtc_syscounter_cc_int_disable(chan); in compare_int_lock()
129 return prev & BIT(chan); in compare_int_lock()
132 static void compare_int_unlock(int32_t chan, bool key) in compare_int_unlock() argument
[all …]
/Zephyr-latest/subsys/bluetooth/host/
Dl2cap.c90 struct bt_l2cap_le_chan chan; member
116 struct bt_l2cap_chan *chan) in l2cap_chan_alloc_cid() argument
118 struct bt_l2cap_le_chan *le_chan = BT_L2CAP_LE_CHAN(chan); in l2cap_chan_alloc_cid()
142 struct bt_l2cap_chan *chan; in __l2cap_lookup_ident() local
145 SYS_SLIST_FOR_EACH_CONTAINER(&conn->channels, chan, node) { in __l2cap_lookup_ident()
146 if (BT_L2CAP_LE_CHAN(chan)->ident == ident) { in __l2cap_lookup_ident()
149 &chan->node); in __l2cap_lookup_ident()
151 return BT_L2CAP_LE_CHAN(chan); in __l2cap_lookup_ident()
154 prev = &chan->node; in __l2cap_lookup_ident()
163 struct bt_l2cap_chan *chan; in bt_l2cap_chan_remove() local
[all …]
Datt.c36 #define ATT_CHAN(_ch) CONTAINER_OF(_ch, struct bt_att_chan, chan.chan)
105 struct bt_l2cap_le_chan chan; member
113 static bool bt_att_is_enhanced(struct bt_att_chan *chan) in bt_att_is_enhanced() argument
120 return atomic_test_bit(chan->flags, ATT_ENHANCED); in bt_att_is_enhanced()
123 static uint16_t bt_att_mtu(struct bt_att_chan *chan) in bt_att_mtu() argument
130 return MIN(chan->chan.rx.mtu, chan->chan.tx.mtu); in bt_att_mtu()
289 static int bt_att_chan_send(struct bt_att_chan *chan, struct net_buf *buf);
292 static void bt_att_disconnected(struct bt_l2cap_chan *chan);
294 struct net_buf *bt_att_create_rsp_pdu(struct bt_att_chan *chan, uint8_t op);
303 struct bt_l2cap_chan *chan = &att_chan->chan.chan; in att_sent() local
[all …]
/Zephyr-latest/subsys/bluetooth/host/classic/
Dl2cap_br.c87 struct bt_l2cap_br_chan chan; member
105 struct bt_l2cap_chan *chan; in bt_l2cap_br_lookup_rx_cid() local
107 SYS_SLIST_FOR_EACH_CONTAINER(&conn->channels, chan, node) { in bt_l2cap_br_lookup_rx_cid()
108 if (BR_CHAN(chan)->rx.cid == cid) { in bt_l2cap_br_lookup_rx_cid()
109 return chan; in bt_l2cap_br_lookup_rx_cid()
119 struct bt_l2cap_chan *chan; in bt_l2cap_br_lookup_tx_cid() local
121 SYS_SLIST_FOR_EACH_CONTAINER(&conn->channels, chan, node) { in bt_l2cap_br_lookup_tx_cid()
122 if (BR_CHAN(chan)->tx.cid == cid) { in bt_l2cap_br_lookup_tx_cid()
123 return chan; in bt_l2cap_br_lookup_tx_cid()
140 br_chan_sig = CONTAINER_OF(chan_sig, struct bt_l2cap_br, chan.chan); in bt_l2cap_br_get_remote_fixed_chan()
[all …]
Dsco.c34 #define SCO_CHAN(_sco) ((_sco)->sco.chan);
80 struct bt_sco_chan *chan; in bt_sco_connected() local
89 chan = SCO_CHAN(sco); in bt_sco_connected()
91 if (chan == NULL) { in bt_sco_connected()
96 bt_sco_chan_set_state(chan, BT_SCO_STATE_CONNECTED); in bt_sco_connected()
98 if (chan->ops && chan->ops->connected) { in bt_sco_connected()
99 chan->ops->connected(chan); in bt_sco_connected()
105 struct bt_sco_chan *chan; in bt_sco_disconnected() local
113 chan = SCO_CHAN(sco); in bt_sco_disconnected()
114 if (chan == NULL) { in bt_sco_disconnected()
[all …]
/Zephyr-latest/subsys/zbus/
Dzbus.c62 curr = observation->chan; in _zbus_init()
79 STRUCT_SECTION_FOREACH(zbus_channel, chan) { in _zbus_init()
81 if (chan->id == ZBUS_CHAN_ID_INVALID) { in _zbus_init()
86 if (chan_prev == chan) { in _zbus_init()
89 if (chan->id == chan_prev->id) { in _zbus_init()
91 LOG_WRN("Channels %s and %s have matching IDs (%d)", chan->name, in _zbus_init()
92 chan_prev->name, chan->id); in _zbus_init()
94 LOG_WRN("Channels %p and %p have matching IDs (%d)", chan, in _zbus_init()
95 chan_prev, chan->id); in _zbus_init()
113 STRUCT_SECTION_FOREACH(zbus_channel, chan) { in zbus_chan_from_id()
[all …]
Dzbus_runtime_observers.c11 int zbus_chan_add_obs(const struct zbus_channel *chan, const struct zbus_observer *obs, in zbus_chan_add_obs() argument
19 _ZBUS_ASSERT(chan != NULL, "chan is required"); in zbus_chan_add_obs()
22 err = k_sem_take(&chan->data->sem, timeout); in zbus_chan_add_obs()
27 for (int16_t i = chan->data->observers_start_idx, limit = chan->data->observers_end_idx; in zbus_chan_add_obs()
34 k_sem_give(&chan->data->sem); in zbus_chan_add_obs()
41 SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&chan->data->observers, obs_nd, tmp, node) { in zbus_chan_add_obs()
43 k_sem_give(&chan->data->sem); in zbus_chan_add_obs()
54 k_sem_give(&chan->data->sem); in zbus_chan_add_obs()
61 sys_slist_append(&chan->data->observers, &new_obs_nd->node); in zbus_chan_add_obs()
63 k_sem_give(&chan->data->sem); in zbus_chan_add_obs()
[all …]
/Zephyr-latest/drivers/dma/
Ddma_nxp_edma.c25 struct edma_channel *chan; in edma_isr() local
29 chan = (struct edma_channel *)parameter; in edma_isr()
30 cfg = chan->dev->config; in edma_isr()
31 data = chan->dev->data; in edma_isr()
33 if (chan->state == CHAN_STATE_RELEASING || chan->state == CHAN_STATE_INIT) { in edma_isr()
38 if (!EDMA_ChannelRegRead(data->hal_cfg, chan->id, EDMA_TCD_CH_INT)) { in edma_isr()
44 EDMA_ChannelRegUpdate(data->hal_cfg, chan->id, in edma_isr()
47 if (chan->cyclic_buffer) { in edma_isr()
48 update_size = chan->bsize; in edma_isr()
51 update_size = chan->bsize / 2; in edma_isr()
[all …]
Ddma_nxp_edma.h162 #define EDMA_CHAN_PRODUCE_CONSUME_A(chan, size)\ argument
163 ((chan)->type == CHAN_TYPE_CONSUMER ?\
164 edma_chan_cyclic_consume(chan, size) :\
165 edma_chan_cyclic_produce(chan, size))
167 #define EDMA_CHAN_PRODUCE_CONSUME_B(chan, size)\ argument
168 ((chan)->type == CHAN_TYPE_CONSUMER ?\
169 edma_chan_cyclic_produce(chan, size) :\
170 edma_chan_cyclic_consume(chan, size))
172 #define EDMA_CHAN_IS_ACTIVE(data, chan)\ argument
173 (EDMA_ChannelRegRead((data)->hal_cfg, (chan)->id, EDMA_TCD_CH_CSR) &\
[all …]
Ddma_dw_common.h26 #define DW_CHAN_OFFSET(chan) (DW_CH_SIZE * chan) argument
30 #define DW_SAR(chan) \ argument
31 (0x0000 + DW_CHAN_OFFSET(chan))
32 #define DW_DAR(chan) \ argument
33 (0x0008 + DW_CHAN_OFFSET(chan))
34 #define DW_LLP(chan) \ argument
35 (0x0010 + DW_CHAN_OFFSET(chan))
36 #define DW_CTRL_LOW(chan) \ argument
37 (0x0018 + DW_CHAN_OFFSET(chan))
38 #define DW_CTRL_HIGH(chan) \ argument
[all …]
/Zephyr-latest/tests/bluetooth/audio/mocks/src/
Diso.c24 int bt_iso_chan_send(struct bt_iso_chan *chan, struct net_buf *buf, uint16_t seq_num) in bt_iso_chan_send() argument
26 if (chan->ops != NULL && chan->ops->sent != NULL) { in bt_iso_chan_send()
27 chan->ops->sent(chan); in bt_iso_chan_send()
33 int bt_iso_chan_send_ts(struct bt_iso_chan *chan, struct net_buf *buf, uint16_t seq_num, in bt_iso_chan_send_ts() argument
36 if (chan->ops != NULL && chan->ops->sent != NULL) { in bt_iso_chan_send_ts()
37 chan->ops->sent(chan); in bt_iso_chan_send_ts()
64 int bt_iso_chan_disconnect(struct bt_iso_chan *chan) in bt_iso_chan_disconnect() argument
66 return mock_bt_iso_disconnected(chan, BT_HCI_ERR_REMOTE_USER_TERM_CONN); in bt_iso_chan_disconnect()
81 struct bt_iso_chan *chan = iso->chan; in mock_bt_iso_connected() local
83 chan->state = BT_ISO_STATE_CONNECTED; in mock_bt_iso_connected()
[all …]
/Zephyr-latest/samples/subsys/zbus/remote_mock/src/
Dmock_proxy.c41 static uint8_t encoder(const struct zbus_channel *chan) in encoder() argument
43 if (chan == &sensor_data_chan) { in encoder()
45 } else if (chan == &start_measurement_chan) { in encoder()
61 static void proxy_callback(const struct zbus_channel *chan) in proxy_callback() argument
63 bool *generated_by_the_bridge = zbus_chan_user_data(chan); in proxy_callback()
66 LOG_DBG("discard loopback event (channel %s)", zbus_chan_name(chan)); in proxy_callback()
72 uart_poll_out(uart_dev, encoder(chan)); in proxy_callback()
74 for (int i = 0; i < zbus_chan_msg_size(chan); ++i) { in proxy_callback()
75 uart_poll_out(uart_dev, ((unsigned char *)zbus_chan_const_msg(chan))[i]); in proxy_callback()
80 LOG_DBG("sending message to host (channel %s)", zbus_chan_name(chan)); in proxy_callback()
[all …]
/Zephyr-latest/tests/bluetooth/tester/src/
Dbtp_l2cap.c57 CONTAINER_OF(l2cap_chan, struct bt_l2cap_le_chan, chan); in seg_recv_cb()
58 struct channel *chan = CONTAINER_OF(l2cap_le_chan, struct channel, le); in seg_recv_cb() local
60 ev = (void *)chan->recv_cb_buf; in seg_recv_cb()
65 ev->chan_id = chan->chan_id; in seg_recv_cb()
68 tester_event(BTP_SERVICE_ID_L2CAP, BTP_L2CAP_EV_DATA_RECEIVED, chan->recv_cb_buf, in seg_recv_cb()
72 if (chan->hold_credit) { in seg_recv_cb()
73 chan->pending_credits++; in seg_recv_cb()
79 static struct net_buf *alloc_buf_cb(struct bt_l2cap_chan *chan) in alloc_buf_cb() argument
90 l2cap_chan, struct bt_l2cap_le_chan, chan); in recv_cb()
91 struct channel *chan = CONTAINER_OF(l2cap_le_chan, struct channel, le); in recv_cb() local
[all …]
/Zephyr-latest/samples/subsys/zbus/work_queue/src/
Dmain.c38 static void fh1_cb(const struct zbus_channel *chan) in fh1_cb() argument
40 const struct sensor_msg *msg = zbus_chan_const_msg(chan); in fh1_cb()
48 static void fh2_cb(const struct zbus_channel *chan) in fh2_cb() argument
50 const struct sensor_msg *msg = zbus_chan_const_msg(chan); in fh2_cb()
58 static void fh3_cb(const struct zbus_channel *chan) in fh3_cb() argument
60 const struct sensor_msg *msg = zbus_chan_const_msg(chan); in fh3_cb()
70 const struct zbus_channel *chan; member
83 zbus_chan_read(sens->chan, &msg, K_MSEC(200)); in wq_dh_cb()
90 static void dh1_cb(const struct zbus_channel *chan) in dh1_cb() argument
92 wq_handler1.chan = chan; in dh1_cb()
[all …]
/Zephyr-latest/subsys/bluetooth/services/ots/
Dots_l2cap.c63 ret = bt_l2cap_chan_send(&l2cap_ctx->ot_chan.chan, buf); in ots_l2cap_send()
80 static struct net_buf *l2cap_alloc_buf(struct bt_l2cap_chan *chan) in l2cap_alloc_buf() argument
82 LOG_DBG("Channel %p allocating buffer", chan); in l2cap_alloc_buf()
89 static void l2cap_sent(struct bt_l2cap_chan *chan) in l2cap_sent() argument
91 struct bt_l2cap_le_chan *l2chan = CONTAINER_OF(chan, struct bt_l2cap_le_chan, chan); in l2cap_sent()
94 LOG_DBG("Outgoing data channel %p transmitted", chan); in l2cap_sent()
111 l2cap_ctx->tx_done(l2cap_ctx, chan->conn); in l2cap_sent()
115 static int l2cap_recv(struct bt_l2cap_chan *chan, struct net_buf *buf) in l2cap_recv() argument
117 struct bt_l2cap_le_chan *l2chan = CONTAINER_OF(chan, struct bt_l2cap_le_chan, chan); in l2cap_recv()
120 LOG_DBG("Incoming data channel %p received", chan); in l2cap_recv()
[all …]
/Zephyr-latest/include/zephyr/drivers/timer/
Dnrf_grtc_timer.h43 void z_nrf_grtc_timer_chan_free(int32_t chan);
58 bool z_nrf_grtc_timer_compare_evt_check(int32_t chan);
68 uint32_t z_nrf_grtc_timer_compare_evt_address_get(int32_t chan);
78 uint32_t z_nrf_grtc_timer_capture_task_address_get(int32_t chan);
88 bool z_nrf_grtc_timer_compare_int_lock(int32_t chan);
98 void z_nrf_grtc_timer_compare_int_unlock(int32_t chan, bool key);
110 int z_nrf_grtc_timer_compare_read(int32_t chan, uint64_t *val);
125 int z_nrf_grtc_timer_set(int32_t chan, uint64_t target_time,
138 void z_nrf_grtc_timer_abort(int32_t chan);
162 int z_nrf_grtc_timer_capture_prepare(int32_t chan);
[all …]
Dnrf_rtc_timer.h50 void z_nrf_rtc_timer_chan_free(int32_t chan);
66 uint32_t z_nrf_rtc_timer_compare_evt_address_get(int32_t chan);
78 uint32_t z_nrf_rtc_timer_capture_task_address_get(int32_t chan);
88 bool z_nrf_rtc_timer_compare_int_lock(int32_t chan);
98 void z_nrf_rtc_timer_compare_int_unlock(int32_t chan, bool key);
106 uint32_t z_nrf_rtc_timer_compare_read(int32_t chan);
133 int z_nrf_rtc_timer_set(int32_t chan, uint64_t target_time,
162 int z_nrf_rtc_timer_exact_set(int32_t chan, uint64_t target_time,
176 void z_nrf_rtc_timer_abort(int32_t chan);
/Zephyr-latest/tests/drivers/timer/nrf_rtc_timer/src/
Dmain.c89 static void test_timeout(int32_t chan, k_timeout_t t, bool ext_window) in test_timeout() argument
99 z_nrf_rtc_timer_set(chan, (uint64_t)ticks, timeout_handler, &test_data); in test_timeout()
111 int32_t chan = z_nrf_rtc_timer_chan_alloc(); in ZTEST() local
113 zassert_true(chan >= 0, "Failed to allocate RTC channel (%d).", chan); in ZTEST()
118 test_timeout(chan, t0, false); in ZTEST()
122 test_timeout(chan, t1, false); in ZTEST()
127 test_timeout(chan, t2, false); in ZTEST()
133 test_timeout(chan, t3, true); in ZTEST()
135 z_nrf_rtc_timer_chan_free(chan); in ZTEST()
158 int32_t chan; in ZTEST() local
[all …]
/Zephyr-latest/samples/subsys/zbus/uart_bridge/src/
Dbridge.c33 const struct zbus_channel *chan; in bridge_tx_thread() local
36 if (!zbus_sub_wait(&bridge_sub, &chan, K_FOREVER)) { in bridge_tx_thread()
37 if (!zbus_chan_claim(chan, K_MSEC(500))) { in bridge_tx_thread()
38 bool *user_data = (bool *)zbus_chan_user_data(chan); in bridge_tx_thread()
42 zbus_chan_finish(chan); in bridge_tx_thread()
48 LOG_DBG("Bridge send %s", zbus_chan_name(chan)); in bridge_tx_thread()
52 for (int i = 0; i < strlen(zbus_chan_name(chan)); ++i) { in bridge_tx_thread()
53 uart_poll_out(bridge_uart, zbus_chan_name(chan)[i]); in bridge_tx_thread()
58 uart_poll_out(bridge_uart, zbus_chan_msg_size(chan)); in bridge_tx_thread()
60 for (int i = 0; i < zbus_chan_msg_size(chan); ++i) { in bridge_tx_thread()
[all …]
/Zephyr-latest/samples/bluetooth/iso_broadcast/src/
Dmain.c32 static void iso_connected(struct bt_iso_chan *chan) in iso_connected() argument
34 printk("ISO Channel %p connected\n", chan); in iso_connected()
41 static void iso_disconnected(struct bt_iso_chan *chan, uint8_t reason) in iso_disconnected() argument
44 chan, reason); in iso_disconnected()
48 static void iso_sent(struct bt_iso_chan *chan) in iso_sent() argument
168 for (uint8_t chan = 0U; chan < BIS_ISO_CHAN_COUNT; chan++) { in main() local
169 printk("Waiting for BIG complete chan %u...\n", chan); in main()
175 printk("BIG create complete chan %u.\n", chan); in main()
179 for (uint8_t chan = 0U; chan < BIS_ISO_CHAN_COUNT; chan++) { in main() local
186 " %u\n", chan); in main()
[all …]
/Zephyr-latest/include/zephyr/zbus/
Dzbus.h164 void (*callback)(const struct zbus_channel *chan);
181 const struct zbus_channel *chan; member
256 _CONCAT(_chan, _ZBUS_OBSERVATION_PREFIX(UTIL_INC(_idx)))) = {.chan = &_chan, \
316 .chan = &_chan, \
574 int zbus_chan_pub(const struct zbus_channel *chan, const void *msg, k_timeout_t timeout);
593 int zbus_chan_read(const struct zbus_channel *chan, void *msg, k_timeout_t timeout);
616 int zbus_chan_claim(const struct zbus_channel *chan, k_timeout_t timeout);
632 int zbus_chan_finish(const struct zbus_channel *chan);
652 int zbus_chan_notify(const struct zbus_channel *chan, k_timeout_t timeout);
665 static inline const char *zbus_chan_name(const struct zbus_channel *chan) in zbus_chan_name() argument
[all …]
/Zephyr-latest/tests/bsim/bluetooth/host/l2cap/general/src/
Dmain_l2cap_ecred.c78 static struct net_buf *chan_alloc_buf_cb(struct bt_l2cap_chan *chan) in chan_alloc_buf_cb() argument
80 LOG_DBG("Allocated on chan %p", chan); in chan_alloc_buf_cb()
87 l2cap_chan, struct bt_l2cap_le_chan, chan); in chan_recv_cb()
88 struct channel *chan = CONTAINER_OF(l2cap_le_chan, struct channel, le); in chan_recv_cb() local
92 received_iterration, chan->sdus_received, chan->chan_id, buf->len); in chan_recv_cb()
93 if (!TEST_FLAG(unsequenced_data) && received_iterration != chan->sdus_received) { in chan_recv_cb()
98 chan->payload + sizeof(received_iterration), in chan_recv_cb()
105 if (chan->chan_id == 0) { in chan_recv_cb()
112 chan->sdus_received++; in chan_recv_cb()
120 l2cap_chan, struct bt_l2cap_le_chan, chan); in chan_sent_cb()
[all …]
/Zephyr-latest/samples/sensor/sensor_shell/src/
Dfake_sensor.c22 static int attr_set(const struct device *dev, enum sensor_channel chan, enum sensor_attribute attr, in attr_set() argument
25 LOG_DBG("[%s] dev: %p, chan: %d, attr: %d, val1: %d, val2: %d", __func__, dev, chan, attr, in attr_set()
31 static int attr_get(const struct device *dev, enum sensor_channel chan, enum sensor_attribute attr, in attr_get() argument
34 LOG_DBG("[%s] dev: %p, chan: %d, attr: %d", __func__, dev, chan, attr); in attr_get()
36 val->val1 = chan; in attr_get()
42 static int sample_fetch(const struct device *dev, enum sensor_channel chan) in sample_fetch() argument
44 LOG_DBG("[%s] dev: %p, chan: %d", __func__, dev, chan); in sample_fetch()
49 static int channel_get(const struct device *dev, enum sensor_channel chan, struct sensor_value *val) in channel_get() argument
51 LOG_DBG("[%s] dev: %p, chan: %d", __func__, dev, chan); in channel_get()
53 switch (chan) { in channel_get()
[all …]

12345678910>>...22