Lines Matching +full:0 +full:- +full:1
1 /* microbit.c - BBC micro:bit specific hooks */
6 * SPDX-License-Identifier: Apache-2.0
23 #define BUZZER_PWM_CHANNEL 0
27 #define SEQ_PAGE (NRF_FICR->CODEPAGESIZE * (NRF_FICR->CODESIZE - 1))
28 #define SEQ_MAX (NRF_FICR->CODEPAGESIZE * 8 * SEQ_PER_BIT)
57 if (target > 0x0009) { in button_pressed()
62 2 * MSEC_PER_SEC, "%X", (target & 0xf)); in button_pressed()
86 return 0; in get_period()
89 for (i = 0; i < ARRAY_SIZE(period_map); i++) { in get_period()
107 uint32_t period, duration = 0U; in board_play_tune()
109 while (*str && isdigit((unsigned char)*str) == 0) { in board_play_tune()
113 while (isdigit((unsigned char)*str) != 0) { in board_play_tune()
115 duration += *str - '0'; in board_play_tune()
123 if (str[1] == '#') { in board_play_tune()
133 PWM_USEC(period) / 2U, 0); in board_play_tune()
139 pwm_set(pwm, BUZZER_PWM_CHANNEL, 0, 0, 0); in board_play_tune()
147 MB_IMAGE({ 1, 1, 1, 1, 1 }, in board_heartbeat()
148 { 1, 1, 1, 1, 1 }, in board_heartbeat()
149 { 1, 1, 1, 1, 1 }, in board_heartbeat()
150 { 1, 1, 1, 1, 1 }, in board_heartbeat()
151 { 1, 1, 1, 1, 1 }), in board_heartbeat()
152 MB_IMAGE({ 1, 1, 1, 1, 1 }, in board_heartbeat()
153 { 1, 1, 1, 1, 1 }, in board_heartbeat()
154 { 1, 1, 0, 1, 1 }, in board_heartbeat()
155 { 1, 1, 1, 1, 1 }, in board_heartbeat()
156 { 1, 1, 1, 1, 1 }), in board_heartbeat()
157 MB_IMAGE({ 1, 1, 1, 1, 1 }, in board_heartbeat()
158 { 1, 0, 0, 0, 1 }, in board_heartbeat()
159 { 1, 0, 0, 0, 1 }, in board_heartbeat()
160 { 1, 0, 0, 0, 1 }, in board_heartbeat()
161 { 1, 1, 1, 1, 1 }), in board_heartbeat()
162 MB_IMAGE({ 1, 1, 1, 1, 1 }, in board_heartbeat()
163 { 1, 0, 0, 0, 1 }, in board_heartbeat()
164 { 1, 0, 0, 0, 1 }, in board_heartbeat()
165 { 1, 0, 0, 0, 1 }, in board_heartbeat()
166 { 1, 1, 1, 1, 1 }), in board_heartbeat()
167 MB_IMAGE({ 1, 0, 1, 0, 1 }, in board_heartbeat()
168 { 0, 0, 0, 0, 0 }, in board_heartbeat()
169 { 1, 0, 0, 0, 1 }, in board_heartbeat()
170 { 0, 0, 0, 0, 0 }, in board_heartbeat()
171 { 1, 0, 1, 0, 1 }) in board_heartbeat()
179 &hops_img[hops - 1], 1); in board_heartbeat()
187 printk("board_other_dev_pressed(0x%04x)\n", addr); in board_other_dev_pressed()
190 (addr & 0xf)); in board_other_dev_pressed()
197 MB_IMAGE({ 0, 0, 0, 0, 0 }, in board_attention()
198 { 0, 0, 0, 0, 0 }, in board_attention()
199 { 0, 0, 1, 0, 0 }, in board_attention()
200 { 0, 0, 0, 0, 0 }, in board_attention()
201 { 0, 0, 0, 0, 0 }), in board_attention()
202 MB_IMAGE({ 0, 0, 0, 0, 0 }, in board_attention()
203 { 0, 1, 1, 1, 0 }, in board_attention()
204 { 0, 1, 1, 1, 0 }, in board_attention()
205 { 0, 1, 1, 1, 0 }, in board_attention()
206 { 0, 0, 0, 0, 0 }), in board_attention()
207 MB_IMAGE({ 1, 1, 1, 1, 1 }, in board_attention()
208 { 1, 1, 1, 1, 1 }, in board_attention()
209 { 1, 1, 0, 1, 1 }, in board_attention()
210 { 1, 1, 1, 1, 1 }, in board_attention()
211 { 1, 1, 1, 1, 1 }), in board_attention()
212 MB_IMAGE({ 1, 1, 1, 1, 1 }, in board_attention()
213 { 1, 0, 0, 0, 1 }, in board_attention()
214 { 1, 0, 0, 0, 1 }, in board_attention()
215 { 1, 0, 0, 0, 1 }, in board_attention()
216 { 1, 1, 1, 1, 1 }), in board_attention()
258 return -EINVAL; in configure_buttons()
274 return -ENODEV; in board_init()
277 *addr = NRF_UICR->CUSTOMER[0]; in board_init()
278 if (!*addr || *addr == 0xffff) { in board_init()
282 *addr = 0x0b0c; in board_init()
287 "0x%04x", *addr); in board_init()