-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add interfaces for crypt and rtc. Streamlinging on uart.
- Loading branch information
Showing
15 changed files
with
326 additions
and
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"type": "library", "name": "ebs-hal-uc", "version": "0.1.3", "spec": {"owner": "chintal", "id": 17231, "name": "ebs-hal-uc", "requirements": null, "uri": null}} | ||
{"type": "library", "name": "ebs-hal-uc", "version": "9.9.9", "spec": {"owner": "chintal", "id": 17231, "name": "ebs-hal-uc", "requirements": null, "uri": null}} |
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 @@ | ||
#include "constants/all.h" |
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,5 @@ | ||
|
||
#include "common.h" | ||
#include "crypto.h" | ||
#include "rtc.h" | ||
#include "uart.h" |
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,14 @@ | ||
|
||
|
||
#ifndef HAL_CONSTANTS_COMMON_H | ||
#define HAL_CONSTANTS_COMMON_H | ||
|
||
#define EBS_FALSE 0 | ||
#define EBS_TRUE 1 | ||
|
||
typedef enum { | ||
_EBS_FALSE = EBS_FALSE, | ||
_EBS_TRUE = EBS_TRUE | ||
} EBS_BOOL_t; | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
#ifndef HAL_CONSTANTS_CRYPTO_H | ||
#define HAL_CONSTANTS_CRYPTO_H | ||
|
||
typedef enum{ | ||
CRYPTO_HW_NEVER, | ||
CRYPTO_HW_IFAVAIL, | ||
CRYPTO_HW_ALWAYS | ||
} CRYPTO_HARDWARE_t; | ||
|
||
typedef enum{ | ||
CRYPTO_AES_ECB, | ||
CRYPTO_AES_CBC, | ||
CRYPTO_AES_CTR, | ||
CRYPTO_AES_GCM, | ||
CRYPTO_AES_GMAC, | ||
CRYPTO_AES_CCM, | ||
} CRYPTO_ALG_t; | ||
|
||
typedef enum{ | ||
CRYPTO_PREINIT, | ||
CRYPTO_IDLE, | ||
CRYPTO_READY, | ||
CRYPTO_BUSY | ||
} CRYPTO_ST_t; | ||
|
||
// Swap operations to deal with endianness differences. | ||
typedef enum{ | ||
CRYPTO_SWAP_1B, | ||
CRYPTO_SWAP_8B, | ||
CRYPTO_SWAP_16B, | ||
CRYPTO_SWAP_NONE | ||
} CRYPTO_SWAP_t; | ||
|
||
typedef enum{ | ||
CRYPTO_CTX_MODE_IDLE, | ||
CRYPTO_CTX_MODE_ENCRYPTION, | ||
CRYPTO_CTX_MODE_DECRYPTION, | ||
CRYPTO_CTX_MODE_SUSPENDED, | ||
} CRYPTO_CTX_MODE_t; | ||
|
||
typedef enum{ | ||
CRYPTO_CTX_PHASE_INIT, | ||
CRYPTO_CTX_PHASE_PREPKEY, | ||
CRYPTO_CTX_PHASE_DERIVATION, | ||
CRYPTO_CTX_PHASE_HEADER, | ||
CRYPTO_CTX_PHASE_PAYLOAD, | ||
CRYPTO_CTX_PHASE_FINAL | ||
} CRYPTO_CTX_PHASE_t; | ||
|
||
typedef enum{ | ||
CRYPTO_TR_PENDING, | ||
CRYPTO_TR_INPROGRESS, | ||
CRYPTO_TR_DONE | ||
} CRYPTO_TR_STATE_t; | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
#ifndef HAL_CONSTANTS_RTC_H | ||
#define HAL_CONSTANTS_RTC_H | ||
|
||
typedef enum{ | ||
RTC_ST_PREINIT, | ||
RTC_ST_IDLE, | ||
RTC_ST_WAIT_READ, | ||
RTC_ST_WAIT_WRITE, | ||
RTC_ST_SYNC | ||
} RTC_ST_t; | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
#ifndef HAL_CONSTANTS_UART_H | ||
#define HAL_CONSTANTS_UART_H | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
|
||
|
||
#include "crypto.h" | ||
#include "crypto.h" | ||
#include "rtc.h" | ||
#include "uart.h" |
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,16 @@ | ||
|
||
|
||
#ifndef HAL_TYPES_RTC_H | ||
#define HAL_TYPES_RTC_H | ||
|
||
#include <stdint.h> | ||
#include <hal/constants/rtc.h> | ||
#include <time/time.h> | ||
|
||
typedef struct RTC_STATE_t { | ||
RTC_ST_t state; | ||
tm_real_t * iobuffer; | ||
void (*cb)(void); | ||
}rtc_state_t; | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
|
||
#ifndef HAL_TYPES_UART_H | ||
#define HAL_TYPES_UART_H | ||
|
||
#include <platform/types.h> | ||
|
||
#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
Oops, something went wrong.