forked from esp8266/Arduino
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
193 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (C) 2015 -2018 Espressif System | ||
* | ||
*/ | ||
|
||
#ifndef __ESPNOW_H__ | ||
#define __ESPNOW_H__ | ||
|
||
enum esp_now_role { | ||
ESP_NOW_ROLE_IDLE = 0, | ||
ESP_NOW_ROLE_CONTROLLER, | ||
ESP_NOW_ROLE_SLAVE, | ||
ESP_NOW_ROLE_MAX, | ||
}; | ||
|
||
typedef void (*esp_now_cb_t)(u8 *mac_addr, u8 *data, u8 len); | ||
|
||
int esp_now_init(void); | ||
int esp_now_deinit(void); | ||
|
||
int esp_now_register_recv_cb(esp_now_cb_t cb); | ||
int esp_now_unregister_recv_cb(void); | ||
|
||
int esp_now_send(u8 *da, u8 *data, int len); | ||
|
||
int esp_now_add_peer(u8 *mac_addr, u8 role, u8 channel, u8 *key, u8 key_len); | ||
int esp_now_del_peer(u8 *mac_addr); | ||
|
||
int esp_now_set_self_role(u8 role); | ||
int esp_now_get_self_role(void); | ||
|
||
int esp_now_set_peer_role(u8 *mac_addr, u8 role); | ||
int esp_now_get_peer_role(u8 *mac_addr); | ||
|
||
int esp_now_set_peer_channel(u8 *mac_addr, u8 channel); | ||
int esp_now_get_peer_channel(u8 *mac_addr); | ||
|
||
int esp_now_set_peer_key(u8 *mac_addr, u8 *key, u8 key_len); | ||
int esp_now_get_peer_key(u8 *mac_addr, u8 *key, u8 *key_len); | ||
|
||
u8 *esp_now_fetch_peer(bool restart); | ||
|
||
int esp_now_is_peer_exist(u8 *mac_addr); | ||
|
||
int esp_now_get_cnt_info(u8 *all_cnt, u8 *encrypt_cnt); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#ifndef __PWM_H__ | ||
#define __PWM_H__ | ||
|
||
/*pwm.h: function and macro definition of PWM API , driver level */ | ||
/*user_light.h: user interface for light API, user level*/ | ||
/*user_light_adj: API for color changing and lighting effects, user level*/ | ||
|
||
|
||
/*NOTE!! : DO NOT CHANGE THIS FILE*/ | ||
|
||
/*SUPPORT UP TO 8 PWM CHANNEL*/ | ||
#define PWM_CHANNEL_NUM_MAX 8 | ||
|
||
struct pwm_param { | ||
uint32 period; | ||
uint32 freq; | ||
uint32 duty[PWM_CHANNEL_NUM_MAX]; //PWM_CHANNEL<=8 | ||
}; | ||
|
||
|
||
/* pwm_init should be called only once, for now */ | ||
void pwm_init(uint32 period, uint32 *duty,uint32 pwm_channel_num,uint32 (*pin_info_list)[3]); | ||
void pwm_start(void); | ||
|
||
void pwm_set_duty(uint32 duty, uint8 channel); | ||
uint32 pwm_get_duty(uint8 channel); | ||
void pwm_set_period(uint32 period); | ||
uint32 pwm_get_period(void); | ||
|
||
uint32 get_pwm_version(void); | ||
void set_pwm_debug_en(uint8 print_en); | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.1.2_15_06_25_p2 | ||
1.2.0_15_07_03 |